带有 OpenCV 的视频采集卡(类似网络摄像头) [英] video capture card (webcam like) with OpenCV
本文介绍了带有 OpenCV 的视频采集卡(类似网络摄像头)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用视频采集卡来捕捉我的屏幕显示,并通过 OpenCV/C++ 处理图像.
I want to use video capture card to capture my screen display, and process the image by OpenCV/C++.
我听说有一些类似于网络摄像头的视频采集卡.(即我可以在 OpenCV 中通过 VideoCapture 获取屏幕显示.)
I have heard that there's some video capture card which is webcam like.(i.e. I can get the screen display by VideoCapture in OpenCV.)
谁能告诉我应该买哪种视频采集卡?
Can someone tell me which video capture card should I buy?
谢谢!!!
推荐答案
我不知道是否有某种方法可以直接使用 OpenCV 来实现.但是,一个简单的解决方法可能是这样的:
I do not know if there some way to achieve that directly using OpenCV. However, a simple workaround could be like this:
- 使用此软件,您可以创建流式传输屏幕的新网络摄像头:https://sparkosoft.com/how-to-stream-desktop-as-webcam-video
使用 OpenCV,您可以使用以下代码开始捕获流:
- Using this software you can create new webcam that stream your screen: https://sparkosoft.com/how-to-stream-desktop-as-webcam-video
Using OpenCV you can start capture the stream using this code:
cv::VideoCapture cap;
if(!cap.open(0)) // Use the new webcam Id instead of 0
return 0;
while(true){
cv::Mat frame;
cap >> frame;
if(frame.empty()) break;
cv::imshow("Screen", frame);
if( waitKey(10) == 27 ) break;
}
return 0;
这篇关于带有 OpenCV 的视频采集卡(类似网络摄像头)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文