From: Marina Kolpakova Date: Wed, 6 Jun 2012 10:39:42 +0000 (+0000) Subject: GPU resize with INTER_AREA X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~4801 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d192117e866b80ba7c4418391ba767d45baa9f28;p=platform%2Fupstream%2Fopencv.git GPU resize with INTER_AREA --- diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index 732b0f7..813bced 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -46,6 +46,7 @@ #include "opencv2/gpu/device/vec_math.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" #include "opencv2/gpu/device/filters.hpp" +# include namespace cv { namespace gpu { namespace device { @@ -65,6 +66,17 @@ namespace cv { namespace gpu { namespace device } } + template __global__ void resize_area(const Ptr2D src, float fx, float fy, DevMem2D_ dst) + { + const int x = blockDim.x * blockIdx.x + threadIdx.x; + const int y = blockDim.y * blockIdx.y + threadIdx.y; + + if (x < dst.cols && y < dst.rows) + { + dst(y, x) = saturate_cast(src(y, x)); + } + } + template