From: Marina Kolpakova Date: Wed, 6 Jun 2012 16:05:31 +0000 (+0000) Subject: set to linear interpolation type for upscaling with area interplation flag X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~4793 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16ef01efdaa7bd13ad0a63f138dc8d705b9dcf68;p=platform%2Fupstream%2Fopencv.git set to linear interpolation type for upscaling with area interplation flag --- diff --git a/modules/gpu/perf/perf_imgproc.cpp b/modules/gpu/perf/perf_imgproc.cpp index 3a714c2..b261ad0 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 68f38af..9fe9fd0 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 e1694db..a51c043 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);