简体   繁体   English

使用emguCV(OpenCV)来捕获来自Firewire摄像机的2个不同程序中的视频?

[英]Using emguCV (OpenCV) to capture video in 2 different program from the firewire camera?

I'm looking for a way to use OpenCV (or specifically emguCV in C#) to capture video from the same firewire on 2 different programs simultaneously. 我正在寻找一种使用OpenCV(或C#中的emguCV)从2个不同程序上的同一火线同时捕获视频的方法。 Some posts here said that it can't be done since the source driver would be locked into one application at a time. 这里的一些帖子说这无法完成,因为源驱动程序会一次锁定在一个应用程序中。

I found some answers here suggesting the use of SplitCam , but it seems to only work with Webcam. 我在这里找到了一些建议使用SplitCam的 答案 ,但这似乎仅适用于网络摄像头。 Also I don't like the ads on SplitCam (but I can't complain since it's a freeware). 另外,我也不喜欢SplitCam上的广告(但我不能抱怨,因为它是免费软件)。

SplitCam seems to be using the source signal and creates a virtual driver for other programs to use. SplitCam似乎正在使用源信号,并创建了虚拟驱动程序供其他程序使用。 Is there a way to do the same thing as SplitCam does using OpenCV? 有没有办法像使用OpenCV进行SplitCam一样? OpenCV can access firewire camera and I have no issue using it in emguCV with a single program running. OpenCV可以访问火线摄像机,并且在emguCV中运行单个程序就可以使用它。

After searching for a while, I found 2 different solutions. 经过一段时间的搜索,我发现了2种不同的解决方案。

1) Implement DirectShow Virtual Video Capture Source Filter. 1)实现DirectShow虚拟视频捕获源过滤器。 This project has been documented quite well over at CodeProject . 该项目已在CodeProject上得到了很好的记录。 This method takes a bit of a learning curve since I don't know much about DirectShow. 由于我对DirectShow不太了解,因此该方法需要一些学习技巧。

2) Use a 3rd Party component. 2)使用第3方组件。 I found one from e2esoft that works like SplitCam but it's an SDK that you can use in your own project. 我从e2esoft找到了一个与SplitCam类似的工具,但是它是一个可以在自己的项目中使用的SDK。 They already have a CSharp example. 他们已经有一个CSharp示例。 I did have a little bit of issue (Error 80040154) using the COM object provided with this example since it's a 32-bit COM object but I'm running a 64-bit Windows 7. I found a work around here using the registry hack. 使用此示例提供的COM对象确实存在一些问题(错误80040154),因为它是32位COM对象,但我运行的是64位Windows7。我发现这里存在使用注册表黑客的问题。

I ended up going with solution #2 since it's easy to implement quickly. 我最终选择了解决方案2,因为它易于快速实施。 I use the component to create a virtual device that grabs the video from the main firewire camera device. 我使用该组件创建了一个虚拟设备,该虚拟设备从主要的火线摄像头设备获取视频。 After that my program that uses the emguCV to grab frame can just grab from the virtual device. 之后,使用emguCV抓取帧的程序就可以从虚拟设备抓取。 The virtual device can be used by multiple sources and so far I have 3 instances of my program grabbing from the virtual device and I don't see any lag in frame rates (granted that this firewire camera is only running 15FPS max). 该虚拟设备可以由多个来源使用,到目前为止,我有3个实例从该虚拟设备中捕获了程序,而且我看不到帧速率有任何滞后(这是因为该火线摄像机最大只能运行15FPS)。 The downside to this solution is that I would have to pay for the license to get rid of the water mark on the video. 这种解决方案的缺点是我必须支付许可证费用才能摆脱视频上的水印。 I'll update this when I found out how much it is since they don't post the price of SDK on the website. 当我发现价格是多少时,我会进行更新,因为他们没有在网站上发布SDK的价格。 If it's really expensive, I'll have to go to the first solution and learn to implement the DirectShow filter. 如果真的很昂贵,我将不得不去第一个解决方案并学习实现DirectShow过滤器。

Edit 1-16-2013: The price of the VCam SDK is $699. 编辑1-16-2013:VCam SDK的价格为699美元。

在此处输入图片说明

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

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