Freenove / Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi

Apply to FNK0043
Other
138 stars 154 forks source link

Camera command fails in test.py #3

Closed ghost closed 4 years ago

ghost commented 4 years ago

For some reason, when I 'cd' to the data folder (Freenove_4WD_Smart_car_Kit_for_Raspberry_pi-master), and then to Code/Server, and run sudo python test.py Camera, it starts up, waits for a couple seconds, then exits with this error: OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /build/opencv-L65chJ/opencv-3.2.0+dfsg/modules/highgui/src/window.cpp, line 304 Traceback (most recent call last): File "test.py", line 167, in <module> test_Camera() File "test.py", line 137, in test_Camera cv2.imshow("Capture", frame) cv2.error: /build/opencv-L65chJ/opencv-3.2.0+dfsg/modules/highgui/src/window.cpp:304: error: (-215) size.width>0 && size.height>0 in function imshow. Any code tweaks that could fix this? Thanks.

ghost commented 4 years ago

I found the answer, so this will be closed.