获得网络摄像头图像 [英] Get image from webcam

查看:205
本文介绍了获得网络摄像头图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到在托管的C#从摄像头获取的图像(仅图像,而不是视频流)的方式。
通常人们暗示库,但他们都老了或商业,或根据GPL。 ?

I'm trying to find the way for getting image (only image, not video stream) from webcam in managed C#. Usually people suggesting libraries, but they are old or commercial or under gpl.

如何从网络摄像头获取图像,无需第三方库

How get image from webcam without third-party libraries?

UPD:感谢媒体基金会,我会使用它。

upd.: thanks for Media Foundation, I shall use that.

推荐答案

网络摄像头都应该能够提供视频输入,不剧照。所以,你可能会感兴趣的原生API是一个用于视频拍摄,这是DirectShow和媒体基金会。

Web cameras are supposed to deliver video feeds, not stills. So the native API you might be interested in is the one for video capture, which are DirectShow and Media Foundation.

您最有可能想要的是DirectShow的,但它是不是非常适合于从托管代码接口,所以你需要一个 DirectShow.NET 这是开源的包装。通常,您有启动视频流,一旦你有一个良好的形象,你停止活动。

The one you would most likely want is DirectShow, but it is not well suited to be interfaced from managed code, so you will need a DirectShow.NET which is open source wrapper. You typically start video streaming there and once you have a good image you stop the activity.

或替代你可能会不停地寻找一个准备使用它可以完成上述提到你的资料库。

Or instead you might keep looking for a ready to use library which does the mentioned above for you.

其中一个DirectShow.NET样品做了你找什么

One of DirectShow.NET samples does what you look for.

DxSnap - 使用DirectShow报平安从$ b $的静止销b捕捉设备。注意MS鼓励您使用WIA这一点,但如果
你想用DirectShow和C#做的,这里的如何。

DxSnap – Use DirectShow to take snapshots from the Still pin of a capture device. Note the MS encourages you to use WIA for this, but if you want to do in with DirectShow and C#, here's how.

它提到威亚,但WIA API是不是适用于所有(或任何在最近的操作系统?)网络摄像头,WIA更多的目标设备,如扫描仪等。

It mentions WIA, however WIA API is not available for all (or any in recent OSes?) web cameras, WIA more targets device like scanners.

其他API也许不太适合。

Other APIs are perhaps less suitable.


  • VFW(avicap32.dll),限制了你的设备的一个子集,很简单,但没有很好地对接成托管代码

  • 媒体基金会是在早期的操作系统版本以及可用

这篇关于获得网络摄像头图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆