v4l-ctl settings for low light IMX291

Evening,

I’ve been working with the 1080p UVC Arducam USB module that uses the IMX291 sensor (UB020201)

I’m trying to optimise its use at night, and have been trying various different v4l settings when connected to a pi running raspbian. The defaults are:

brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=64 step=1 default=32 value=32
saturation 0x00980902 (int) : min=0 max=128 step=1 default=64 value=64
hue 0x00980903 (int) : min=-40 max=40 step=1 default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=72 max=500 step=1 default=100 value=100
gain 0x00980913 (int) : min=0 max=100 step=1 default=0 value=0
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
sharpness 0x0098091b (int) : min=0 max=6 step=1 default=3 value=3
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=1 value=1
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
exposure_absolute 0x009a0902 (int) : min=1 max=5000 step=1 default=156 value=4154 flags=inactive
exposure_auto_priority 0x009a0903 (bool) : default=0 value=0
I recognise that low light performance is likely to be a trade-off of features - I was wondering if anyone here had experience of these trades and could suggest some starting points above.

 

I was looking at enabling exposure_auto_priority:

v4l2-ctl --set-ctrl=exposure_auto_priority=1

which as I understood it should drop frame rate to increase sensitivity - but I wasn’t able to see if it made a difference!
7.What attempts at troubleshooting have you already made?

8.How would you like us to help you?

Hi,

The exposure_auto_priority control seems to control auto and mannual exposure mode.

If you want to change the framerate, you can try to reduce the exposure time. (exposure_absolute )

 

Hi,

Please ignore the previous reply.

The exposure_auto_priority is useless.

If you want to manually control the exposure time, you can turn off the auto exposure mode first by set exposure_auto=1, and then adjust the exposure time by adjusting the value of exposure_absolute.

Ah - that’s a pity - my understanding (hope) had been that exposure_auto_priority would allow the camera firmware to drop frame rate / increase exposure as light level dropped.

However, as it stands the camera does not have particularly good low light performance…I can improve it by manually changing the frame rate and exposure, but then have to manually change it back again when it gets brighter!

Are there any solutions to this, or alternative similar units in the range that might have better success?

Hi,

At present, our UVC cameras have a fixed frame rate, which means that the exposure will not be increased by dropping frames in the dark.

Your suggestion is good, but most people’s needs are fixed frame rates, so we can only follow the needs of most people.
In the future, we may explore the possibility of adding an optional switch between dropped frames and non-dropped frames. But for now, the camera you buy can only fix the frame rate or manual exposure to drop frames.

 

Thanks!

By default there is some auto-exposure control, as can be seen when there is a rapid change in scene brifghtness. If the frame rate stays constant is this acheived by automatically varying the gain?

Under manual control, altering the exposure will have the side effect of dropping the frame rate?

I could I suppose script this to change at certain times of day (daytime / nighttime)

Doing this automatically for a low-light camera would be really helpful, though I understand you have to be led by what customers want.

 

 

Hi,

When the frame rate is fixed, the exposure and gain will be adjusted automatically, but the upper limit of the exposure is fixed.
When manually controlling the exposure, the frame rate will be reduced when the exposure is longer. If the exposure is set to a lower level, it will not affect the frame rate.
We will take into account the needs you mentioned in the later research and development, but for now, it can only be in your hands. Sorry for affecting your use.

How are you changing the framerate? I can only get 30FPS with gstreamer, nothing lower.

Hi,

The camera in your hand can only reduce the frame rate by manually adjusting the exposure time.

It the upper limit of gain set as well? I find that with exposure set to auto, in very low light scenarios I can get a much better image, without too much noise, by manually increasing the gain using v4l commands - but then when light levels increase, the gain remains too high - and so the image becomes saturated

Hi,

The gain you use v4l to control is actually digital gain, and what we control in exposure is analog gain. Therefore, although the analog gain has reached the upper limit, the digital gain is still adjustable. The disadvantage is that digital gain is more likely to cause noise.

I know this topic is old but I have a very similar issue, or maybe the same one. My B020201 camera does a very strange thing when adjusting exposure, like it’s looping over and settles at a lower internal gain than what was optimal for the situation. For example if at one point the camera is pointed at the screen and it shows a perfectly fine picture for the lighting conditions and then I turn the camera away from the bright screen to the other side of the room which is only lit by the screen, first the camera goes into a relatively bright picture which is enough to make things out in the dark and then it suddenly goes dark and stays that way. The picture would be totally okay in the bright mode, but I just can’t adjust anything so the camera can handle this properly. And I seem to remember that it worked okay when I bought the camera and it started doing this later. Doesn’t matter if I connect the camera to a Windows PC, a Raspberry Pi 3, 4 or multiple Android phones, it seems to be a totally internally controlled issue and it makes it unusable for low light conditions, which is sad for a camera that was advertised as something that can handle that well.

Sorry to hear that.
Please contact our [email protected] for your detail requirement.