Skip to content

Instantly share code, notes, and snippets.

@KenoLeon
Created August 4, 2020 02:42
Show Gist options
  • Select an option

  • Save KenoLeon/60a4ab63f350bf47f4871eee4b437c5c to your computer and use it in GitHub Desktop.

Select an option

Save KenoLeon/60a4ab63f350bf47f4871eee4b437c5c to your computer and use it in GitHub Desktop.
import cv2
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
# Change colorspace:
gray = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
cv2.imshow('frame', gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment