mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
Merge pull request #15316 from sturkmen72:update_seamless_cloning_cpp
This commit is contained in:
commit
7243eda2ff
@ -78,6 +78,7 @@ void cv::seamlessClone(InputArray _src, InputArray _dst, InputArray _mask, Point
|
||||
copyMakeBorder(mask_inner, mask, 1, 1, 1, 1, BORDER_ISOLATED | BORDER_CONSTANT, Scalar(0));
|
||||
|
||||
Rect roi_s = boundingRect(mask);
|
||||
if (roi_s.empty()) return;
|
||||
Rect roi_d(p.x - roi_s.width / 2, p.y - roi_s.height / 2, roi_s.width, roi_s.height);
|
||||
|
||||
Mat destinationROI = dest(roi_d).clone();
|
||||
|
@ -86,6 +86,15 @@ TEST(Photo_SeamlessClone_normal, regression)
|
||||
EXPECT_LE(errorINF, 1);
|
||||
double errorL1 = cvtest::norm(reference, result, NORM_L1);
|
||||
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size();
|
||||
|
||||
mask = Scalar(0, 0, 0);
|
||||
seamlessClone(source, destination, mask, p, result, 1);
|
||||
|
||||
reference = destination;
|
||||
errorINF = cvtest::norm(reference, result, NORM_INF);
|
||||
EXPECT_LE(errorINF, 1);
|
||||
errorL1 = cvtest::norm(reference, result, NORM_L1);
|
||||
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size();
|
||||
}
|
||||
|
||||
TEST(Photo_SeamlessClone_mixed, regression)
|
||||
|
Loading…
Reference in New Issue
Block a user