我想只要是在安卓上摆弄ARToolkit的人都会遇到这个问题吧:安装正常,打开时Camera显示右上角一个小方块。群里也有人答复过,只要关掉网络就可以了。我尝试后,确实如此。但是爱钻牛角尖的我,想深究一下为啥关掉网络就可以呢?
一通注释/解注释跟踪代码后,发现问题还是出在外部引入的库文件中(如果大家想尝试,也可以看一下ARNativePlugin.cs)。之后再查资料缩小问题范围,发现原来是从5.1版本开始,ARToolkit在android摄像头调用时竟然要链接某个server。这对于天朝的GFW来说就要吐血了。大家来原汁原味一下:
ARToolKit 5.2 and later for Android supports fetching of camera calibration data from an ARToolworks-provided server. On request, ARToolworks provides developers access to an on-device verson of calib_camera which submits calibration data to ARToolworks' server, making it available to all users of that device. The underlying changes to support this include a native version of libARvideo for Android which provides the functions to fetch camera calibration data (note that libARvideo on Android does not handle frame retrieval from the camera; that still happens on the Java side). Existing native apps which wish to use the functionality should follow the example usage from the ARNative example, and also link against libarvideo, and its additional dependencies libcurl, libssl and libcrypto.
然后我就想去修改ARWrapper库文件,但暂时还未找到有效方法,同时也确实没有太多精力研究这个(不是主打方向啊)。请后继者根据我提供的线索,继续走下去吧。有结论的话,也请分享在此处。谢谢了。
一通注释/解注释跟踪代码后,发现问题还是出在外部引入的库文件中(如果大家想尝试,也可以看一下ARNativePlugin.cs)。之后再查资料缩小问题范围,发现原来是从5.1版本开始,ARToolkit在android摄像头调用时竟然要链接某个server。这对于天朝的GFW来说就要吐血了。大家来原汁原味一下:
ARToolKit 5.2 and later for Android supports fetching of camera calibration data from an ARToolworks-provided server. On request, ARToolworks provides developers access to an on-device verson of calib_camera which submits calibration data to ARToolworks' server, making it available to all users of that device. The underlying changes to support this include a native version of libARvideo for Android which provides the functions to fetch camera calibration data (note that libARvideo on Android does not handle frame retrieval from the camera; that still happens on the Java side). Existing native apps which wish to use the functionality should follow the example usage from the ARNative example, and also link against libarvideo, and its additional dependencies libcurl, libssl and libcrypto.
然后我就想去修改ARWrapper库文件,但暂时还未找到有效方法,同时也确实没有太多精力研究这个(不是主打方向啊)。请后继者根据我提供的线索,继续走下去吧。有结论的话,也请分享在此处。谢谢了。