waveform80 / picamera

A pure Python interface to the Raspberry Pi camera module
https://picamera.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.57k stars 355 forks source link

i am facing issue with Usb Webcam using rasberypi in opencv python. #602

Closed AafaqueAli closed 4 years ago

AafaqueAli commented 4 years ago

Hello please help me i am doing my final year project its about face recognition all system is going well but i am not able to use webcam video/image in rasbery pi4 using python. same code is working in Laptop but not working in RasberyPi . errors are : select timeout Traceback (most recent call last): File "final.py", line 83, in run self.myCamFun() File "final.py", line 106, in myCamFun print(frame.shape) AttributeError: 'NoneType' object has no attribute 'shape' Aborted

cap = cv2.VideoCapture(0) this line is working ok in Macbook but working in R.Pi .

AafaqueAli commented 4 years ago

cap = cv2.VideoCapture("location of images i want to use") if i use line it is working, it means frame can not open from webcam to capture video or images.