pythonでopencvまとめ
インストール
2020/08/02現在で4.3.0
pip install opencv-python
>>python Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 >>> cv2.__version__ '4.3.0' >>>
USBカメラから動画を取得
cap= cv2.VideoCapture(0) while(True): ret, frame = cap.read() cv2.imshow('usb cam',frame) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()