How to use Argus AeRegions option

Hello,

I have picture from camera where I only want to auto exposure from the bottom half of picture (I want to remove sky from auto exposure).
My picture is in resolution 3840x2160 pixels, and I want to make auto exposure in range 1080-2160 pixels vertical and 0-3840 pixels horizontal (full width).

From Argus library documentation I found this information:
AeRegions – type: vector – Description: Image regions considered by the AE algorithm. An empty list (the default) means to consider the entire image.

Can somebody help me how to do use this option in C++, I didn’t find any example how to use it.

Thank you

Share partial source code for reference.

IAutoControlSettings* ac =
          interface_cast<IAutoControlSettings>(m_iRequest->getAutoControlSettings());
      ASSERT_TRUE(ac);

     const std::vector<AcRegion>&   testAeRegion;



     ac->setAeRegions(testAeRegion));
         ASSERT_TRUE(submitCaptureRequest(m_request));

     std::vector<AcRegion> aeRegions;
     ac->getAeRegions(&aeRegions);

Thank you for answering. I have one more question. I want to auto exposure bottom half of picture, how testAeRegion vector need to look like for bottom half of picture (range 1080-2160 pixels vertical and 0-3840 pixels horizontal), what values I need to put?

Something like this?
vector& testAeRegion = [1080,2160,0,3840]; ???

Example what I want to do: [url]https://i.imgur.com/5wdqQDZ.jpg[/url]

Should be like below
[0, 1080, 3840, 2160, 1]

I got this error when I try that:

nvidia@tegra-ubuntu:~/Downloads/argus/build/samples/yuvJpeg$ make
[ 85%] Built target argussampleutils
Scanning dependencies of target argus_yuvjpeg
[ 92%] Building CXX object samples/yuvJpeg/CMakeFiles/argus_yuvjpeg.dir/main.cpp.o
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp: In function ‘bool ArgusSamples::execute()’:
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp:248:39: error: expected identifier before numeric constant
      vector<AcRegion> testAeRegion = [0, 1080, 3840, 2160, 1];
                                       ^
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp:248:40: error: expected ‘]’ before ‘,’ token
      vector<AcRegion> testAeRegion = [0, 1080, 3840, 2160, 1];
                                        ^
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp: In lambda function:
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp:248:40: error: expected ‘{’ before ‘,’ token
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp: In function ‘bool ArgusSamples::execute()’:
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp:248:40: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp:248:40: error: conversion from ‘ArgusSamples::execute()::<lambda()>’ to non-scalar type ‘std::vector<Argus::AcRegion>’ requested
/home/nvidia/Downloads/argus/samples/yuvJpeg/main.cpp:248:42: error: expected unqualified-id before numeric constant
      vector<AcRegion> testAeRegion = [0, 1080, 3840, 2160, 1];
                                          ^
samples/yuvJpeg/CMakeFiles/argus_yuvjpeg.dir/build.make:62: recipe for target 'samples/yuvJpeg/CMakeFiles/argus_yuvjpeg.dir/main.cpp.o' failed
make[2]: *** [samples/yuvJpeg/CMakeFiles/argus_yuvjpeg.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:1237: recipe for target 'samples/yuvJpeg/CMakeFiles/argus_yuvjpeg.dir/all' failed
make[1]: *** [samples/yuvJpeg/CMakeFiles/argus_yuvjpeg.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

I still didn’t find solution for this. Is there any working example with AeRegions?

Try this

std::vector<AcRegion> twoRegions;
     twoRegions.push_back(AcRegion(0, 1080, 3840, 2160, 1.0));

     const std::vector<AcRegion>&   testAeRegion             = twoRegions;

Thank you ShaneCCC, it’s working now!

This is complete working code if someone have same problem:

IAutoControlSettings* ac = interface_cast<IAutoControlSettings>(iRequest->getAutoControlSettings());
vector<AcRegion> twoRegions;
twoRegions.push_back(AcRegion(0, 1080, 3840, 2160, 1.0));
vector<AcRegion> testAeRegion = twoRegions;
ac->setAeRegions(testAeRegion);