Last active
May 21, 2018 05:43
-
-
Save pythonsuezo/f0ad92f08a9eb2ac0959d24c6f0c63f5 to your computer and use it in GitHub Desktop.
カメラ画像加工器その2 PCにつながっているカメラの画像を取得するコード1
This file contains hidden or 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
| import cv2 | |
| capture = cv2.VideoCapture(0) | |
| capture.grab() | |
| while 1: | |
| ret, image = self.capture.read() | |
| if ret == False: | |
| continue | |
| cv2.imshow("Capture", image) | |
| k == cv2.waitKey(10) & 0xff | |
| live = cv2.getWindowProperty("Capture", 0) | |
| if k == 27 or not live: | |
| print("end") | |
| break | |
| cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment