Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello,

Did you check using your normal computer vision code, your camera is working? I think that this is a problem with your OS.

For troubleshooting, try this:

Can you confirm that you are able to see a video of your camera using this code?

import cv2
import numpy as np

cap = cv2.VideoCapture(0)

if (cap.isOpened()== False): 
  print("Error opening video stream or file")

while(cap.isOpened()):
  ret, frame = cap.read()
  if ret == True:
    cv2.imshow('Frame',frame)
    if cv2.waitKey(25) & 0xFF == ord('q'):
      break
  else: 
    break
cap.release()
cv2.destroyAllWindows()

If no, then you should raise your question to https://raspberrypi.stackexchange.com/. It's an OS issue.