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

tetsuya.nomura at soho-enterprise.com tetsuya.nomura at soho-enterprise.com
Mon Sep 28 13:55:15 CEST 2020


Dear Kieran-san

Thank you very much for your prompt reply.

I'm sorry I wrote wrong, though this is the most important point. 
I can see "Auto Exposure Control" is working, and I can see the exposure
parameter is reaching to the maximum value.
But after that, I don't see the noise level never increase, this means the
"Auto Gain Control" does not work in qcam.
I understand the qcam at this moment does not support AGC.

I write the comment below.

Best Regards,

NOMURA
-----Original Message-----
From: Kieran Bingham <kieran.bingham at ideasonboard.com> 
Sent: Monday, September 28, 2020 8:00 PM
To: tetsuya.nomura at soho-enterprise.com; libcamera-devel at lists.libcamera.org
Subject: Re: [libcamera-devel] How to activate AGC control in libcamera, or
set the GAIN/EXPOSURE parameter by v4l2 command.

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.
-> (nomura)I understood.

> 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?

-> (nomura)AEC is working, AGC seems not working.

> 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)
-> (nomura) I understood.

> 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,

-> (nomura) Do you mean to write the native application code like qcam? I
feel it will be easier to do so.
It would be great if you could tell me where I can find the reference code?

> 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.

-> (nomura) Actually I am using the fish-eye lens but even with Raspi
camera, FoV=76degree, the AGC will not work.
I understand I need re-tuning for the other lens, but basically LSC tuning
will be necessary.


> 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