使用 Visual C++ 捕获网络摄像头视频6.0
我正在尝试创建一个应用程序来使用网络摄像头捕获快照。
我已经能够使用 WIA 完成此任务,但是当在 Windows 7 上使用分辨率超过 1.3 兆像素的相机运行时,该解决方案变得不稳定。我们正在为一台内置 2.0 兆像素网络摄像头的平板电脑编写代码。
我并不反对使用直接显示,但我想远离.net。
我到处寻找解决方案,但无法从 Windows 平台 sdk 或 directx 9.0 获取 directshow 示例,甚至无法在 Visual Studio 6.0 上进行编译。我也没有运气 OpenCV。
有没有人可以为我指明教程的方向,让我开始走上正确的道路?
谢谢
I am trying to create an application to capture a snapshot using a webcam.
I have been able to accomplish this using WIA, but this solution becomes unstable when ran on Windows 7 with a camera that has a resolution of more than 1.3 megapixels. We are coding for a tablet computer that has a built in webcam with 2.0 megapixels.
I am not opposed to using direct show, but I would like to stay away from .net.
I have searched high and low for a solution and I can not get the directshow examples from the windows platform sdk or directx 9.0 to even compile on Visual Studio 6.0. I have also had no luck OpenCV.
Is there anyone that could point me in the direction of a tutorial that might get me started down the right path?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法是包装 directshow 的 videoinput lib,它与 openCV 使用的库相同。
如果这还不够好,那么 Microsoft SDK 的多媒体/directshow 目录中的 AMCAP 示例将展示如何在 directshow
ps 中运行相机。正如 Hans 所说,你应该更新编译器,VC++6 有点旧了。他们有一个免费版本最新的vs2010。
The simplest way is videoinput lib that wraps directshow, it's the same lib used by openCV.
If that isn't good enough then the AMCAP sample in the multimedia/directshow dir of the Microsoft SDK shows how to run a camera in directshow
ps. as Hans said you should update the compiler,VC++6 is little old. There is a free version of their latest vs2010.
我发现这个教程非常棒,而且非常简单。我发现它可以在 XP 和 win7 上使用旧网络摄像头和新网络摄像头。
我使用了第二个示例,它是一个半 directshow 示例,但绕过了大部分 directshow。
不过,您确实需要添加错误处理。
http://www.codeproject.com/KB/audio-video/VideoImageGrabber.aspx
I found this tutorial excellent and it is so simple. I found it worked on XP and win7 with an old webcam and a new one.
I used the second example which is a semi-directshow one, but bypasses most of directshow.
You do need to add error handling though.
http://www.codeproject.com/KB/audio-video/VideoImageGrabber.aspx