mirror of
https://github.com/modelec/detection_pot.git
synced 2026-01-19 00:57:28 +01:00
22 lines
430 B
Python
22 lines
430 B
Python
import numpy as np
|
|
import cv2
|
|
|
|
cap = cv2.VideoCapture(0)
|
|
if not cap.isOpened():
|
|
print("Cannot open camera")
|
|
exit()
|
|
|
|
while True:
|
|
ret, frame = cap.read()
|
|
|
|
if not ret:
|
|
print("Can't receive frame (stream end?). Exiting ...")
|
|
break
|
|
|
|
#video = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
|
|
cv2.imshow("frame", frame)
|
|
if cv2.waitKey(1) == ord("q"):
|
|
break
|
|
|
|
cap.release()
|
|
cv2.destroyAllWindows() |