简体   繁体   English

在Android上使用USB相机和OpenCV

[英]using usb camera with opencv on android

I am trying to use a UVC camera with opencv for real time detection, similar to the sample from http://romanhosek.cz/android-eye-detection-updated-for-opencv-2-4-6/.however , i found a problem that opencv need the CameraBridgeViewBase class to interact with camera. 我正在尝试使用带有opencv的UVC摄像机进行实时检测,类似于来自http://romanhosek.cz/android-eye-detection-updated-for-opencv-2-4-6/的示例。发现了一个问题,opencv需要CameraBridgeViewBase类与相机进行交互。

i tried to use the setCameraIndex to set the UVC cam, but seems like i cannot find the camera index of uvc cam when i set the index to 0 and 1, the app work properly with front cam and back cam of my phone(galaxy S3) 我尝试使用setCameraIndex设置UVC凸轮,但是当我将索引设置为0和1时似乎找不到uvc凸轮的摄像机索引,该应用程序可以与手机的前凸轮和后凸轮正常工作(银河S3 )

i have tried other libraries (lately https://github.com/saki4510t/UVCCamera ) to build connection with the cam then use opencv to process the frame but it never work as i cannot use the cam dirrectly without CameraBridgeViewBase 我已经尝试了其他库(最新https://github.com/saki4510t/UVCCamera )与cam建立连接,然后使用opencv处理帧,但由于我没有CameraBridgeViewBase无法直接使用cam,因此它永远无法工作

is there any way i can find the camera index of the uvc cam? 有什么办法可以找到uvc cam的相机索引? or is there anyway to use it without CameraBridgeViewBase ? 还是在没有CameraBridgeViewBase的情况下可以使用它?

您可以从saki4510t / UVCCamera获取相机预览位图,然后使用opencv通过该位图进行一些工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM