Temporal delay while setting/changing exposure #152
-
I have a use case where I need to switch rapidly between different exposure values (HDR capture of movie frames). Now, setting The code used is mainly (omitting a few lines)
The exposure stays at 4989 for a total of 7-8 frames until it jumps to 49989, a value close to the requested one. This behavior is mostly independent of the actually used values. Now, in an HDR context, you want to capture differently exposed images (which are combined into an HDR) in quick succession. This is especially true in the context of telecine applications where you scan tens of thousands frames - which takes anyway a long time. But even with classic HDR work, it is important that the images are taken with different exposures at close intervals, otherwise motion in the image will spoil the fun. So it would be great if that is possible. I tried renaming the AGC algorithm in the camera tuning file to Maybe there is another way to achieve a desired exposure time immediately or at least for the next picture or the one after that? Tests were done on a RP3, with HQ camera. (PS: changing instead of exposure time the gain value in the test program shows the same delay of 7,8 or 9 frames.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi, there is unfortunately no way to get gain/exposure requests to take place immediately. For a start the sensor takes a few frames anyway, and then they get backed up at the end of libcamera's request queue. One easy approach is the one taken by the Mertens merge example which simply stops and restarts the camera, setting the desired exposure/gain before restarting it. This is guaranteed to work, but it is somewhat slow. Another idea that might help, especially if you want to capture many different exposures, would be to start the camera and then keep requesting the exposures you haven't seen yet, and "ticking them off" when you do. You have to be a bit careful because you can't guarantee not to drop any images, so you do really have to keep tabs on what has or hasn't turned up. Here's an example:
This is a bit of a quick hack, but to summarise what it does:
|
Beta Was this translation helpful? Give feedback.
Hi, there is unfortunately no way to get gain/exposure requests to take place immediately. For a start the sensor takes a few frames anyway, and then they get backed up at the end of libcamera's request queue.
One easy approach is the one taken by the Mertens merge example which simply stops and restarts the camera, setting the desired exposure/gain before restarting it. This is guaranteed to work, but it is somewhat slow.
Another idea that might help, especially if you want to capture many different exposures, would be to start the camera and then keep requesting the exposures you haven't seen yet, and "ticking them off" when you do. You have to be a bit careful because you can't guarant…