How to use `setAeRegions` correctly in libargus?

Hi,
I am using libargus c++ API. In Jetpack 4.6.2, I can set the AE region and AWB region in this way:

        /**
         * Use content region to sperate image into 5 region
         * @note the regions must be pushed in the following orders
         * ---------------------------------------
         * |           Upper region              |
         * |_____________________________________|
         * |       |                     |       |
         * | Left  |                     | Right |
         * | Region|   Content region    | Region|
         * |       |                     |       |
         * |_______|_____________________|_______|
         * |           Lower region              |
         * |_____________________________________|
         */
        vector<AcRegion> regions;
        int width = param.resolution[0];
        int height = param.resolution[1];
        // upper region
        regions.push_back(AcRegion(0, 0, width, param.contentRegion.top(), 0));
        // left region
        regions.push_back(AcRegion(
            0, param.contentRegion.top(), param.contentRegion.left(),
            param.contentRegion.bottom(), 0));
        // content region
        regions.push_back(AcRegion(
            param.contentRegion.left(), param.contentRegion.top(),
            param.contentRegion.right(), param.contentRegion.bottom(), 1));
        // right region
        regions.push_back(AcRegion(
            param.contentRegion.right(), param.contentRegion.top(), width,
            param.contentRegion.bottom(), 0));
        // lower region
        regions.push_back(AcRegion(0, param.contentRegion.bottom(), width, height, 0));
        autoControlSettings->setAeRegions(regions);
        autoControlSettings->setAwbRegions(regions);

However when I shift to Jetpack 4.6.4, I got the output from argus:

CurrentRegion 0 = {0 0 4032 279} has weight = 0.000000. Overriden to 1.
CurrentRegion 1 = {0 279 775 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 3 = {3257 279 4032 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 4 = {0 2761 4032 3040} has weight = 0.000000. Overriden to 1.
CurrentRegion 0 = {0 0 4032 279} has weight = 0.000000. Overriden to 1.
CurrentRegion 1 = {0 279 775 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 3 = {3257 279 4032 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 4 = {0 2761 4032 3040} has weight = 0.000000. Overriden to 1.
CurrentRegion 0 = {0 0 4032 279} has weight = 0.000000. Overriden to 1.
CurrentRegion 1 = {0 279 775 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 3 = {3257 279 4032 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 4 = {0 2761 4032 3040} has weight = 0.000000. Overriden to 1.
CurrentRegion 0 = {0 0 4032 279} has weight = 0.000000. Overriden to 1.
CurrentRegion 1 = {0 279 775 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 3 = {3257 279 4032 2761} has weight = 0.000000. Overriden to 1.
CurrentRegion 4 = {0 2761 4032 3040} has weight = 0.000000. Overriden to 1.

And the ae region is not work.
I hope to consider the center area of image in AE, how can I correctly set the region and the weight?
Thank you.

hello 1356046979,

it seems log has reported you’re given weight=0 for those regions,
actaully, the AE algorithm currently does not ignore completely outside setAeRegion(), instead, it gives more weights to the selected region.
and… you should calling repeat() again to apply capture settings,
for example,
iAutoSettings->setAeRegions();
iSession->repeat();

I’ve try many values for the weight. It seem that when the velue < 1, libargus always override this value to 1. And if I set the smaller weight as 1 and the larger weight as 10, it’s also not work for ae. Since I am using the fisheye lens and the black region outside the contents influenced the AE, how can I set the proper region for AE ?

In my usage case, I only set the settings once before I start capturing. I wonder why the output came out after every capture. Do you mean I should use repeat() instead of capture()?

hello 1356046979,

please try running with below gst pipeline to specify aeregion, the parameter settings are… (left, top, right, bottom, weight)
here’s an example to specify AE region on the top-left corner. please try revise the pipeline for your center region of interest.
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 aeregion="0 0 256 320 1.0" ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvoverlaysink -ev

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.