diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index 1998b3b07..ed3806be8 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -342,11 +342,13 @@ namespace cv { namespace gpu { namespace device template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; +#ifndef OPENCV_TINY_GPU_MODULE template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; +#endif template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; template <> struct ResizeNearestDispatcher : SelectImplForNearest {}; @@ -380,11 +382,13 @@ namespace cv { namespace gpu { namespace device template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; +#ifndef OPENCV_TINY_GPU_MODULE template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; +#endif template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; template <> struct ResizeLinearDispatcher : SelectImplForLinear {}; @@ -410,6 +414,7 @@ namespace cv { namespace gpu { namespace device } }; +#ifndef OPENCV_TINY_GPU_MODULE template <> struct ResizeCubicDispatcher : SelectImplForCubic {}; template <> struct ResizeCubicDispatcher : SelectImplForCubic {}; @@ -421,6 +426,7 @@ namespace cv { namespace gpu { namespace device template <> struct ResizeCubicDispatcher : SelectImplForCubic {}; template <> struct ResizeCubicDispatcher : SelectImplForCubic {}; +#endif // ResizeAreaDispatcher @@ -467,7 +473,11 @@ namespace cv { namespace gpu { namespace device { ResizeNearestDispatcher::call, ResizeLinearDispatcher::call, +#ifdef OPENCV_TINY_GPU_MODULE + 0, +#else ResizeCubicDispatcher::call, +#endif ResizeAreaDispatcher::call }; @@ -482,6 +492,7 @@ namespace cv { namespace gpu { namespace device template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); +#ifndef OPENCV_TINY_GPU_MODULE template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); @@ -489,6 +500,7 @@ namespace cv { namespace gpu { namespace device template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); +#endif template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); template void resize(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); diff --git a/modules/gpu/src/resize.cpp b/modules/gpu/src/resize.cpp index e1b502672..66a771668 100644 --- a/modules/gpu/src/resize.cpp +++ b/modules/gpu/src/resize.cpp @@ -57,6 +57,18 @@ namespace cv { namespace gpu { namespace device void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, double fy, int interpolation, Stream& stream) { typedef void (*func_t)(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream); + +#ifdef OPENCV_TINY_GPU_MODULE + static const func_t funcs[6][4] = + { + {device::resize , 0 /*device::resize*/ , device::resize , device::resize }, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {device::resize , 0 /*device::resize*/ , device::resize , device::resize } + }; +#else static const func_t funcs[6][4] = { {device::resize , 0 /*device::resize*/ , device::resize , device::resize }, @@ -66,6 +78,7 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub {0 /*device::resize*/ , 0 /*device::resize*/ , 0 /*device::resize*/ , 0 /*device::resize*/ }, {device::resize , 0 /*device::resize*/ , device::resize , device::resize } }; +#endif CV_Assert( src.depth() <= CV_32F && src.channels() <= 4 ); CV_Assert( interpolation == INTER_NEAREST || interpolation == INTER_LINEAR || interpolation == INTER_CUBIC || interpolation == INTER_AREA );