OV5640 Manual Setting Black Line Calibration (BLC) Error

Manually setting of gain, exposure and white balance works as expected with the OV5640 sensor. However, manual setting of black light calibration (BLC) causes a washed out and discolored of image.

The attached code reproduces the issue. Start in auto mode take some snapshots, read the blc registers, disable auto mode and set the blc registers with the values read in auto mode, take some more snapshots. The first image is in auto mode, the second is with blc disabled and maually set the blc registers with the tuple read in auto mode.



Sensor Manual Control V2.py (1.5 KB)

Hi, the BLC registers for the OV5640 are opaque to us. However, the purpose of our providing read/write access to them is that you have to read/write them along with the auto registers to restore default functionality from wakeup. You cannot change the mode and apply settings from a different mode…

It appeared from the sensor library documentation that one can apply the blc values read in auto mode to set them manually - “if disabled then you can manually set the blc register values via the values you got previously from get_blc_regs().”

Doing this works for gain, exposure and white balance, but not for BLC.

Which register values are returned in the get_blc_regs tuple?

It’s openmv/drivers/sensors/ov5640.c at master · openmv/openmv · GitHub

As for what they do… unknown. On all our new cameras from Pixart we actually have direct product level support from FAEs. But, not for this sensor.