I’m trying to write a basic function to adjust the gain of the OV7725 sensor based on the l_mean seen in an image. To do some testing, I set up a loop which uses the sensor.set_auto_gain(False, gain_db = ) to write gain values from 128 through 0 (somewhat arbitrary limits used for testing). During this loop, I see the l_mean spike a few times even though the gain value is being decremented by 1. I see this same luminosity spike when I directly write register 0x00 and increment the value by 1 in a loop. The OV7725 data sheet doesn’t really provide much help in terms of what gain (in db) each register step corresponds to and I also can’t seem to find the sensor.set_auto_gain function in the omv source…
For ease of understanding the issue, attached is a photo of the data I’ve collected. You can see in the bottom plot the luminosity spikes that we’re seeing.
For the record, we have auto gain, auto wb, and auto exposure all disabled and have verified this by rgb gain and exposure registers to show that they are constant.
Any thoughts on this behavior? Let me know if any of what I mentioned doesn’t make sense or was worded confusingly.