title: How to calculate Depth Information from USB 3.0 Stereo Camera?
body: <p>I'm interested in using a stereo camera for calculating depth in video/images. The camera is a USB 3.0 Stereoscopic camera from Leopard Imaging <a href="https://www.leopardimaging.com/LI-USB30-V024STEREO.html" rel="nofollow noreferrer">https://www.leopardimaging.com/LI-USB30-V024STEREO.html</a>. I'm using MAC OS X btw. </p>
  
  <p>I was told by their customer support that it's a "UVC" camera. When connected to an apple computer it gives a greenish image.</p>
  
  <p><img src="https://i.imgur.com/hqJ0LkX.jpg?1" alt=""></p>
  
  <p>My end goal is to use OpenCV to grab the left and right frames from both lenses so that I can calculate depth. I'm familiar with OpenCV, but not familiar with working with stereo cameras. Any help would be much appreciated. So far I have been doing this in Python 3:</p>
  
  <pre><code>import numpy as np
  import cv2
  import sys
  from matplotlib import pyplot as plt
  
  import pdb; pdb.set_trace()
  print("Camera 1 capture", file=sys.stderr)
  cap = cv2.VideoCapture(1)
  
  print("Entering while", file=sys.stderr)
  while(True):
      _ = cap.grab()
      retVal, frame = cap.retrieve()
  
      #gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  
      cv2.imshow('frame', frame)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>This works, but it only gives me a green picture/image with no depth. Any advice on how to get both left and right frames from the camera?</p>