title: OPENCV Desktop Capture
body: <p><a href="https://stackoverflow.com/questions/14148758/how-to-capture-the-desktop-in-opencv-ie-turn-a-bitmap-into-a-mat">How to capture the desktop in OpenCV (ie. turn a bitmap into a Mat)?</a></p>
  
  <p>Hello,</p>
  
  <p>Can anyone explain to me how I would use this code in OpenCV to capture the desktop screen? I've been trying to get it to work for about 30-45 minutes but my screen doesn't capture anything when I run it.</p>
  
  <p>In my application from main I have the follow three statements</p>
  
  <pre><code>HWND hwndDesktop = GetDesktopWindow();
  hwnd2mat(hwndDesktop);
  imshow("output", src);
  </code></pre>
  
  <p>i'm calling the function hwnd2mat that is found in the link above.
  i'm a noob.</p>
  
  <p>Thanks to anyone who answers.</p>