Retinex Color Restoration
I want to restore the colour of MSR(Multi-scale Retinex) using the following equation.
MSRCR(x, y) = G [C(x,y)*MSR(x, y) - b]
I tried to implement from this paper . 1: http://www.ipol.im/pub/art/2014/107/a...
//Colour Restoration Steps
Mat msrcrB, msrcrG, msrcrR;
multiply(crb, msrb, msrcrB); // For Blue Channel // crb, crg, crr are color restoration functions
multiply(crg, msrg, msrcrG); // For Green Channel
multiply(crr, msrr, msrcrR); // For Red Channel
msrcrB = (msrcrB + b); // G/O blue channel
msrcrG = (msrcrG + b); // G/O green channel
msrcrR = (msrcrR + b); // G/O red channel
msrcrB = G * msrcrB ; // G/O blue channel
msrcrG = G * msrcrG ; // G/O green channel
msrcrR = G * msrcrR ; // G/O red channel
minMaxLoc(msrcrB, &minb, &maxb);
minMaxLoc(msrcrG, &ming, &maxg);
minMaxLoc(msrcrR, &minr, &maxr);
Mat NORMmsrcrB, NORMmsrcrG, NORMmsrcrR;
normalize(msrcrB, NORMmsrcrB, 255, 0, NORM_MINMAX);
normalize(msrcrG, NORMmsrcrG, 255, 0, NORM_MINMAX);
normalize(msrcrR, NORMmsrcrR, 255, 0, NORM_MINMAX);
Mat msrcrCh[3] = { NORMmsrcrB, NORMmsrcrG, NORMmsrcrR };
Mat MSRCR;
merge(msrcrCh, 3, MSRCR);
convertScaleAbs(MSRCR, MSRCR);
namedWindow("MSRCR", WINDOW_FREERATIO);
imshow("MSRCR", MSRCR);
waitKey(0);
I want to get the final color restoration image. But I got a nonlinear output image.
In the above image, the MSR image correct and the MSRCR image is not correct.
what is the type / range of
crb
,msrb
?Both crb, msrb are CV_64FC1, sir. Following are the output from the program, sir.