问题描述
我试图使用Android上新的OpenCV的特点:本机摄像头的访问。据本的文件,这是相当容易的,但我只得到没有成功错误
I'm trying to use new OpenCV feature on Android: native camera access. According to this document, it's quite easy, but I only get the error without success.
有DDMS日志:
3月8号至26日:28:56.825:DEBUG / CAMERA_ACTIVITY(12613):库名:libopencv_java.so 三月八日至26日:28:56.825:DEBUG / CAMERA_ACTIVITY(12613):库基地址:0x81800000 三月八日至26日:28:56.835:DEBUG / CAMERA_ACTIVITY(12613):库文件夹中找到:/data/data/com.viactivity.ar/lib/ 三月八日至26日:28:56.835:DEBUG / CAMERA_ACTIVITY(12613):CameraWrapperConnector :: connectToLib:FOLDERPATH = /数据/数据/ com.viactivity.ar / lib中/ 三月八日至26日:28:56.835:ERROR / CAMERA_ACTIVITY(12613):|| libnative_camera_r2.2.2.so 三月八日至26日:28:56.835:ERROR / CAMERA_ACTIVITY(12613):|| libnative_camera_r2.3.3.so 三月八日至26日:28:56.835:DEBUG / CAMERA_ACTIVITY(12613):尝试加载库'libnative_camera_r2.2.2.so 三月八日至26日:28:56.835:DEBUG / CAMERA_ACTIVITY(12613):CameraWrapperConnector :: connectToLib错误:无法的dlopen相机包装库/data/data/com.viactivity.ar/lib/libnative_camera_r2.2.2.so,dlerror获得=不能加载库:find_library [1223] 11258libnative_camera_r2.2.2.so未能pviously加载$ P $ 三月八日至26日:28:56.835:DEBUG / CAMERA_ACTIVITY(12613):尝试加载库'libnative_camera_r2.3.3.so 三月八日至26日:28:56.835:DEBUG / CAMERA_ACTIVITY(12613):CameraWrapperConnector :: connectToLib错误:无法的dlopen相机包装库/data/data/com.viactivity.ar/lib/libnative_camera_r2.3.3.so,dlerror获得=不能加载库:find_library [1223] 11258libnative_camera_r2.3.3.so未能pviously加载$ P $ 三月八日至26日:28:56.835:ERROR / CAMERA_ACTIVITY(12613):CameraWrapperConnector :: connectToLib错误:无法的dlopen相机包装库 三月八日至26日:28:56.835:ERROR / CV_CAP(12613):Native_camera返回打开错误:4 三月八日至26日:28:56.835:ERROR / AR_ code(12613):捕获错误
有中code两个变种:
There are two variants of code:
CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANDROID + 0 );
IplImage* frame = cvQueryFrame( capture );
cvReleaseCapture(&capture);
cv::VideoCapture capture(CV_CAP_ANDROID + 0);
cv::Mat frame;
capture >> frame;
他们都产生了同样的错误。是否有人能获得Android原生相机的访问?非常感谢!
Both of them produce the same errors.Does somebody was able to get native camera access on Android?Thanks a lot!
UPD:上面的故事是关于Android 3.2。据安德烈Kamaev的话,安卓3.2,不支持。我试图测试在HTC野火一样code,却得到了另一个错误:
UPD:The story above is about Android 3.2. According to the words of Andrey Kamaev, Android 3.2 isn't supported.I tried to test the same code on HTC Wildfire, but got another error:
08-26 19:49:06.856:DEBUG / OpenCV_NativeCamera(1337): CameraHandler :: initCameraConnect(0x813e65a1,0,0x285a20,为0x0)08-26 19:49:06.856:DEBUG / CameraService(72):CameraService ::连接E(PID 1337,客户端0x693d8)08-26 19:49:06.856:DEBUG / CameraService(72): CameraService ::连接X(PID 1337,新的客户端0x693d8)拒绝。 (旧 PID 1337,老客户0x18728)08-26 19:49:06.856: ERROR / OpenCV_NativeCamera(1337):initCameraConnect:无法连接 以CameraService 08-26 19:49:06.856:ERROR / CAMERA_ACTIVITY(1337): CameraWrapperConnector :: connectWrapper错误:初始化 函数返回false 08-26 19:49:06.856:ERROR / CV_CAP(1337): Native_camera返回打开错误:6
任何想法?
推荐答案
目前OpenCV的本地摄像头不支持Android 3.2(因为它的来源是不公开的。)
At the moment OpenCV native camera does not support Android 3.2 (because its sources are not publicly available.)
我会尽快发布一个更新的版本与Android 3.2兼容变得可用。
I'll post an update as soon as version compatible with Android 3.2 become available.
OpenCV的树干已经有针对Android 3.x和4.0.x的解决方案它将被纳入的OpenCV的下一个主要版本。
OpenCV trunk already has solution for Android 3.x and 4.0.x. It will be included into the next major release of OpenCV.
这篇关于OpenCV的2.3:如何捕获从Android摄像头帧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!