Merge pull request #16497 from keeper121:master

* Fix NN resize with dimentions > 4

* add test check for nn resize with channels > 4

* Change types from float to double

* Del unnecessary test file. Move nn test to test_imgwarp. Add 5 channels test only.
pull/16600/head
keeper121 5 years ago committed by GitHub
parent f81fdd58da
commit d84360e7f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/imgproc/src/resize.cpp
  2. 15
      modules/imgproc/test/test_imgwarp.cpp

@ -1045,7 +1045,7 @@ public:
{
const int* _tS = (const int*)(S + x_ofs[x]);
int* _tD = (int*)D;
for( int k = 0; k < pix_size4; k++ )
for( int k = 0; k <= pix_size4; k++ )
_tD[k] = _tS[k];
}
}

@ -1721,6 +1721,21 @@ TEST(Resize, lanczos4_regression_16192)
EXPECT_EQ(cvtest::norm(dst, expected, NORM_INF), 0) << dst(Rect(0,0,8,8));
}
TEST(Resize, nearest_regression_15075)
{
const int C = 5;
const int i1 = 5, j1 = 5;
Size src_size(12, 12);
Size dst_size(11, 11);
cv::Mat src = cv::Mat::zeros(src_size, CV_8UC(C)), dst;
for (int j = 0; j < C; j++)
src.col(i1).row(j1).data[j] = 1;
cv::resize(src, dst, dst_size, 0, 0, INTER_NEAREST);
EXPECT_EQ(C, cvtest::norm(dst, NORM_L1)) << src.size;
}
TEST(Imgproc_Warp, multichannel)
{
static const int inter_types[] = {INTER_NEAREST, INTER_AREA, INTER_CUBIC,

Loading…
Cancel
Save