diff --git a/modules/core/include/opencv2/core/cuda.hpp b/modules/core/include/opencv2/core/cuda.hpp index 8191c00783..4eeb70b217 100644 --- a/modules/core/include/opencv2/core/cuda.hpp +++ b/modules/core/include/opencv2/core/cuda.hpp @@ -240,6 +240,10 @@ public: //! converts GpuMat to another datatype (Blocking call) void convertTo(OutputArray dst, int rtype) const; + //! bindings overload which converts GpuMat to another datatype (Blocking call) + CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype) const { + convertTo(static_cast(dst), rtype); + } //! converts GpuMat to another datatype (Non-Blocking call) void convertTo(OutputArray dst, int rtype, Stream& stream) const; @@ -251,7 +255,7 @@ public: //! converts GpuMat to another datatype with scaling (Blocking call) void convertTo(OutputArray dst, int rtype, double alpha, double beta = 0.0) const; //! bindings overload which converts GpuMat to another datatype with scaling(Blocking call) - CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype, double alpha = 1.0, double beta = 0.0) const { + CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype, double alpha, double beta = 0.0) const { convertTo(static_cast(dst), rtype, alpha, beta); } diff --git a/modules/core/src/cuda/gpu_mat.cu b/modules/core/src/cuda/gpu_mat.cu index a86888cac3..b6f95445db 100644 --- a/modules/core/src/cuda/gpu_mat.cu +++ b/modules/core/src/cuda/gpu_mat.cu @@ -546,7 +546,7 @@ void cv::cuda::GpuMat::convertTo(OutputArray _dst, int rtype, Stream& stream) co return; } - CV_DbgAssert( sdepth <= CV_64F && ddepth <= CV_64F ); + CV_Assert( sdepth <= CV_64F && ddepth <= CV_64F ); GpuMat src = *this; @@ -578,6 +578,8 @@ void cv::cuda::GpuMat::convertTo(OutputArray _dst, int rtype, double alpha, doub const int sdepth = depth(); const int ddepth = CV_MAT_DEPTH(rtype); + CV_Assert(sdepth <= CV_64F && ddepth <= CV_64F); + GpuMat src = *this; _dst.create(size(), rtype);