Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jumping exposure time on Raspberry Pi HQ camera #712

Open
M-Enderle opened this issue Dec 12, 2021 · 1 comment
Open

Jumping exposure time on Raspberry Pi HQ camera #712

M-Enderle opened this issue Dec 12, 2021 · 1 comment

Comments

@M-Enderle
Copy link

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

x = shutterspeed , y = brightness measured using the PIL histogram

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.

@Bra1nsen
Copy link

hey nice project, did you solve it?

moreover do you pherahbs know how to set the exposure time below 1ms ( for example 0.1ms)

Traceback (most recent call last): File "/home/pi/kotzmichan.py", line 39, in <module> camera.shutter_speed = 0.5 File "/usr/lib/python3/dist-packages/picamera/camera.py", line 2594, in _set_shutter_speed self._camera.control.params[mmal.MMAL_PARAMETER_SHUTTER_SPEED] = value File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 1493, in __setitem__ func(self._port, key, conv(value)), ctypes.ArgumentError: argument 3: <class 'TypeError'>: wrong type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants