Commit f4daf14b authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #16199 from sajarindider:computeGradientX

parents abe2ca88 4b938208
...@@ -57,12 +57,8 @@ void Cloning::computeGradientX( const Mat &img, Mat &gx) ...@@ -57,12 +57,8 @@ void Cloning::computeGradientX( const Mat &img, Mat &gx)
} }
else if (img.channels() == 1) else if (img.channels() == 1)
{ {
Mat tmp[3]; filter2D(img, gx, CV_32F, kernel);
for(int chan = 0 ; chan < 3 ; ++chan) cvtColor(gx, gx, COLOR_GRAY2BGR);
{
filter2D(img, tmp[chan], CV_32F, kernel);
}
merge(tmp, 3, gx);
} }
} }
...@@ -78,12 +74,8 @@ void Cloning::computeGradientY( const Mat &img, Mat &gy) ...@@ -78,12 +74,8 @@ void Cloning::computeGradientY( const Mat &img, Mat &gy)
} }
else if (img.channels() == 1) else if (img.channels() == 1)
{ {
Mat tmp[3]; filter2D(img, gy, CV_32F, kernel);
for(int chan = 0 ; chan < 3 ; ++chan) cvtColor(gy, gy, COLOR_GRAY2BGR);
{
filter2D(img, tmp[chan], CV_32F, kernel);
}
merge(tmp, 3, gy);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment