Replies: 6 comments 7 replies
-
Hi, thanks for the questions. There was a bit too much code there for me to understand exactly what you're trying to calibrate and how you're doing it. Is there any way you could provide a short example that shows the camera system doing something that you don't expect or don't understand? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi david! No problem! So on my DSLR camera, under a fixed lighting situation, if i want to try to have a faster image with a shorter shutter speed, i could do something like increase the gain, and then when i run an autoexposure, it will use the increased gain to brighten my photo and automatically decrease the shutter speed. I wanted to try to do something like that with the picamera2, but after i set the gain, and then run the autoexposure algo, it looks like it always just reverts back to gain of 0 and gives the same values as if i did not set the gain before the autoexposure. Chances are I am doing something wrong! Here's what I do: (earlier in the code i set the gain to something like 2.0 in a dict called camera_settings)
my expectation would be that if I set the gain to like 4.0 or something vs the default 0.0 i would get an image of similar brightness but shorter exposure time. but it seems like during the calibration it doesn't let me calibrate with a different gain because i always just get the same exposure time? |
Beta Was this translation helpful? Give feedback.
-
Thanks for sending the code. It looks to me like it really should work. Once thing to bear in mind is that there are several frames of delay for the analogue gain to update (if you change it after the camera has started). Can you maybe try running something like this and post the output?
Note that if you set the analogue gain that you want before calling |
Beta Was this translation helpful? Give feedback.
-
Ok, with David's help, i think i fixed it up. I think I had two problems: 1st: i think when it was running the autofocuscycle it was blocking the exposure values from changing, and i think that prevented me from being able to set a gain and have it expose based on that. To fix that, I did what @davidplowman suggested which is start the camera, let it figure out its exposure values, record those values, THEN run a cycle to get the focus! so that let my exposure values start functioning and responding to the changes in gain i made! 2nd: the camera seems to have a minimum exposure of 469 (microseconds?), and so after i fixed the above problem, i started losing my mind because it seemed like it stopped responding past certain gain values, but i think it just can't adjust the exposure below that. Can you confirm that @davidplowman ? if so i think we found all the bugs i needed to work around and this question should be all set! |
Beta Was this translation helpful? Give feedback.
-
I'm afraid I don't know the minimum exposure time for non-Raspberry Pi supplied cameras. You'd have to refer to the module vendor (Arducam). Having said that, it you try to set the exposure time lower, but it won't go lower, then that's what's meant to happen once you get to the minimum value... |
Beta Was this translation helpful? Give feedback.
-
Awesome! thanks again for all your amazing help @davidplowman ! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone thanks to all your work our cool open source scientific tool for studying insect biodiversity has been working really great in the field!
There's one challenge I'm working on right now which is that I want to try to shorten my exposure times because sometimes our insects fly across the screen quite quickly and we get a big rolling shutter smear.
Currently, as you can see in our code:
https://github.com/Digital-Naturalism-Laboratories/Mothbox/blob/4957273d84673e9d69ca90a163188950dddd453f/Software/TakePhoto.py
We run an auto calibration every 6 minutes that sets the exposure time and the focus. This has been working well (with one caveat I'll explain below)***
But I wanted to boost the gain before I run the auto calibration in order to try to calibrate it for a shorter exposure time.
However when I try to do this, It doesn't seem to have any effect on the auto calibration. And so it just calibrates it with a normal type of exposure, And then when I apply that exposure to a photo with the analog gain, I just get a blown out overexposed photo.
*** Side question I had a strange problem where when I run the calibration. For some reason if If I run an auto calibration and then I take a photo using the settings that were collected on that auto calibration this photo comes out slightly brighter then if I use those exact same settings but do not perform an auto calibration before that. Anyone have any ideas about that? It's not really that significantly brighter so it's not that big of a deal, But it's irking me! :)
Beta Was this translation helpful? Give feedback.
All reactions