diff --git a/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp b/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp index 3fe9f82f4c..9f3dd96f94 100644 --- a/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp +++ b/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp @@ -57,7 +57,7 @@ namespace cv { namespace gpu { /////////////////////////// Color Processing /////////////////////////// //! converts image from one color space to another -CV_EXPORTS void cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn = 0, Stream& stream = Stream::Null()); +CV_EXPORTS void cvtColor(InputArray src, OutputArray dst, int code, int dcn = 0, Stream& stream = Stream::Null()); enum { @@ -77,24 +77,24 @@ enum COLOR_BayerRG2GRAY_MHT = 262, COLOR_BayerGR2GRAY_MHT = 263 }; -CV_EXPORTS void demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn = -1, Stream& stream = Stream::Null()); +CV_EXPORTS void demosaicing(InputArray src, OutputArray dst, int code, int dcn = -1, Stream& stream = Stream::Null()); //! swap channels //! dstOrder - Integer array describing how channel values are permutated. The n-th entry //! of the array contains the number of the channel that is stored in the n-th channel of //! the output image. E.g. Given an RGBA image, aDstOrder = [3,2,1,0] converts this to ABGR //! channel order. -CV_EXPORTS void swapChannels(GpuMat& image, const int dstOrder[4], Stream& stream = Stream::Null()); +CV_EXPORTS void swapChannels(InputOutputArray image, const int dstOrder[4], Stream& stream = Stream::Null()); //! Routines for correcting image color gamma -CV_EXPORTS void gammaCorrection(const GpuMat& src, GpuMat& dst, bool forward = true, Stream& stream = Stream::Null()); +CV_EXPORTS void gammaCorrection(InputArray src, OutputArray dst, bool forward = true, Stream& stream = Stream::Null()); enum { ALPHA_OVER, ALPHA_IN, ALPHA_OUT, ALPHA_ATOP, ALPHA_XOR, ALPHA_PLUS, ALPHA_OVER_PREMUL, ALPHA_IN_PREMUL, ALPHA_OUT_PREMUL, ALPHA_ATOP_PREMUL, ALPHA_XOR_PREMUL, ALPHA_PLUS_PREMUL, ALPHA_PREMUL}; //! Composite two images using alpha opacity values contained in each image //! Supports CV_8UC4, CV_16UC4, CV_32SC4 and CV_32FC4 types -CV_EXPORTS void alphaComp(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, int alpha_op, Stream& stream = Stream::Null()); +CV_EXPORTS void alphaComp(InputArray img1, InputArray img2, OutputArray dst, int alpha_op, Stream& stream = Stream::Null()); ////////////////////////////// Histogram /////////////////////////////// diff --git a/modules/gpuimgproc/src/color.cpp b/modules/gpuimgproc/src/color.cpp index c1af7ce750..006274742e 100644 --- a/modules/gpuimgproc/src/color.cpp +++ b/modules/gpuimgproc/src/color.cpp @@ -47,15 +47,16 @@ using namespace cv::gpu; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) -void cv::gpu::cvtColor(const GpuMat&, GpuMat&, int, int, Stream&) { throw_no_cuda(); } +void cv::gpu::cvtColor(InputArray, OutputArray, int, int, Stream&) { throw_no_cuda(); } -void cv::gpu::demosaicing(const GpuMat&, GpuMat&, int, int, Stream&) { throw_no_cuda(); } +void cv::gpu::demosaicing(InputArray, OutputArray, int, int, Stream&) { throw_no_cuda(); } -void cv::gpu::swapChannels(GpuMat&, const int[], Stream&) { throw_no_cuda(); } +void cv::gpu::swapChannels(InputOutputArray, const int[], Stream&) { throw_no_cuda(); } -void cv::gpu::gammaCorrection(const GpuMat&, GpuMat&, bool, Stream&) { throw_no_cuda(); } +void cv::gpu::gammaCorrection(InputArray, OutputArray, bool, Stream&) { throw_no_cuda(); } + +void cv::gpu::alphaComp(InputArray, InputArray, OutputArray, int, Stream&) { throw_no_cuda(); } -void cv::gpu::alphaComp(const GpuMat&, const GpuMat&, GpuMat&, int, Stream&) { throw_no_cuda(); } #else /* !defined (HAVE_CUDA) */ @@ -80,363 +81,459 @@ namespace { typedef void (*gpu_func_t)(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); - void bgr_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr_to_rgb(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgr_to_rgb_8u, 0, bgr_to_rgb_16u, 0, 0, bgr_to_rgb_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 3)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 3)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr_to_bgra(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgr_to_bgra_8u, 0, bgr_to_bgra_16u, 0, 0, bgr_to_bgra_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 4)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 4)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr_to_rgba(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgr_to_rgba_8u, 0, bgr_to_rgba_16u, 0, 0, bgr_to_rgba_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 4)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 4)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgra_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgra_to_bgr(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgra_to_bgr_8u, 0, bgra_to_bgr_16u, 0, 0, bgra_to_bgr_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 3)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 3)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgra_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgra_to_rgb(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgra_to_rgb_8u, 0, bgra_to_rgb_16u, 0, 0, bgra_to_rgb_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 3)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 3)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgra_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgra_to_rgba(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgra_to_rgba_8u, 0, bgra_to_rgba_16u, 0, 0, bgra_to_rgba_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 4)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 4)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr_to_bgr555(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::bgr_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr_to_bgr565(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::bgr_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void rgb_to_bgr555(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::rgb_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void rgb_to_bgr565(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::rgb_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } - void bgra_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgra_to_bgr555(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::bgra_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } - void bgra_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgra_to_bgr565(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::bgra_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } - void rgba_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void rgba_to_bgr555(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::rgba_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } - void rgba_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void rgba_to_bgr565(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::rgba_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } - void bgr555_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr555_to_rgb(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC3); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC3); + GpuMat dst = _dst.getGpuMat(); cudev::bgr555_to_rgb(src, dst, StreamAccessor::getStream(stream)); } - void bgr565_to_rgb(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr565_to_rgb(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC3); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC3); + GpuMat dst = _dst.getGpuMat(); cudev::bgr565_to_rgb(src, dst, StreamAccessor::getStream(stream)); } - void bgr555_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr555_to_bgr(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC3); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC3); + GpuMat dst = _dst.getGpuMat(); cudev::bgr555_to_bgr(src, dst, StreamAccessor::getStream(stream)); } - void bgr565_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr565_to_bgr(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC3); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC3); + GpuMat dst = _dst.getGpuMat(); cudev::bgr565_to_bgr(src, dst, StreamAccessor::getStream(stream)); } - void bgr555_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr555_to_rgba(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC4); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC4); + GpuMat dst = _dst.getGpuMat(); cudev::bgr555_to_rgba(src, dst, StreamAccessor::getStream(stream)); } - void bgr565_to_rgba(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr565_to_rgba(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC4); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC4); + GpuMat dst = _dst.getGpuMat(); cudev::bgr565_to_rgba(src, dst, StreamAccessor::getStream(stream)); } - void bgr555_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr555_to_bgra(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC4); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC4); + GpuMat dst = _dst.getGpuMat(); cudev::bgr555_to_bgra(src, dst, StreamAccessor::getStream(stream)); } - void bgr565_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr565_to_bgra(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC4); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC4); + GpuMat dst = _dst.getGpuMat(); cudev::bgr565_to_bgra(src, dst, StreamAccessor::getStream(stream)); } - void gray_to_bgr(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void gray_to_bgr(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {gray_to_bgr_8u, 0, gray_to_bgr_16u, 0, 0, gray_to_bgr_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 1); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 3)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 1 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 3)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void gray_to_bgra(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void gray_to_bgra(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {gray_to_bgra_8u, 0, gray_to_bgra_16u, 0, 0, gray_to_bgra_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 1); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 4)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 1 ); + + _dst.create(src.size(), CV_MAKETYPE(src.depth(), 4)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void gray_to_bgr555(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void gray_to_bgr555(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 1); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 1 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::gray_to_bgr555(src, dst, StreamAccessor::getStream(stream)); } - void gray_to_bgr565(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void gray_to_bgr565(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 1); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC2); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 1 ); + + _dst.create(src.size(), CV_8UC2); + GpuMat dst = _dst.getGpuMat(); cudev::gray_to_bgr565(src, dst, StreamAccessor::getStream(stream)); } - void bgr555_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr555_to_gray(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC1); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC1); + GpuMat dst = _dst.getGpuMat(); cudev::bgr555_to_gray(src, dst, StreamAccessor::getStream(stream)); } - void bgr565_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr565_to_gray(InputArray _src, OutputArray _dst, int, Stream& stream) { - CV_Assert(src.depth() == CV_8U); - CV_Assert(src.channels() == 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_8UC1); + CV_Assert( src.depth() == CV_8U ); + CV_Assert( src.channels() == 2 ); + + _dst.create(src.size(), CV_8UC1); + GpuMat dst = _dst.getGpuMat(); cudev::bgr565_to_gray(src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void rgb_to_gray(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {rgb_to_gray_8u, 0, rgb_to_gray_16u, 0, 0, rgb_to_gray_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 1)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 1)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgr_to_gray(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgr_to_gray_8u, 0, bgr_to_gray_16u, 0, 0, bgr_to_gray_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 1)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 1)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgba_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void rgba_to_gray(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {rgba_to_gray_8u, 0, rgba_to_gray_16u, 0, 0, rgba_to_gray_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 1)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 1)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgra_to_gray(const GpuMat& src, GpuMat& dst, int, Stream& stream) + void bgra_to_gray(InputArray _src, OutputArray _dst, int, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[] = {bgra_to_gray_8u, 0, bgra_to_gray_16u, 0, 0, bgra_to_gray_32f}; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 1)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 1)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_yuv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_yuv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -453,16 +550,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_yuv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_yuv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -479,16 +579,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void yuv_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void yuv_to_rgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -505,16 +608,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void yuv_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void yuv_to_bgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -531,16 +637,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_YCrCb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_YCrCb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -557,16 +666,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_YCrCb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_YCrCb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -583,16 +695,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void YCrCb_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void YCrCb_to_rgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -609,16 +724,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void YCrCb_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void YCrCb_to_bgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -635,16 +753,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_xyz(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_xyz(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -661,16 +782,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_xyz(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_xyz(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -687,16 +811,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void xyz_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void xyz_to_rgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -713,16 +840,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void xyz_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void xyz_to_bgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -739,16 +869,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_16U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_hsv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_hsv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -765,16 +898,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_hsv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_hsv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -791,16 +927,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hsv_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hsv_to_rgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -817,16 +956,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hsv_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hsv_to_bgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -843,16 +985,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_hls(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_hls(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -869,16 +1014,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_hls(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_hls(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -895,16 +1043,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hls_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hls_to_rgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -921,16 +1072,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hls_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hls_to_bgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -947,16 +1101,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_hsv_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_hsv_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -973,16 +1130,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_hsv_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_hsv_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -999,16 +1159,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hsv_to_rgb_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hsv_to_rgb_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -1025,16 +1188,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hsv_to_bgr_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hsv_to_bgr_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -1051,16 +1217,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_hls_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_hls_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -1077,16 +1246,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_hls_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_hls_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -1103,16 +1275,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hls_to_rgb_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hls_to_rgb_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -1129,16 +1304,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void hls_to_bgr_full(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void hls_to_bgr_full(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][6] = @@ -1155,16 +1333,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth()](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_lab(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1181,16 +1362,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_lab(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1207,16 +1391,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lbgr_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lbgr_to_lab(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1233,16 +1420,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lrgb_to_lab(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lrgb_to_lab(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1259,16 +1449,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lab_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lab_to_bgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1285,16 +1478,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lab_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lab_to_rgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1311,16 +1507,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lab_to_lbgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lab_to_lbgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1337,16 +1536,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lab_to_lrgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lab_to_lrgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1363,16 +1565,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void bgr_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bgr_to_luv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1389,16 +1594,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void rgb_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void rgb_to_luv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1415,16 +1623,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lbgr_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lbgr_to_luv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1441,16 +1652,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void lrgb_to_luv(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void lrgb_to_luv(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1467,16 +1681,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void luv_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void luv_to_bgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1493,16 +1710,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void luv_to_rgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void luv_to_rgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1519,16 +1739,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void luv_to_lbgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void luv_to_lbgr(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1545,16 +1768,19 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void luv_to_lrgb(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void luv_to_lrgb(InputArray _src, OutputArray _dst, int dcn, Stream& stream) { using namespace cv::gpu::cudev; static const gpu_func_t funcs[2][2][2] = @@ -1571,28 +1797,34 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.depth() == CV_8U || src.depth() == CV_32F); - CV_Assert(src.channels() == 3 || src.channels() == 4); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + CV_Assert( src.depth() == CV_8U || src.depth() == CV_32F ); + CV_Assert( src.channels() == 3 || src.channels() == 4 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[dcn == 4][src.channels() == 4][src.depth() == CV_32F](src, dst, StreamAccessor::getStream(stream)); } - void rgba_to_mbgra(const GpuMat& src, GpuMat& dst, int, Stream& st) + void rgba_to_mbgra(InputArray _src, OutputArray _dst, int, Stream& _stream) { #if (CUDA_VERSION < 5000) - (void)src; - (void)dst; - (void)st; + (void) _src; + (void) _dst; + (void) _stream; CV_Error( Error::StsBadFlag, "Unknown/unsupported color conversion code" ); #else - CV_Assert(src.type() == CV_8UC4 || src.type() == CV_16UC4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), src.type()); + CV_Assert( src.type() == CV_8UC4 || src.type() == CV_16UC4 ); - cudaStream_t stream = StreamAccessor::getStream(st); + _dst.create(src.size(), src.type()); + GpuMat dst = _dst.getGpuMat(); + + cudaStream_t stream = StreamAccessor::getStream(_stream); NppStreamHandler h(stream); NppiSize oSizeROI; @@ -1609,7 +1841,7 @@ namespace #endif } - void bayer_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, bool blue_last, bool start_with_green, Stream& stream) + void bayer_to_bgr(InputArray _src, OutputArray _dst, int dcn, bool blue_last, bool start_with_green, Stream& stream) { typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, bool blue_last, bool start_with_green, cudaStream_t stream); static const func_t funcs[3][4] = @@ -1621,32 +1853,35 @@ namespace if (dcn <= 0) dcn = 3; - CV_Assert(src.type() == CV_8UC1 || src.type() == CV_16UC1); - CV_Assert(src.rows > 2 && src.cols > 2); - CV_Assert(dcn == 3 || dcn == 4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), dcn)); + CV_Assert( src.type() == CV_8UC1 || src.type() == CV_16UC1 ); + CV_Assert( src.rows > 2 && src.cols > 2 ); + CV_Assert( dcn == 3 || dcn == 4 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), dcn)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()][dcn - 1](src, dst, blue_last, start_with_green, StreamAccessor::getStream(stream)); } - void bayerBG_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bayerBG_to_bgr(InputArray src, OutputArray dst, int dcn, Stream& stream) { bayer_to_bgr(src, dst, dcn, false, false, stream); } - void bayerGB_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bayerGB_to_bgr(InputArray src, OutputArray dst, int dcn, Stream& stream) { bayer_to_bgr(src, dst, dcn, false, true, stream); } - void bayerRG_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bayerRG_to_bgr(InputArray src, OutputArray dst, int dcn, Stream& stream) { bayer_to_bgr(src, dst, dcn, true, false, stream); } - void bayerGR_to_bgr(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream) + void bayerGR_to_bgr(InputArray src, OutputArray dst, int dcn, Stream& stream) { bayer_to_bgr(src, dst, dcn, true, true, stream); } - void bayer_to_gray(const GpuMat& src, GpuMat& dst, bool blue_last, bool start_with_green, Stream& stream) + void bayer_to_gray(InputArray _src, OutputArray _dst, bool blue_last, bool start_with_green, Stream& stream) { typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, bool blue_last, bool start_with_green, cudaStream_t stream); static const func_t funcs[3] = @@ -1656,26 +1891,29 @@ namespace Bayer2BGR_16u_gpu<1>, }; - CV_Assert(src.type() == CV_8UC1 || src.type() == CV_16UC1); - CV_Assert(src.rows > 2 && src.cols > 2); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), CV_MAKETYPE(src.depth(), 1)); + CV_Assert( src.type() == CV_8UC1 || src.type() == CV_16UC1 ); + CV_Assert( src.rows > 2 && src.cols > 2 ); + + _dst.create(src.size(), CV_MAKE_TYPE(src.depth(), 1)); + GpuMat dst = _dst.getGpuMat(); funcs[src.depth()](src, dst, blue_last, start_with_green, StreamAccessor::getStream(stream)); } - void bayerBG_to_gray(const GpuMat& src, GpuMat& dst, int /*dcn*/, Stream& stream) + void bayerBG_to_gray(InputArray src, OutputArray dst, int /*dcn*/, Stream& stream) { bayer_to_gray(src, dst, false, false, stream); } - void bayerGB_to_gray(const GpuMat& src, GpuMat& dst, int /*dcn*/, Stream& stream) + void bayerGB_to_gray(InputArray src, OutputArray dst, int /*dcn*/, Stream& stream) { bayer_to_gray(src, dst, false, true, stream); } - void bayerRG_to_gray(const GpuMat& src, GpuMat& dst, int /*dcn*/, Stream& stream) + void bayerRG_to_gray(InputArray src, OutputArray dst, int /*dcn*/, Stream& stream) { bayer_to_gray(src, dst, true, false, stream); } - void bayerGR_to_gray(const GpuMat& src, GpuMat& dst, int /*dcn*/, Stream& stream) + void bayerGR_to_gray(InputArray src, OutputArray dst, int /*dcn*/, Stream& stream) { bayer_to_gray(src, dst, true, true, stream); } @@ -1684,9 +1922,9 @@ namespace //////////////////////////////////////////////////////////////////////// // cvtColor -void cv::gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, Stream& stream) +void cv::gpu::cvtColor(InputArray src, OutputArray dst, int code, int dcn, Stream& stream) { - typedef void (*func_t)(const GpuMat& src, GpuMat& dst, int dcn, Stream& stream); + typedef void (*func_t)(InputArray src, OutputArray dst, int dcn, Stream& stream); static const func_t funcs[] = { bgr_to_bgra, // CV_BGR2BGRA =0 @@ -1857,12 +2095,12 @@ void cv::gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, Stream 0, // CV_COLORCVT_MAX = 127 }; - CV_Assert(code < 128); + CV_Assert( code < 128 ); func_t func = funcs[code]; if (func == 0) - CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported color conversion code" ); + CV_Error(Error::StsBadFlag, "Unknown/unsupported color conversion code"); func(src, dst, dcn, stream); } @@ -1870,32 +2108,33 @@ void cv::gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, Stream //////////////////////////////////////////////////////////////////////// // demosaicing -void cv::gpu::demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn, Stream& stream) +void cv::gpu::demosaicing(InputArray _src, OutputArray _dst, int code, int dcn, Stream& stream) { - const int depth = src.depth(); - - CV_Assert( src.channels() == 1 ); - switch (code) { case cv::COLOR_BayerBG2GRAY: case cv::COLOR_BayerGB2GRAY: case cv::COLOR_BayerRG2GRAY: case cv::COLOR_BayerGR2GRAY: - bayer_to_gray(src, dst, code == cv::COLOR_BayerBG2GRAY || code == cv::COLOR_BayerGB2GRAY, code == cv::COLOR_BayerGB2GRAY || code == cv::COLOR_BayerGR2GRAY, stream); + bayer_to_gray(_src, _dst, code == cv::COLOR_BayerBG2GRAY || code == cv::COLOR_BayerGB2GRAY, code == cv::COLOR_BayerGB2GRAY || code == cv::COLOR_BayerGR2GRAY, stream); break; case cv::COLOR_BayerBG2BGR: case cv::COLOR_BayerGB2BGR: case cv::COLOR_BayerRG2BGR: case cv::COLOR_BayerGR2BGR: - bayer_to_bgr(src, dst, dcn, code == cv::COLOR_BayerBG2BGR || code == cv::COLOR_BayerGB2BGR, code == cv::COLOR_BayerGB2BGR || code == cv::COLOR_BayerGR2BGR, stream); + bayer_to_bgr(_src, _dst, dcn, code == cv::COLOR_BayerBG2BGR || code == cv::COLOR_BayerGB2BGR, code == cv::COLOR_BayerGB2BGR || code == cv::COLOR_BayerGR2BGR, stream); break; case COLOR_BayerBG2BGR_MHT: case COLOR_BayerGB2BGR_MHT: case COLOR_BayerRG2BGR_MHT: case COLOR_BayerGR2BGR_MHT: { - if (dcn <= 0) - dcn = 3; + if (dcn <= 0) dcn = 3; + + GpuMat src = _src.getGpuMat(); + const int depth = _src.depth(); CV_Assert( depth == CV_8U ); + CV_Assert( src.channels() == 1 ); CV_Assert( dcn == 3 || dcn == 4 ); - dst.create(src.size(), CV_MAKETYPE(depth, dcn)); - dst.setTo(Scalar::all(0)); + _dst.create(_src.size(), CV_MAKE_TYPE(depth, dcn)); + GpuMat dst = _dst.getGpuMat(); + + dst.setTo(Scalar::all(0), stream); Size wholeSize; Point ofs; @@ -1915,10 +2154,15 @@ void cv::gpu::demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn, Str case COLOR_BayerBG2GRAY_MHT: case COLOR_BayerGB2GRAY_MHT: case COLOR_BayerRG2GRAY_MHT: case COLOR_BayerGR2GRAY_MHT: { + GpuMat src = _src.getGpuMat(); + const int depth = _src.depth(); + CV_Assert( depth == CV_8U ); - dst.create(src.size(), CV_MAKETYPE(depth, 1)); - dst.setTo(Scalar::all(0)); + _dst.create(_src.size(), CV_MAKE_TYPE(depth, 1)); + GpuMat dst = _dst.getGpuMat(); + + dst.setTo(Scalar::all(0), stream); Size wholeSize; Point ofs; @@ -1934,19 +2178,20 @@ void cv::gpu::demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn, Str } default: - CV_Error( cv::Error::StsBadFlag, "Unknown / unsupported color conversion code" ); + CV_Error(Error::StsBadFlag, "Unknown / unsupported color conversion code"); } } //////////////////////////////////////////////////////////////////////// // swapChannels -void cv::gpu::swapChannels(GpuMat& image, const int dstOrder[4], Stream& s) +void cv::gpu::swapChannels(InputOutputArray _image, const int dstOrder[4], Stream& _stream) { - CV_Assert(image.type() == CV_8UC4); + GpuMat image = _image.getGpuMat(); - cudaStream_t stream = StreamAccessor::getStream(s); + CV_Assert( image.type() == CV_8UC4 ); + cudaStream_t stream = StreamAccessor::getStream(_stream); NppStreamHandler h(stream); NppiSize sz; @@ -1962,14 +2207,14 @@ void cv::gpu::swapChannels(GpuMat& image, const int dstOrder[4], Stream& s) //////////////////////////////////////////////////////////////////////// // gammaCorrection -void cv::gpu::gammaCorrection(const GpuMat& src, GpuMat& dst, bool forward, Stream& stream) +void cv::gpu::gammaCorrection(InputArray _src, OutputArray _dst, bool forward, Stream& stream) { #if (CUDA_VERSION < 5000) - (void)src; - (void)dst; - (void)forward; - (void)stream; - CV_Error( cv::Error::StsNotImplemented, "This function works only with CUDA 5.0 or higher" ); + (void) _src; + (void) _dst; + (void) forward; + (void) stream; + CV_Error(Error::StsNotImplemented, "This function works only with CUDA 5.0 or higher"); #else typedef NppStatus (*func_t)(const Npp8u* pSrc, int nSrcStep, Npp8u* pDst, int nDstStep, NppiSize oSizeROI); typedef NppStatus (*func_inplace_t)(Npp8u* pSrcDst, int nSrcDstStep, NppiSize oSizeROI); @@ -1985,9 +2230,12 @@ void cv::gpu::gammaCorrection(const GpuMat& src, GpuMat& dst, bool forward, Stre {0, 0, 0, nppiGammaFwd_8u_C3IR, nppiGammaFwd_8u_AC4IR} }; - CV_Assert(src.type() == CV_8UC3 || src.type() == CV_8UC4); + GpuMat src = _src.getGpuMat(); - dst.create(src.size(), src.type()); + CV_Assert( src.type() == CV_8UC3 || src.type() == CV_8UC4 ); + + _dst.create(src.size(), src.type()); + GpuMat dst = _dst.getGpuMat(); NppStreamHandler h(StreamAccessor::getStream(stream)); @@ -2036,7 +2284,7 @@ namespace }; } -void cv::gpu::alphaComp(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, int alpha_op, Stream& stream) +void cv::gpu::alphaComp(InputArray _img1, InputArray _img2, OutputArray _dst, int alpha_op, Stream& stream) { static const NppiAlphaOp npp_alpha_ops[] = { NPPI_OP_ALPHA_OVER, @@ -2055,7 +2303,6 @@ void cv::gpu::alphaComp(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, int }; typedef void (*func_t)(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, NppiAlphaOp eAlphaOp, cudaStream_t stream); - static const func_t funcs[] = { NppAlphaComp::call, @@ -2066,10 +2313,14 @@ void cv::gpu::alphaComp(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, int NppAlphaComp::call }; + GpuMat img1 = _img1.getGpuMat(); + GpuMat img2 = _img2.getGpuMat(); + CV_Assert( img1.type() == CV_8UC4 || img1.type() == CV_16UC4 || img1.type() == CV_32SC4 || img1.type() == CV_32FC4 ); CV_Assert( img1.size() == img2.size() && img1.type() == img2.type() ); - dst.create(img1.size(), img1.type()); + _dst.create(img1.size(), img1.type()); + GpuMat dst = _dst.getGpuMat(); const func_t func = funcs[img1.depth()]; diff --git a/modules/gpuoptflow/src/needle_map.cpp b/modules/gpuoptflow/src/needle_map.cpp index 1fdc162628..9ca8fe5e44 100644 --- a/modules/gpuoptflow/src/needle_map.cpp +++ b/modules/gpuoptflow/src/needle_map.cpp @@ -94,7 +94,7 @@ void cv::gpu::createOpticalFlowNeedleMap(const GpuMat& u, const GpuMat& v, GpuMa CreateOpticalFlowNeedleMap_gpu(u_avg, v_avg, vertex.ptr(), colors.ptr(), max_flow, 1.0f / u.cols, 1.0f / u.rows); - cvtColor(colors, colors, COLOR_HSV2RGB); + gpu::cvtColor(colors, colors, COLOR_HSV2RGB); } #endif /* HAVE_CUDA */ diff --git a/modules/superres/src/input_array_utility.cpp b/modules/superres/src/input_array_utility.cpp index e749050895..3de3e1e5a8 100644 --- a/modules/superres/src/input_array_utility.cpp +++ b/modules/superres/src/input_array_utility.cpp @@ -169,7 +169,7 @@ namespace break; default: - cvtColor(src, dst, code, cn); + cv::cvtColor(src, dst, code, cn); break; } } diff --git a/samples/gpu/brox_optical_flow.cpp b/samples/gpu/brox_optical_flow.cpp index 1d92e4b3ff..1fb85c9038 100644 --- a/samples/gpu/brox_optical_flow.cpp +++ b/samples/gpu/brox_optical_flow.cpp @@ -85,8 +85,8 @@ int main(int argc, const char* argv[]) Mat frame0Gray, frame1Gray; - cvtColor(frame0Color, frame0Gray, COLOR_BGR2GRAY); - cvtColor(frame1Color, frame1Gray, COLOR_BGR2GRAY); + cv::cvtColor(frame0Color, frame0Gray, COLOR_BGR2GRAY); + cv::cvtColor(frame1Color, frame1Gray, COLOR_BGR2GRAY); GpuMat d_frame0(frame0Gray); GpuMat d_frame1(frame1Gray); diff --git a/samples/gpu/cascadeclassifier.cpp b/samples/gpu/cascadeclassifier.cpp index 942a964d5a..929fd3085e 100644 --- a/samples/gpu/cascadeclassifier.cpp +++ b/samples/gpu/cascadeclassifier.cpp @@ -294,7 +294,7 @@ int main(int argc, const char *argv[]) } cout << endl; - cvtColor(resized_cpu, frameDisp, COLOR_GRAY2BGR); + cv::cvtColor(resized_cpu, frameDisp, COLOR_GRAY2BGR); displayState(frameDisp, helpScreen, useGPU, findLargestObject, filterRects, fps); imshow("result", frameDisp); diff --git a/samples/gpu/generalized_hough.cpp b/samples/gpu/generalized_hough.cpp index c8fae7c411..a8f7cc67cc 100644 --- a/samples/gpu/generalized_hough.cpp +++ b/samples/gpu/generalized_hough.cpp @@ -181,7 +181,7 @@ int main(int argc, const char* argv[]) cout << "Detection time : " << tm.getTimeMilli() << " ms" << endl; Mat out; - cvtColor(image, out, COLOR_GRAY2BGR); + cv::cvtColor(image, out, COLOR_GRAY2BGR); for (size_t i = 0; i < position.size(); ++i) { diff --git a/samples/gpu/houghlines.cpp b/samples/gpu/houghlines.cpp index f53724eccf..299fa47cb4 100644 --- a/samples/gpu/houghlines.cpp +++ b/samples/gpu/houghlines.cpp @@ -34,7 +34,7 @@ int main(int argc, const char* argv[]) Canny(src, mask, 100, 200, 3); Mat dst_cpu; - cvtColor(mask, dst_cpu, COLOR_GRAY2BGR); + cv::cvtColor(mask, dst_cpu, COLOR_GRAY2BGR); Mat dst_gpu = dst_cpu.clone(); vector lines_cpu; diff --git a/samples/gpu/pyrlk_optical_flow.cpp b/samples/gpu/pyrlk_optical_flow.cpp index 95170cc7e9..2edb9746c6 100644 --- a/samples/gpu/pyrlk_optical_flow.cpp +++ b/samples/gpu/pyrlk_optical_flow.cpp @@ -170,9 +170,9 @@ int main(int argc, const char* argv[]) cout << endl; Mat frame0Gray; - cvtColor(frame0, frame0Gray, COLOR_BGR2GRAY); + cv::cvtColor(frame0, frame0Gray, COLOR_BGR2GRAY); Mat frame1Gray; - cvtColor(frame1, frame1Gray, COLOR_BGR2GRAY); + cv::cvtColor(frame1, frame1Gray, COLOR_BGR2GRAY); // goodFeaturesToTrack