Skip to content

Instantly share code, notes, and snippets.

@adujardin
Last active February 14, 2018 17:25
Show Gist options
  • Save adujardin/64208621c761ed811eb6b9dce705d559 to your computer and use it in GitHub Desktop.
Save adujardin/64208621c761ed811eb6b9dce705d559 to your computer and use it in GitHub Desktop.
Capture a ZED image with openCV from python without the SDK
import numpy as np
import cv2
cap = cv2.VideoCapture(0) # depending on the ZED ID
while(True):
ret, frame = cap.read() # Capture SbS frames
height, width = frame.shape[:2]
left = frame[0:height,0:int(width*0.5)]
# Display
cv2.imshow('frame',left)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment