My application involves inspecting a mostly white object that is placed in a black jig for inspection.
There may or may not be an object in the jig at power up.
I am currently setting the exposure, gain, and white balance but I still see variance.
My test is to check the average brightness of a small white patch that is always in the field of view.
If the object is not present at power up the field is very dark and the patch ends up at about 150.
When the object is present at power up the patch end up at about 120.
What am I missing?
sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.skip_frames(20) # Wait for settings take effect. sensor.set_auto_exposure(False,value=250) sensor.set_auto_gain(False,value=50) sensor.set_auto_whitebal(False, value =(50,50,50)) sensor.set_windowing((0, 250, 640, 50))