从外部摄像头拍摄的OpenCV [英] OpenCV Capture from external camera
问题描述
我目前正在写使用OpenCV的,并在以下情况下实时应用:
我试图从火线800插入一个HDV摄像机拍摄的图像。
我试图对指数环上cvCaptureFromCam使用,
但没有摄像头无法找到(除了摄像头)。
I'm currently writing an real time application using OpenCV and in the following case: I'm trying to capture an image from a HDV camera plugged in firewire 800. I have tried to loop on index used on cvCaptureFromCam, but no camera can't be found (except the webcam).
还有就是我的code样品,它在指数环(逃避0的原因是网络摄像头的指标):
there is my code sample, it loop on index (escaping 0 cause it's the webcam's index) :
CvCapture* camera;
int index;
for (index = 1; index < 100; ++index) {
camera = cvCaptureFromCAM(index);
if (camera)
break;
}
if (!camera)
abort();
在它停止对中止任何时候。
On any time it stops on the abort.
我编译在OSX 10.7和我已经测试:
I'm compiling on OSX 10.7 and I have tested :
- OpenCV的1.2私有的框架
- OpenCV的2.0私有的框架(这里找到:的 OpenCV2.0.dmg )
- OpenCV的由我自己编(第二版)
我知道问题是省著名商标,并有很多讨论此事,
但我不能TI找到任何解决方案。
I know that the problem is knowned and there is a lot of discussion about this, but I'm not able ti find any solution.
有谁一直在同一案件中?
Does anyone have been in the same case ?
问候。
推荐答案
首页
应在启动 0 而不是 1
如果不工作,也许你的相机不支持的OpenCV。我建议你检查它是否在兼容性列表。
If that doesn't work, maybe your camera is not supported by OpenCV. I suggest you check if it is in the compatibility list.
这篇关于从外部摄像头拍摄的OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!