I am trying to build a timelapsing program in python, which analyzes the picture and determins the exposure, based on which it corrects it's shutter speed using a polynomial regression.
But I got stuck when the exposure is somewhere around 1 second, where you can see in the graph below, the brightness jumps
The orange line is the expected curve, the blue dots are actual measurements.
Digging deeper, I found out, that the actual exposure times differs from the shutter speed I set.
With cam.exposure_speed
I found out, that at cam.shutter_speed = 1000000
(-> 1s) the actual exposure time was 7997813
(-> 8s) where as at cam.shutter_speed = 990000
(->0.99s) the exposure time was 989976
(-> 0.989s).
Here is an example code to recreate the effect:
from picamera import PiCamera
import time
cam = PiCamera(sensor_mode=2)
cam.framerate = 1/8
cam.iso = 100
cam.shutter_speed = 1000000
cam.resolution = (1600, 900)
time.sleep(5)
cam.capture("test.jpg")
print(cam.exposure_speed)
cam.close()
So far I tested:
- Diffrent ISO values (needs to fixed ISO)
- diffrent resolutions
- removing the sensor_mode argument
- diffrent framerates
I am running
- Python 3.7.3
- Raspberry Pi 4 with 4GB RAM
- picamera 1.13
Any help on this will be helpful, I will try to edit missing information asap.