opencv - Brightness/contrast changing in RGB space -


if have 2 rgb-images (from digital camera) same object in diffrents lighting conditions (with/without flash light, high/low light source...). if approximate change between these images brightness , contrast this:

image_1 = a*images_2 + b 

in order find a,b, algorithm applied.

the question:

should algorithm applied on each channel separately leads obtain 3 different pairs of (a,b) this:

find (a_r,b_r) minimize [r(image_1)  -  a_r*r(image_2)  + b_r] find (a_g,b_g) minimize [g(image_1)  -  a_g*g(image_2)  + b_g] find (a_b,b_b) minimize [b(image_1)  -  a_b*b(image_2)  + b_b] 

or should applied on 3 channels in same time , find 1 pair of (a,b) gives best solution this:

find (a,b) minimize:             [r(image_1)  -  a* r(image_2)  + b]             [g(image_1)  -  a* g(image_2)  + b]             [b(image_1)  -  a* b(image_2)  + b] 


Comments