Beispiel #1
0
TEST(hole_filling_test, one_pixel_hole_on_random_image_should_produce_correct_target_rect)
{
    // Make some random image data.
    Mat img = Mat(100, 100, CV_32FC1);
    randu(img, 0.f, 1.f);

    // Put a hole in middle.
    Mat hole = Mat::zeros(100, 100, CV_8U);

    // Set one pixel as hole
    hole(Rect(50, 50, 1, 1)) = 1;
    int patch_size = 7;
    HoleFilling hf(img, hole, patch_size);

    Rect expected_target_rect(Point(50 - 6, 50 - 6), Point(50 + 7, 50 + 7));

    ASSERT_EQ(expected_target_rect, hf._target_rect_pyr[0]);
}