I am unable to run opencv’s imshow to run a camera loop on it to analyze information from the camera.
import cv2
# Create a VideoCapture object to access the default camera
cap = cv2.VideoCapture(0)
while True:
# Read the frames from the camera
ret, frame = cap.read()
# Display the frames
cv2.imshow("Camera", frame)
# Break the loop when 'q' is pressed
if cv2.waitKey(1) & 0xFF == ord("q"):
break
# Release the VideoCapture object and close the OpenCV windows
cap.release()
cv2.destroyAllWindows()