change masking to patchNaNs

This commit is contained in:
Adrien BAK 2014-09-30 14:58:40 +09:00
parent 2411556242
commit 037f27c882

View File

@ -543,19 +543,17 @@ void Cloning::illum_change(Mat &I, Mat &mask, Mat &wmask, Mat &cloned, float alp
Mat mag = Mat(I.size(),CV_32FC3); Mat mag = Mat(I.size(),CV_32FC3);
magnitude(srx32,sry32,mag); magnitude(srx32,sry32,mag);
Mat magnitude_mask = mag != 0;
Mat multX, multY, multx_temp, multy_temp; Mat multX, multY, multx_temp, multy_temp;
multiply(srx32,pow(alpha,beta),multX); multiply(srx32,pow(alpha,beta),multX);
pow(mag,-1*beta, multx_temp); pow(mag,-1*beta, multx_temp);
multiply(multX,multx_temp,multX); multiply(multX,multx_temp,srx32);
multX.copyTo(srx32, magnitude_mask); patchNaNs(srx32);
multiply(sry32,pow(alpha,beta),multY); multiply(sry32,pow(alpha,beta),multY);
pow(mag,-1*beta, multy_temp); pow(mag,-1*beta, multy_temp);
multiply(multY,multy_temp,multY); multiply(multY,multy_temp,sry32);
multY.copyTo(sry32, magnitude_mask); patchNaNs(sry32);
Mat zeroMask = (srx32 != 0); Mat zeroMask = (srx32 != 0);