问题描述
我正在尝试使用Windows XP上的OpenCV 2.3.1从Claron MicronTracker凸轮(FireWire)捕获图像.函数cvCaptureFromCAM
不起作用.我读到OpenCV在Windows平台上无法从USB以外的数码相机获取数据-这是真的吗?在Windows上没有使用OpenCV从FireWire凸轮获取数据的解决方案吗?
I am trying to capture image from a Claron MicronTracker cam (FireWire) using OpenCV 2.3.1 on Windows XP. The function cvCaptureFromCAM
does not work. I read that OpenCV is unable to get data from digital cameras other than USB ones under Windows platforms - is this true? There is no solution for getting data from a FireWire cam using OpenCV on Windows?
请帮助我.
推荐答案
您当然可以在Windows的Firewire摄像机上使用OpenCV.我已经与多家不同的Firewire相机供应商(Point Grey,Imaging Source等)完成了此任务.不幸的是,您将无法使用OpenCV VideoCapture
类执行此操作.
You can certainly use OpenCV with Firewire cameras on Windows. I have done this with several different Firewire camera vendors (Point Grey, Imaging Source, etc.). Unfortunately, you will not be able to use the OpenCV VideoCapture
class to do this.
您的选择是使用 CMU1394 驱动程序(假设您使用上述相机兼容),或供应商的摄像头驱动程序来捕获帧并将这些数据缓冲区放置在cv::Mat
中.如果您需要对摄像机参数进行特定控制,那么最好的选择就是使用供应商的驱动程序.这将为您提供最大的控制权,但将您与他们的相机紧密耦合.您可以子类化VideoCapture
,并在同一接口下实现供应商的驱动程序,以在某种程度上减轻这种耦合.
Your options are to use the CMU1394 driver (assuming your above mentioned camera is compatible with it), or the vendor's camera driver to capture the frames and the place those data buffers in the a cv::Mat
. If you need specific control of the camera parameters, your best bet is going to be to use the vendor's driver. This will give you the most control, but tightly couple you to their camera. You could sub-class VideoCapture
, and implement the vendor's driver under the same interface to mitigate that coupling somewhat.
编辑:我今天发现,OpenCV自2010年5月起就内置了对CMU兼容摄像机的支持.实现此目标的类为此处.我不认为默认情况下会将其编译到库中.因此,您将不得不从源代码自己构建OpenCV.您需要取消注释//#define HAVE_CMU1394 1
行以使其起作用.希望对您有所帮助!
I found out today that OpenCV has had built in support for CMU compatible cameras since May 2010. The class which implements this is here. I do not believe this is compiled into the libraries by default. So, you are going to have to build OpenCV from source yourself. You'll need to uncomment the line //#define HAVE_CMU1394 1
to get it to work. Hope that is helpful!
这篇关于无法使用OpenCV从FireWire凸轮捕获图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!