nvcamerasrc aeRegion

I’m setting the aeRegion parameter of nvcamerasrc programmatically within a pipeline I’ve instantiated in c++:

void setAEROI(const cv::Rect &roi) {

  gfloat top = roi.tl().y;
  gfloat left = roi.tl().x;
  gfloat bottom = roi.br().y;
  gfloat right = roi.br().x;

  gfloat weight = 1;

  cout << "Attempting to set ROI to " << top << "," << left << "," << bottom << "," << right << "," << weight << endl;

  GArray *gROI;
  gROI = g_array_new(FALSE, FALSE, sizeof(gfloat));
  g_array_append_val(gROI, top);
  g_array_append_val(gROI, left);
  g_array_append_val(gROI, bottom);
  g_array_append_val(gROI, right);
  g_array_append_val(gROI, weight);
  g_object_set(G_OBJECT(_camsrc), "aeRegion", gROI, NULL);
  g_array_free(gROI, FALSE);

  cout << "Set AEROI, the new ROI is: " << endl;
  gROI = NULL;
  g_object_get(G_OBJECT(_camsrc), "aeRegion", &gROI, NULL);
  cout << g_array_index(gROI, gfloat, 0) << "," <<
          g_array_index(gROI, gfloat, 1) << "," <<
          g_array_index(gROI, gfloat, 2) << "," <<
          g_array_index(gROI, gfloat, 3) << "," <<
          g_array_index(gROI, gfloat, 4) << endl;
  g_array_free(gROI, FALSE);

The output of this code is:

Attempting to set ROI to   1094,1734,1257,1896,1
Set AEROI, the new ROI is: 1094,1734,1257,1896,1

As expected.

However, the exposure doesn’t seem to change with lighting within that particular area. I’ve tried playing with the weight (what is it, by the way?) to no effect, and the auto-exposure parameter is set to on.

What am I missing here?

It’s working for me while I set 0 0 200 200 2 the exposure behavior does different with default. You may need to figure out the window you set may not as the display show. You can try set it to corner and try to mask those four corner one by one to verify it.

Hi Shane- thanks for the tip. Turns out I had the wrong area due to a 180-deg rotation with nvconv.

However, I still don’t know what the weight value is (it’s scale, what it does). Could you provide some insight?

The weight is the weight of this window against full frame range.

Hi Shane- what’s the scale?

I don’t get your question.

What are the range of values for weight? 0->1? 0->100? -1000->1000?

It’s 0 - 100 it’s should be percentage.