From 6377f5a45803275f0782d2f49cdb8148b6e52bdc Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 26 Sep 2014 08:59:32 +0000 Subject: [PATCH] fixed warps accuracy tests --- modules/imgproc/test/test_imgwarp_strict.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/imgproc/test/test_imgwarp_strict.cpp b/modules/imgproc/test/test_imgwarp_strict.cpp index 669c601860..4ec4b8683d 100644 --- a/modules/imgproc/test/test_imgwarp_strict.cpp +++ b/modules/imgproc/test/test_imgwarp_strict.cpp @@ -725,19 +725,25 @@ void CV_Remap_Test::generate_test_data() case CV_32FC2: { - MatIterator_ begin_x = mapx.begin(), end_x = mapx.end(); float fscols = static_cast(std::max(src.cols - 1 + n, 0)), fsrows = static_cast(std::max(src.rows - 1 + n, 0)); - for ( ; begin_x != end_x; ++begin_x) + int width = mapx.cols << 1; + + for (int y = 0; y < mapx.rows; ++y) { - begin_x[0] = rng.uniform(_n, fscols); - begin_x[1] = rng.uniform(_n, fsrows); + float * ptr = mapx.ptr(y); + + for (int x = 0; x < width; x += 2) + { + ptr[x] = rng.uniform(_n, fscols); + ptr[x + 1] = rng.uniform(_n, fsrows); + } } } break; default: - assert(0); + CV_Assert(0); break; } }