Commit 37b1bc9d authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #8776 from sovrasov:inpaint_adv_formats

parents 27649de5 d9ffc4c8
......@@ -89,7 +89,7 @@ enum
/** @brief Restores the selected region in an image using the region neighborhood.
@param src Input 8-bit 1-channel or 3-channel image.
@param src Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image.
@param inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that
needs to be inpainted.
@param dst Output image with the same size and type as src .
......
This diff is collapsed.
......@@ -117,3 +117,26 @@ void CV_InpaintTest::run( int )
}
TEST(Photo_Inpaint, regression) { CV_InpaintTest test; test.safe_run(); }
typedef testing::TestWithParam<std::tr1::tuple<int> > formats;
TEST_P(formats, 1c)
{
const int type = std::tr1::get<0>(GetParam());
Mat src(100, 100, type);
src.setTo(Scalar::all(128));
Mat ref = src.clone();
Mat dst, mask = Mat::zeros(src.size(), CV_8U);
circle(src, Point(50, 50), 5, Scalar(200), 6);
circle(mask, Point(50, 50), 5, Scalar(200), 6);
inpaint(src, mask, dst, 10, INPAINT_NS);
Mat dst2;
inpaint(src, mask, dst2, 10, INPAINT_TELEA);
ASSERT_LE(cv::norm(dst, ref, NORM_INF), 3.);
ASSERT_LE(cv::norm(dst2, ref, NORM_INF), 3.);
}
INSTANTIATE_TEST_CASE_P(Photo_Inpaint, formats, testing::Values(CV_32F, CV_16U, CV_8U));
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