I would like to set a wbRegion of my camera to adjust global white balance focused on a sepecific area.
This area is located at the center of my picture. The picture dimensions are 3280 * 2464.
The white balance is automatic and the exposure is manual and fixed.
I took the documentation :
wbRegion : Property to set region of interest for white balance.
Use GArray, with values of ROI coordinates (top,left,bottom,right)
and weight in that order, to set the property.
flags: readable, writable
Boxed pointer of type "GArray"
I understand the documentation in 2 ways :
- I have an array of gint to provide ROI coordinates followed by a gfloat to provide weight.
GArray * array = g_array_new (FALSE, FALSE, sizeof(gint));
gint top = 1100;
gint left = 1300;
gint bottom = 1400;
gint right = 1900;
gfloat weight = 1.2;
g_array_append_val(array, top);
g_array_append_val(array, left);
g_array_append_val(array, bottom);
g_array_append_val(array, right);
g_object_set (m_source, "wbRegion", array, weight, NULL);
g_array_free (array, FALSE);
- I make a global GArray of float and put ROI coordinate and weight inside
GArray * array = g_array_new (FALSE, FALSE, sizeof(gfloat));
gfloat top = 1100;
gfloat left = 1300;
gfloat bottom = 1400;
gfloat right = 1900;
gfloat weight = 0.5;
g_array_append_val(array, top);
g_array_append_val(array, left);
g_array_append_val(array, bottom);
g_array_append_val(array, right);
g_array_append_val(array, weight);
g_object_set (m_source, "wbRegion", array, NULL);
g_array_free (array, FALSE);
I’ve try the both solution and no one give me valid results. Sometimes with a 1.5 weight the image is black and sometimes fully saturated. I’ve tried other coefficients with same results
I don’t know what is the good way and I don’t know what weight use for my region to say: “I would like this area not saturated”
Any idea ?