How to: libargus, auto exposure


I am trying to sync exposure time of 2 sensors(imx274, l4t32).
I can get metadata and set ranges and all other sensor parameters.

I want to limit sensor framerate between 30-30fps(33ms-33ms) and exposure time between 1ms-33ms. And use auto exposure time of sensor0, for setting up exposure time of sensor1.

But the logic of auto exposure is not clear.
Playing with argus_camera application also does not give understanding.

First i am setting up:

setFrameDurationRange( 33E6, 33E6 ) // ns
setFrameExposureTimeRange( 44000, 33E6 ) // ns
setGainRange( 1, 44.4 ) // Units? ISO?
setIspDigitalGainRange( 1, 1 ); // don’t want digital gain

setAeAntibandingMode( AUTO ) // what for?
setAeLock( false ) // AE ON
setAwbLock( false ) // AWB ON
setAwbMode( AUTO ) // Color temp auto

But when i am running program, frames are blinking and the metadata shows:
Lux: 0.76, 13.05, 0.87, 0.66 …
Expo, ms: 51, 33, 44, 58 …
Gain: 8, 8.08, 8, 8 …

If i am trying to light a bright lamp, same blinking state:
Lux: 85, 0.62 …
Expo, ms: 32, 55 …
Gain: 6.3 8 …

Sometimes, if i am closing sensor by hand, after few seconds frames stop blinking and become overexposured(max exposure time 33ms).

Awb looks like good.
Please explain me how i can control exposure.

Best regards, Viktor.

Did you buy the sensor from Leopard?
Switch the AeAntibandingMode help?

Yes, it is Leopard Imaging modules.

What’s the 33E6? Hex value?
setFrameDurationRange( 33E6, 33E6 ) // ns
setFrameExposureTimeRange( 44000, 33E6 ) // ns

Check below document for the detail of the argus API.

  1. 33E6 //ns it is engineering format = 33000000 nanoseconds. Also g++ knows that 1e3 = 1000 ;)
  2. Anti banding used for removing lines from tv or lamps, but how it depends with AE in libargus?
  3. Mmapi ref don’t have answers on my questions.

The Anti banding is AE alg to detect the lamps is 50hz/60hz to adjust AE to avoid the blink.
The gain range is the sensor gain report by the sensor the unit should be db.

Also in metadata gain * 100 calling as ISO, yes?

No, it should depend on sensor like below.

In the API it calls sensitivity, where is stored this multiplier? May be in driver or dtb?

Here is example of blinking:

In this case it happens when i decrease fps from 60 to 27. Other setting have default values.
It is the same thing that you mean saying about anti banding?

Have a try to change the AE antibanding mode to 50hz or 60 hz instead of auto to confirm if the antibanding cause the problem.

Yes, 60hz or 50hz makes stable image, sometimes Auto do it.

But the main question of this post was that i want to set up master sensor expo to slave sensor.

When the picture from sensor is stable there are always over exposured(lux=17,gain=24).

When i close by hand the sensor, then gain grows to max value(lux=0.9, gain=44). It is ok.

If i light to sensor from smartphone, then lux=143 and gain=5. It is ok.

But in all these cases exposure time is the same - 33ms in metdada.
How does isp control picture?
Only with gain or with gain and exposure?

PS: When i remove frame range and exposure range, then metadata exposure time is always 99ms.
PS2: setExposureTimeRange and setGainRange does not work while frame capturing.

How to set gain and exposure?
Updated: To set any ranges i should:

Now i made gain computation myself:

auto gain1{ float( 0.01 * 50 * lensAperture * lensAperture / ( exposureTime * 1e-9 * iMetadata1->getSceneLux() ) ) };

But as i already said, isp makes pictures over exposured. Why?

ISP can’t have picture over exposure. That means the gain/exposure can’t adjust cover the brightness of environment. If you want to set the gain/exposure manually you can set the lock the AE and adjust the gain/exposure manually but it’s could be over/under exposure if the configure wrong to the environment light.

Here is image with default parameters from argus_camera and with digital isp=1.

Tell me please, is it over exposured?

I thing that too much gain.

If you are telling the light area I don’t think that could be a issue. Did you check it with WDR sensor mode?

Here is wdr mode. It works as hdr, but very bad colors. So, it is unuseful.

Also here i posted wdr dol issue:

Other 2 questions about expo:

1. Argus_camera as default has AE and WB Regions? Or i should set up them?

2. What is the difference between captureRequest arguments(manual, preview, still, video_record, video_snap)?

Please help.

  1. You can check the API to set the AE/AWB regions. But current this regions just take this regions as weight not just replace by this regions.
  2. Current argus implement there’s no much different for them.