mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 19:20:28 +08:00
Update to remove Android error
This commit is contained in:
parent
3b239561c6
commit
6c7272bde1
@ -55,7 +55,7 @@ double norm_m(double);
|
|||||||
|
|
||||||
double norm_m(double E)
|
double norm_m(double E)
|
||||||
{
|
{
|
||||||
return sqroot(power(E,2));
|
return sqrt(power(E,2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cv::decolor(InputArray _src, OutputArray _dst, OutputArray _color_boost)
|
void cv::decolor(InputArray _src, OutputArray _dst, OutputArray _color_boost)
|
||||||
|
@ -235,7 +235,7 @@ void Decolor::colorGrad(Mat img, vector <double> &Cg)
|
|||||||
double res =0.0;
|
double res =0.0;
|
||||||
for(unsigned int i=0;i<ImL.size();i++)
|
for(unsigned int i=0;i<ImL.size();i++)
|
||||||
{
|
{
|
||||||
res=sqroot(power(ImL[i],2) + power(Ima[i],2) + power(Imb[i],2))/100;
|
res=sqrt(power(ImL[i],2) + power(Ima[i],2) + power(Imb[i],2))/100;
|
||||||
Cg.push_back(res);
|
Cg.push_back(res);
|
||||||
}
|
}
|
||||||
lab.release();
|
lab.release();
|
||||||
|
@ -75,6 +75,18 @@ class Cloning
|
|||||||
void texture_flatten(Mat &I, Mat &mask, Mat &wmask, double low_threshold, double high_threhold, int kernel_size, Mat &final);
|
void texture_flatten(Mat &I, Mat &mask, Mat &wmask, double low_threshold, double high_threhold, int kernel_size, Mat &final);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
double power(double term, int p);
|
||||||
|
|
||||||
|
double power(double term, int p)
|
||||||
|
{
|
||||||
|
double res = 1.0;
|
||||||
|
for(int i=0;i<p;i++)
|
||||||
|
{
|
||||||
|
res *= term;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void Cloning::getGradientx( const Mat &img, Mat &gx)
|
void Cloning::getGradientx( const Mat &img, Mat &gx)
|
||||||
{
|
{
|
||||||
int w = img.size().width;
|
int w = img.size().width;
|
||||||
@ -728,7 +740,7 @@ void Cloning::illum_change(Mat &I, Mat &mask, Mat &wmask, Mat &final, float alph
|
|||||||
{
|
{
|
||||||
|
|
||||||
mag.at<float>(i,j*channel+c) =
|
mag.at<float>(i,j*channel+c) =
|
||||||
sqrt(pow(srx32.at<float>(i,j*channel+c),2) + pow(sry32.at<float>(i,j*channel+c),2));
|
sqrt(power(srx32.at<float>(i,j*channel+c),2) + power(sry32.at<float>(i,j*channel+c),2));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0;i < h; i++)
|
for(int i=0;i < h; i++)
|
||||||
@ -738,9 +750,9 @@ void Cloning::illum_change(Mat &I, Mat &mask, Mat &wmask, Mat &final, float alph
|
|||||||
if(srx32.at<float>(i,j*channel+c) != 0)
|
if(srx32.at<float>(i,j*channel+c) != 0)
|
||||||
{
|
{
|
||||||
srx32.at<float>(i,j*channel+c) =
|
srx32.at<float>(i,j*channel+c) =
|
||||||
pow(alpha,beta)*srx32.at<float>(i,j*channel+c)*pow(mag.at<float>(i,j*channel+c),-1*beta);
|
power(alpha,beta)*srx32.at<float>(i,j*channel+c)*power(mag.at<float>(i,j*channel+c),-1*beta);
|
||||||
sry32.at<float>(i,j*channel+c) =
|
sry32.at<float>(i,j*channel+c) =
|
||||||
pow(alpha,beta)*sry32.at<float>(i,j*channel+c)*pow(mag.at<float>(i,j*channel+c),-1*beta);
|
power(alpha,beta)*sry32.at<float>(i,j*channel+c)*power(mag.at<float>(i,j*channel+c),-1*beta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user