简体   繁体   English

没有openCV的c ++中的网络摄像头访问

[英]Webcam access in c++ without openCV

Can I make some c++ webcam program without using opencv (and without others external library)? 我可以在不使用opencv(没有其他外部库)的情况下制作一些c ++网络摄像头程序吗? My idea is to take the data from the webcam and display it on window, like a live video. 我的想法是从网络摄像头获取数据并将其显示在窗口上,就像实时视频一样。 Could you show me some example? 你能告诉我一些例子吗? Sorry for my bad english. 对不起,我的英语不好。 Thank you very much. 非常感谢你。

Long story short: for windows and C/C++ the most straightforward way is by using the DirectShow. 简而言之:对于Windows和C / C ++,最直接的方法是使用DirectShow。

There is a nice wrapper of DirectShow framegrabber here: http://www.muonics.net/school/spring05/videoInput/ 这里有一个很好的DirectShow framegrabber包装器: http//www.muonics.net/school/spring05/videoInput/

Yes, you still need the DXSDK installed, but actually I managed to extract the required DShow interfaces into the single 100kb file. 是的,您仍然需要安装DXSDK,但实际上我设法将所需的DShow接口提取到单个100kb文件中。 So my advice: live with the videoInput library. 所以我的建议是:使用videoInput库。

On linux the Video4Linux(2) library is somewhat simpler. 在linux上,Video4Linux(2)库有点简单。 Everything is done through file-like APIs. 一切都是通过类似文件的API完成的。

On MacOS X you have the QTKit . 在MacOS X上你有QTKit To make a simple window with live camera stream is a breeze. 使用实时摄像机流制作一个简单的窗口是轻而易举的。 The sample is right in the Apple's documentation. 样本正好在Apple的文档中。

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

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