From 16ef01efdaa7bd13ad0a63f138dc8d705b9dcf68 Mon Sep 17 00:00:00 2001 From: Marina Kolpakova Date: Wed, 6 Jun 2012 16:05:31 +0000 Subject: [PATCH] set to linear interpolation type for upscaling with area interplation flag --- modules/gpu/perf/perf_imgproc.cpp | 2 +- modules/gpu/perf_cpu/perf_imgproc.cpp | 2 +- modules/gpu/src/cuda/resize.cu | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/gpu/perf/perf_imgproc.cpp b/modules/gpu/perf/perf_imgproc.cpp index 3a714c2ee..b261ad086 100644 --- a/modules/gpu/perf/perf_imgproc.cpp +++ b/modules/gpu/perf/perf_imgproc.cpp @@ -88,7 +88,7 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine( MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)), testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC), Interpolation(cv::INTER_AREA)), - testing::Values(Scale(0.5), Scale(0.3)/*, Scale(2.0)*/))); + testing::Values(Scale(0.5), Scale(0.3), Scale(2.0)))); ////////////////////////////////////////////////////////////////////// // WarpAffine diff --git a/modules/gpu/perf_cpu/perf_imgproc.cpp b/modules/gpu/perf_cpu/perf_imgproc.cpp index 68f38afa0..9fe9fd07a 100644 --- a/modules/gpu/perf_cpu/perf_imgproc.cpp +++ b/modules/gpu/perf_cpu/perf_imgproc.cpp @@ -78,7 +78,7 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine( MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)), testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC), Interpolation(cv::INTER_AREA)), - testing::Values(Scale(0.5), Scale(0.3)/*, Scale(2.0)*/))); + testing::Values(Scale(0.5), Scale(0.3), Scale(2.0)))); ////////////////////////////////////////////////////////////////////// // WarpAffine diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index e1694db0c..a51c04306 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -241,6 +241,9 @@ namespace cv { namespace gpu { namespace device ResizeDispatcher::call, ResizeDispatcher::call }; + // chenge to linear if area interpolation upscaling + if (interpolation == 3 && (fx <= 1.f || fy <= 1.f)) + interpolation = 1; callers[interpolation](static_cast< DevMem2D_ >(src), static_cast< DevMem2D_ >(srcWhole), xoff, yoff, fx, fy, static_cast< DevMem2D_ >(dst), stream);