Last active
September 2, 2020 04:36
-
-
Save oza6ut0ne/9ce1b86bb6be250c009cb792a1eba034 to your computer and use it in GitHub Desktop.
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
| %matplotlib inline | |
| import cv2 | |
| import matplotlib.pyplot as plt | |
| from IPython.display import clear_output | |
| cap = cv2.VideoCapture(2) | |
| try: | |
| while True: | |
| ret, img = cap.read() | |
| if not ret: | |
| cap.release() | |
| break | |
| rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) | |
| plt.axis('off') | |
| plt.title("video") | |
| plt.imshow(rgb) | |
| plt.show() | |
| clear_output(wait=True) | |
| except KeyboardInterrupt: | |
| cap.release() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment