Reputation: 35
I want to use video capture card to capture my screen display, and process the image by OpenCV/C++.
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?
Thanks !!!
Upvotes: 0
Views: 4425
Reputation: 184
I don't know if this helps now. But i found a way using opencv. In linux and python, we achieve this using the following piece of code.
import cv2
cap = cv2.VideoCapture('/dev/video0')
Upvotes: 0
Reputation: 20264
I do not know if there some way to achieve that directly using OpenCV. However, a simple workaround could be like this:
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;
Upvotes: 1