Skip to content

New AWB algorithm breaks AWB gains after resolution change #1215

@jtc42

Description

@jtc42

Describe the bug
When using the new AWB algorithm, setting AWB gains is broken after changing the camera resolution (and possibly other properties?). Upon changing the resolution, the AWB gains seem to reset to their Auto values, and changing them back is broken.

To reproduce
Easiest to demonstrate in Python

import picamera as cam
import time

c = cam.PiCamera()
c.start_preview()

# Set the AWB mode to change the gains
c.awb_mode = "tungsten"
time.sleep(2)

# Show, and store, the gains it settled on
print(c.awb_gains)
g = c.awb_gains

# Turn auto AWB off, fixing the gains
c.awb_mode = "off"
time.sleep(2)

# Store the current resolution
r=c.resolution

# Apply a "new" resolution
c.resolution=r

print("At this point, the AWB gains will have reset if using the new AWB algorithm")
time.sleep(1)

# Try to set the AWB gains back
c.awb_gains = g

# Note: it didn't work
print(c.awb_gains)
# Wait for it to work...
time.sleep(2)

# It still doesn't work...
print(c.awb_gains)
print(c.awb_mode)
c.stop_preview()

Expected behaviour

  1. Changing resolution shouldn't reset the AWB gains
  2. AWB gains should be changeable after this anyway, if AWB is off.

Actual behaviour

  1. Changing resolution resets AWB gains, seemingly to their values when AWB is set to "auto"
  2. Turning the AWB off and trying to set new AWB gains after this point silently fails. AWB gains remain fixed at their reset values.

System

  • Pi3B+
  • Firmware 38e81f2, and 1.20190718 tested

Additional context
These issues seem related:
waveform80/picamera#581
waveform80/picamera#580

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions