提交 4b938208 编写于 作者: S sajarindider 提交者: Alexander Smorkalov

Fixed small inefficiency in seamless clone init

上级 a8345133
......@@ -57,12 +57,8 @@ void Cloning::computeGradientX( const Mat &img, Mat &gx)
}
else if (img.channels() == 1)
{
Mat tmp[3];
for(int chan = 0 ; chan < 3 ; ++chan)
{
filter2D(img, tmp[chan], CV_32F, kernel);
}
merge(tmp, 3, gx);
filter2D(img, gx, CV_32F, kernel);
cvtColor(gx, gx, COLOR_GRAY2BGR);
}
}
......@@ -78,12 +74,8 @@ void Cloning::computeGradientY( const Mat &img, Mat &gy)
}
else if (img.channels() == 1)
{
Mat tmp[3];
for(int chan = 0 ; chan < 3 ; ++chan)
{
filter2D(img, tmp[chan], CV_32F, kernel);
}
merge(tmp, 3, gy);
filter2D(img, gy, CV_32F, kernel);
cvtColor(gy, gy, COLOR_GRAY2BGR);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册