Created
June 28, 2012 02:16
-
-
Save emctoo/3008340 to your computer and use it in GitHub Desktop.
read camera with OpenCV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import cv2 | |
if __name__ == "__main__": | |
''' ''' | |
camera = cv2.VideoCapture(0) | |
while True: | |
# cv2.VideoCapture return a tuple, (Bool, Numpy.ndarray) | |
_, im = camera.read() | |
cv2.imshow("camera", im) | |
if cv2.waitKey(40) > 0 : break | |
print "Exit ..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Data returned is different from C++ version, check before using.