I tried controlling the gain, white balance and exposure, But I am still seeing similar results as before, the exposure always depends on the initial lighting condition. Here is the code, am I doing anything wrong here?
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to GRAYSCALE.
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240).
sensor.set_auto_gain(False, gain_db_ceiling = 5)
sensor.set_auto_whitebal(False, rgb_gain_db = (0.0, 0.0, 0.0))
sensor.set_auto_exposure(False, exposure_us = 3000)
sensor.skip_frames(time = 2000)