From 03daf44848c7672e8798f392b9710361710ae5b1 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 17 Sep 2012 16:31:30 +0400 Subject: [PATCH] added recalculating scale coefficients --- modules/imgproc/test/test_imgwarp_strict.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/imgproc/test/test_imgwarp_strict.cpp b/modules/imgproc/test/test_imgwarp_strict.cpp index 6a110fe1f8..473031422b 100644 --- a/modules/imgproc/test/test_imgwarp_strict.cpp +++ b/modules/imgproc/test/test_imgwarp_strict.cpp @@ -175,7 +175,7 @@ void CV_ImageWarpBaseTest::generate_test_data() interpolation = rng.uniform(0, CV_INTER_LANCZOS4 + 1); // generating the dst matrix structure - double scale_x = 2, scale_y = 2; + double scale_x, scale_y; if (interpolation == INTER_AREA) { bool area_fast = rng.uniform(0., 1.) > 0.5; @@ -203,6 +203,9 @@ void CV_ImageWarpBaseTest::generate_test_data() dst = Mat::zeros(dsize, src.type()); reference_dst = Mat::zeros(dst.size(), CV_MAKE_TYPE(CV_32F, dst.channels())); + scale_x = src.cols / static_cast(dst.cols); + scale_y = src.rows / static_cast(dst.rows); + if (interpolation == INTER_AREA && (scale_x < 1.0 || scale_y < 1.0)) interpolation = INTER_LINEAR; }