Skip to content

Instantly share code, notes, and snippets.

@oza6ut0ne
Last active September 2, 2020 04:36
Show Gist options
  • Select an option

  • Save oza6ut0ne/9ce1b86bb6be250c009cb792a1eba034 to your computer and use it in GitHub Desktop.

Select an option

Save oza6ut0ne/9ce1b86bb6be250c009cb792a1eba034 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
%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