[libcamera-devel] How to activate AGC control in libcamera, or set the GAIN/EXPOSURE parameter by v4l2 command.

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Sep 28 13:00:04 CEST 2020


Hello Nomura-san,

On 28/09/2020 10:50, tetsuya.nomura at soho-enterprise.com wrote:
> Dir Sirs and Madams
> 
> It might be already discussed in the other thread but It would be great
> if you help us to develop the vision processing application with
> libcamera on RaspberryPi4.
> 
> I’m evaluating libcamera and qcam by IMX219 image sensor on RaspberryPi4.

Please note that qcam is a test application and under development, and
as such does not expose all features available from libcamera.


> I can see the image of qcam and gstreamer, I can switch the image size
> from full to VGA listed in imx219.c.
> 
> I can see AGC and AWB are working correctly, however, I am guessing AGC
> does not work.


This statement is confusing,
  - You can see that AGC are working correctly
  - Yet you guess AGC does not work.

Could you expand upon your interpretations there please?


> I neither cannot set the ANALOG GAIN nor DIGITAL GAIN by v4l2 control
> commands.

When using libcamera, only libcamera controls are relevant. Setting v4l2
controls directly is not applicable. (They would be overridden by /
conflist with the libcamera pipelines)

> I’d like to know how to activate the AGC function to handle the darker
> condition.
> 
> Also it would be nice to know how to disable the AEC/AGC and set the
> desired value by v4l2 commands from the application SW.

When operating with libcamera, these would have to be set through
libcamera controls.

If you are using a gstreamer pipeline, that would probably need to be
implemented there still, as I don't think our gstreamer element lets us
set per-frame (or any?) controls yet.

You could also write your own libcamera native application and set those
controls directly,


> I am an expert to handle IMX219 image sensor, then I can provide wide
> variety of FoV, high-speed binning mode enabling x2 speed than normal
> binning mode, etc.
> 
> After knowing the information above, I can provide more versatile image
> streaming application for vision processing with wide angle camera
> modules up to 187 degree.

It sounds like you will be utilising different camera modules which may
potentially require retuning (the Raspberry Pi IPA provides the tuning
tool). This could be a reason for your perceived darker images, as the
existing tuning is based upon the Raspberry Pi v2 camera, so perhaps
your lens changes have had an effect.

Alternatively, if it's just that the images are coming through too dark,
perhaps a control is needed to allow some configuration here too. It may
require some further research, specific to your use-case.


> I really appreciate the valuable advice in advance.

Regards,

Kieran Bingham


> Best Regards,
> 
>  
> 
> NOMURA
> 
> ================================
> 
> Tetsuya NOMURA
> 
> ================================
> 
> Soho Enterprise Ltd.
> 
> 4-11-26 Gent BLDG 2F, Asahi-cho, Atsugi-shi, Kanagawa,
> 
> Japan  243-0014
> 
> URL: https://soho-enterprise.com
> 
> Mail: tetsuya.nomura at soho-enterprise.com
> <mailto:tetsuya.nomura at soho-enterprise.com>
> 
> Phone: +81-90-1839-1135
> 
> ================================
> 
>  
> 
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list