Update to remove Android error

This commit is contained in:
siddharth 2013-10-01 20:22:10 +05:30
parent 3b239561c6
commit 6c7272bde1
3 changed files with 17 additions and 5 deletions

View File

@ -55,7 +55,7 @@ double norm_m(double);
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)

View File

@ -235,7 +235,7 @@ void Decolor::colorGrad(Mat img, vector <double> &Cg)
double res =0.0;
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);
}
lab.release();

View File

@ -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);
};
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)
{
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) =
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++)
@ -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)
{
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) =
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);
}
}