From 5ab3fe489f500672e12c6bc5d1d9ad57dfd41f49 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 17 Sep 2012 17:38:23 +0400 Subject: [PATCH] changed resize_area test --- modules/imgproc/test/test_imgwarp.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index 64bd7cc..c8786af 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -1494,7 +1494,7 @@ TEST(Imgproc_resize_area, regression) cv::Mat expected(5,5,CV_16UC1, expected_data); cv::Mat actual(expected.size(), expected.type()); - cv::resize(src, actual, actual.size(), 0.0, 0.0, INTER_AREA); + cv::resize(src, actual, cv::Size(), 0.3, 0.3, INTER_AREA); ASSERT_EQ(actual.type(), expected.type()); ASSERT_EQ(actual.size(), expected.size()); @@ -1504,12 +1504,13 @@ TEST(Imgproc_resize_area, regression) int elem_diff = 1.0f; Size dsize = actual.size(); - for (int dy = 0; dy < dsize.height; ++dy) + bool next = true; + for (int dy = 0; dy < dsize.height && next; ++dy) { ushort* eD = expected.ptr(dy); ushort* aD = actual.ptr(dy); - for (int dx = 0; dx < dsize.width; ++dx) + for (int dx = 0; dx < dsize.width && next; ++dx) if (fabs(static_cast(aD[dx] - eD[dx])) > elem_diff) { cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Inf norm: %f\n", static_cast(norm(actual, expected, NORM_INF))); @@ -1521,6 +1522,8 @@ TEST(Imgproc_resize_area, regression) std::cout << "actual result:\n" << actual(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; std::cout << "expected result:\n" << expected(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; + + next = false; } } -- 2.7.4