Merge branch 'master' of https://github.com/opencv/opencv into interpMultichannelImg
authorArtem Lukoyanov <lukartoil@gmail.com>
Fri, 24 Mar 2017 20:32:44 +0000 (23:32 +0300)
committerArtem Lukoyanov <lukartoil@gmail.com>
Fri, 24 Mar 2017 20:58:51 +0000 (23:58 +0300)
Added assertios to remap and warpAffine functions

As @mshabunin said, remap and warpAffine functions do not support more than 4 channels in
Bicubic and Lanczos4 interpolation modes. Assertions were added. Appropriate test was chenged.
resolves #8272

1  2 
modules/imgproc/src/imgwarp.cpp
modules/imgproc/test/test_imgwarp.cpp

Simple merge
@@@ -1686,12 -1686,23 +1686,25 @@@ TEST(Resize, Area_half
  
  TEST(Imgproc_Warp, multichannel)
  {
+     static const int inter_types[] = {INTER_NEAREST, INTER_AREA, INTER_CUBIC,
+                                       INTER_LANCZOS4, INTER_LINEAR};
+     static const int inter_n = sizeof(inter_types) / sizeof(int);
+     static const int border_types[] = {BORDER_CONSTANT, BORDER_DEFAULT,
+                                        BORDER_REFLECT, BORDER_REPLICATE,
+                                        BORDER_WRAP, BORDER_WRAP};
+     static const int border_n = sizeof(border_types) / sizeof(int);
      RNG& rng = theRNG();
-     for( int iter = 0; iter < 30; iter++ )
+     for( int iter = 0; iter < 100; iter++ )
      {
+         int inter = inter_types[rng.uniform(0, inter_n)];
+         int border = border_types[rng.uniform(0, border_n)];
          int width = rng.uniform(3, 333);
          int height = rng.uniform(3, 333);
-         int cn = rng.uniform(1, 10);
+         int cn = rng.uniform(1, 15);
++        if(inter == INTER_CUBIC || inter == INTER_LANCZOS4)
++            cn = rng.uniform(1, 5);
          Mat src(height, width, CV_8UC(cn)), dst;
          //randu(src, 0, 256);
          src.setTo(0.);