0

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 !!!

Halley Wang
  • 35
  • 1
  • 8
  • Could you be more specific about the capture card? Do you want a LVDS frame grabber, A MIPI to USB converter, ... ? – Alper Kucukkomurler Mar 31 '17 at 06:08
  • @ Alper Kucukkomurler hi, sorry for the late reply. The capture card I want to buy is a pcie capture card. If the pcie capture card is in pc B, the input of the capture card is from pc A via HDMI (the display which I want to capture.), and the output of the capture card need to be captured by pc B which is considered as webcam. – Halley Wang Apr 01 '17 at 13:39

2 Answers2

1

I do not know if there some way to achieve that directly using OpenCV. However, a simple workaround could be like this:

  1. Using this software you can create new webcam that stream your screen: https://sparkosoft.com/how-to-stream-desktop-as-webcam-video
  2. 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;
    
Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
  • Thanks for the reply!! But I'm going to stream my screen display to six monitors, I'm wondering if this could afford it or not... Back to your answer, so if I use this app, I can create my own webcam ID and display it in OpenCV? How can I know the device ID? – Halley Wang Mar 31 '17 at 06:03
0

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')
Naveen Kumar
  • 164
  • 1
  • 4
  • 9