set to linear interpolation type for upscaling with area interplation flag
authorMarina Kolpakova <no@email>
Wed, 6 Jun 2012 16:05:31 +0000 (16:05 +0000)
committerMarina Kolpakova <no@email>
Wed, 6 Jun 2012 16:05:31 +0000 (16:05 +0000)
modules/gpu/perf/perf_imgproc.cpp
modules/gpu/perf_cpu/perf_imgproc.cpp
modules/gpu/src/cuda/resize.cu

index 3a714c2..b261ad0 100644 (file)
@@ -88,7 +88,7 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine(
                     MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),\r
     testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR),\r
                     Interpolation(cv::INTER_CUBIC),   Interpolation(cv::INTER_AREA)),\r
-    testing::Values(Scale(0.5), Scale(0.3)/*, Scale(2.0)*/)));\r
+    testing::Values(Scale(0.5), Scale(0.3), Scale(2.0))));\r
 \r
 //////////////////////////////////////////////////////////////////////\r
 // WarpAffine\r
index 68f38af..9fe9fd0 100644 (file)
@@ -78,7 +78,7 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine(
                     MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),\r
     testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR),\r
                     Interpolation(cv::INTER_CUBIC),   Interpolation(cv::INTER_AREA)),\r
-    testing::Values(Scale(0.5), Scale(0.3)/*, Scale(2.0)*/)));\r
+    testing::Values(Scale(0.5), Scale(0.3), Scale(2.0))));\r
 \r
 //////////////////////////////////////////////////////////////////////\r
 // WarpAffine\r
index e1694db..a51c043 100644 (file)
@@ -241,6 +241,9 @@ namespace cv { namespace gpu { namespace device
                 ResizeDispatcher<CubicFilter, T>::call,\r
                 ResizeDispatcher<AreaFilter, T>::call\r
             };\r
+            // chenge to linear if area interpolation upscaling\r
+            if (interpolation == 3 && (fx <= 1.f || fy <= 1.f))\r
+                interpolation = 1;\r
 \r
             callers[interpolation](static_cast< DevMem2D_<T> >(src), static_cast< DevMem2D_<T> >(srcWhole), xoff, yoff, fx, fy, \r
                 static_cast< DevMem2D_<T> >(dst), stream);\r