Open ben-barnard opened 5 years ago
I was also using v1.3. Maybe you can try the following:
a. sudo apt-get update and followed by upgrade b. Try “raspistill -o xxx.jpg” to see if your camera is able to capture an image c. In the code, reduce the resolution ie.
Uncomment and comment out the higher resolution parameters
I followed the tutorial to the letter, and I'm so close! When I run "python3 Object_detection_picamera.py" I get the following. This website seems to indicate that it's a truncation problem. I'm not sure what to make of it, because your code looks like it's already doing what the link suggests.
My Pi Camera is an older Rev 1.3, would that matter? Using a RPi3 otherwise.
Traceback (most recent call last): File "/home/pi/.local/lib/python3.5/site-packages/picamera/camera.py", line 1704, in capture_continuous 'Timed out waiting for capture to end') picamera.exc.PiCameraRuntimeError: Timed out waiting for capture to end
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "Object_detection_picamera.py", line 130, in
for frame1 in camera.capture_continuous(rawCapture, format="bgr",use_video_port=True):
File "/home/pi/.local/lib/python3.5/site-packages/picamera/camera.py", line 1710, in capture_continuous
encoder.close()
File "/home/pi/.local/lib/python3.5/site-packages/picamera/encoders.py", line 431, in close
self.stop()
File "/home/pi/.local/lib/python3.5/site-packages/picamera/encoders.py", line 419, in stop
self._close_output()
File "/home/pi/.local/lib/python3.5/site-packages/picamera/encoders.py", line 349, in _close_output
mo.close_stream(output, opened)
File "/home/pi/.local/lib/python3.5/site-packages/picamera/mmalobj.py", line 371, in close_stream
stream.flush()
File "/home/pi/.local/lib/python3.5/site-packages/picamera/array.py", line 238, in flush
self.array = bytes_to_rgb(self.getvalue(), self.size or self.camera.resolution)
File "/home/pi/.local/lib/python3.5/site-packages/picamera/array.py", line 127, in bytes_to_rgb
'Incorrect buffer length for resolution %dx%d' % (width, height))
picamera.exc.PiCameraValueError: Incorrect buffer length for resolution 1280x720