Umar Dastgir
Umar Dastgir

Reputation: 724

PiCamera pictures inconsistent

I am working with a Raspberry pi with a camera module (Raspberry pi Camera) mounted on a drone and programmed to take pictures after a fixed interval. However, the images seem to be a bit inconsistent as seen below .

Images 4 and 8 appear to have slightly more 'colored' as compared to other images and appear to have more saturation. However, as the default saturation is 0 and my code is not changing that, I believe it is something else. My python script is as below

def calibrate(t):
    with picamera.PiCamera() as camera:
       time.sleep(t)
       camera.shutter_speed = camera.exposure_speed
       ss=camera.shutter_speed
       camera.still_stats = 'true'
       camera.exposure_mode = 'off'
       g = camera.awb_gains
       camera.awb_mode = 'off'
       camera.awb_gains = g
       camera.close()
       return ss,g

def capture(ss,g,stream):
    with picamera.PiCamera() as camera:           
       camera.resolution = (3280,2464)       
       camera.shutter_speed = ss
       camera.still_stats
       camera.exposure_mode = 'off'
       camera.awb_mode = 'off'
       camera.awb_gains = g
       camera.still_stats = 'true'
       camera.capture(stream,format='jpeg')
       camera.close()

I call the calibrate function before taking any pictures that calibrate the camera. After calibrating, I take the pictures and get this problem. Does anyone know how to solve this?

Upvotes: 3

Views: 838

Answers (1)

Dark Falcon
Dark Falcon

Reputation: 44201

From the docs:

Enabling the still statistics pass will override fixed white balance gains (set via awb_gains and awb_mode).

I would bet that awb_mode gets set back to something other than off when you change still_stats. Exact same problem seems to be reported here.

Upvotes: 1

Related Questions