From be17f532e1e81e5dec74392b1709b1ea9af37f3c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 29 Mar 2020 02:08:27 +0000 Subject: [PATCH] imgproc(resize): fix resizeNNInvoker handling of generic pixel size --- modules/imgproc/src/resize.cpp | 7 +++---- modules/imgproc/test/test_imgwarp.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/imgproc/src/resize.cpp b/modules/imgproc/src/resize.cpp index 43458cc153..cd039fe896 100644 --- a/modules/imgproc/src/resize.cpp +++ b/modules/imgproc/src/resize.cpp @@ -1043,10 +1043,9 @@ public: default: for( x = 0; x < dsize.width; x++, D += pix_size ) { - const int* _tS = (const int*)(S + x_ofs[x]); - int* _tD = (int*)D; - for( int k = 0; k < pix_size4; k++ ) - _tD[k] = _tS[k]; + const uchar* _tS = S + x_ofs[x]; + for (int k = 0; k < pix_size; k++) + D[k] = _tS[k]; } } } diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index b100442127..ffd5ecca95 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -1721,7 +1721,7 @@ TEST(Resize, lanczos4_regression_16192) EXPECT_EQ(cvtest::norm(dst, expected, NORM_INF), 0) << dst(Rect(0,0,8,8)); } -TEST(Resize, DISABLED_nearest_regression_15075) // reverted https://github.com/opencv/opencv/pull/16497 +TEST(Resize, nearest_regression_15075) { const int C = 5; const int i1 = 5, j1 = 5;