提交 573e8184 编写于 作者: S siddharth

New changes done and removed opencv_extra folder

Removed opencv_extra folder inside opencv folder

New changes done

Removed test images
上级 33e6c074
......@@ -427,7 +427,6 @@ void Decolor::grayImContruct(vector <double> &wei, Mat img, Mat &Gray)
maxval = Gray.at<float>(i,j);
}
for(int i=0;i<h;i++)
for(int j=0;j<w;j++)
Gray.at<float>(i,j) = (Gray.at<float>(i,j) - minval)/(maxval - minval);
Gray -= minval;
Gray /= maxval - minval;
}
......@@ -173,7 +173,6 @@ void Domain_Filter::compute_Rfilter(Mat &output, Mat &hz, float sigma_h)
{
int h = output.rows;
int w = output.cols;
int channel = output.channels();
float a = (float) exp((-1.0 * sqrt(2.0)) / sigma_h);
......@@ -190,11 +189,7 @@ void Domain_Filter::compute_Rfilter(Mat &output, Mat &hz, float sigma_h)
{
for(int j =1; j < w; j++)
{
for(int c = 0; c<channel; c++)
{
temp.at<float>(i,j*channel+c) = temp.at<float>(i,j*channel+c) +
(temp.at<float>(i,(j-1)*channel+c) - temp.at<float>(i,j*channel+c)) * V.at<float>(i,j);
}
temp.at<float>(i,j) = temp.at<float>(i,j) + (temp.at<float>(i,j-1) - temp.at<float>(i,j)) * V.at<float>(i,j);
}
}
......@@ -202,11 +197,7 @@ void Domain_Filter::compute_Rfilter(Mat &output, Mat &hz, float sigma_h)
{
for(int j =w-2; j >= 0; j--)
{
for(int c = 0; c<channel; c++)
{
temp.at<float>(i,j*channel+c) = temp.at<float>(i,j*channel+c) +
(temp.at<float>(i,(j+1)*channel+c) - temp.at<float>(i,j*channel+c))*V.at<float>(i,j+1);
}
temp.at<float>(i,j) = temp.at<float>(i,j) + (temp.at<float>(i,j+1) - temp.at<float>(i,j)) * V.at<float>(i,j+1);
}
}
......
......@@ -482,7 +482,6 @@ void Cloning::normal_clone(Mat &I, Mat &mask, Mat &wmask, Mat &cloned, int num)
{
int w = I.size().width;
int h = I.size().height;
int channel = I.channels();
initialization(I,mask,wmask);
......@@ -496,25 +495,18 @@ void Cloning::normal_clone(Mat &I, Mat &mask, Mat &wmask, Mat &cloned, int num)
{
for(int i=0;i < h; i++)
for(int j=0; j < w; j++)
for(int c=0;c<channel;++c)
{
if(abs(sgx.at<float>(i,j) - sgy.at<float>(i,j)) > abs(grx.at<float>(i,j) - gry.at<float>(i,j)))
{
srx32.at<float>(i,j) = sgx.at<float>(i,j) * smask.at<float>(i,j);
sry32.at<float>(i,j) = sgy.at<float>(i,j) * smask.at<float>(i,j);
}
else
{
if(abs(sgx.at<float>(i,j*channel+c) - sgy.at<float>(i,j*channel+c)) >
abs(grx.at<float>(i,j*channel+c) - gry.at<float>(i,j*channel+c)))
{
srx32.at<float>(i,j*channel+c) = sgx.at<float>(i,j*channel+c)
* smask.at<float>(i,j);
sry32.at<float>(i,j*channel+c) = sgy.at<float>(i,j*channel+c)
* smask.at<float>(i,j);
}
else
{
srx32.at<float>(i,j*channel+c) = grx.at<float>(i,j*channel+c)
* smask.at<float>(i,j);
sry32.at<float>(i,j*channel+c) = gry.at<float>(i,j*channel+c)
* smask.at<float>(i,j);
}
srx32.at<float>(i,j) = grx.at<float>(i,j) * smask.at<float>(i,j);
sry32.at<float>(i,j) = gry.at<float>(i,j) * smask.at<float>(i,j);
}
}
}
else if(num == 3)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册