PiCapture Using Python picamera and opencv Reply To: Using Python picamera and opencv

#766
mwlinder
Keymaster

Mike, I have looked into this and recreated the problem you are seeing. I found that the exact same python code is behaving differently now with the Raspberry Pi camera and the PiCapture, and so something must have changed either in our software or on the Raspberry Pi side.

The behavior is the same as when there is a mismatch because the Raspberry Pi is requesting a camera mode that the PiCapture does not support (for example, if you try running raspivid with “mode 5” specified with the PiCapture SD1), which shows the supplied video in the corner along with the garbage in the GPU buffer that is not being filled, and so I jumped to that conclusion. What you are doing works fine with the camera, and should be working with PiCapture.

I will investigate what is going on, and expect to be able to provide a software update for this issue. This may take some time, and in the interim there is a workaround that I hope will be usable for you. If you specify the “region of interest” (ROI) with picamera it will exclude the garbage. Something like:

camera.zoom = (0.01, 0.01, 0.48, 0.48)

We also suggest turning off some of the video processing intended for the camera. Adding these commands to your code will turn off automatic white balance and exposure compensation that can cause unwanted changes to the picture:

camera.exposure_mode = ‘off’
camera.awb_mode = ‘off’
camera.awb_gains = (1.0,1.0)

Also, the “sleep” to wait for the camera to wake up is not required for PiCapture.

I’m sorry for the problem you ran in to, and hope that this fix works in the interim.

Marshal

  • This reply was modified 3 years, 11 months ago by mwlinder.
mwlinderReply To: Using Python picamera and opencv