typename SelectIf<TypesEquals<T, float>::value, float, int>::type
>::type work_type;
- GpuMat_<T> src(_src);
- GpuMat_<work_type> buf(_buf);
+ const GpuMat_<T>& src = (const GpuMat_<T>&) _src;
+ GpuMat_<work_type>& buf = (GpuMat_<work_type>&) _buf;
if (mask.empty())
gridFindMinMaxVal(src, buf);
CV_Assert( src.channels() == 1 );
CV_DbgAssert( mask.empty() || (mask.size() == src.size() && mask.type() == CV_8U) );
- const int depth = src.depth();
-
- const int work_type = depth == CV_64F ? CV_64F : depth == CV_32F ? CV_32F : CV_32S;
- ensureSizeIsEnough(1, 2, work_type, buf);
-
const func_t func = funcs[src.depth()];
func(src, mask, buf, minVal, maxVal);
typedef typename MakeVec<T, cn>::type src_type;
typedef typename MakeVec<R, cn>::type res_type;
- GpuMat_<src_type> src(_src);
- GpuMat_<res_type> buf(_buf);
+ const GpuMat_<src_type>& src = (const GpuMat_<src_type>&) _src;
+ GpuMat_<res_type>& buf = (GpuMat_<res_type>&) _buf;
if (mask.empty())
gridCalcSum(src, buf);
typedef typename MakeVec<T, cn>::type src_type;
typedef typename MakeVec<R, cn>::type res_type;
- GpuMat_<src_type> src(_src);
- GpuMat_<res_type> buf(_buf);
+ const GpuMat_<src_type>& src = (const GpuMat_<src_type>&) _src;
+ GpuMat_<res_type>& buf = (GpuMat_<res_type>&) _buf;
if (mask.empty())
gridCalcSum(abs_(cvt_<res_type>(src)), buf);
typedef typename MakeVec<T, cn>::type src_type;
typedef typename MakeVec<R, cn>::type res_type;
- GpuMat_<src_type> src(_src);
- GpuMat_<res_type> buf(_buf);
+ const GpuMat_<src_type>& src = (const GpuMat_<src_type>&) _src;
+ GpuMat_<res_type>& buf = (GpuMat_<res_type>&) _buf;
if (mask.empty())
gridCalcSum(sqr_(cvt_<res_type>(src)), buf);
CV_DbgAssert( mask.empty() || (mask.type() == CV_8UC1 && mask.size() == src.size()) );
- const int res_depth = std::max(src.depth(), CV_32F);
- cv::cuda::ensureSizeIsEnough(1, 1, CV_MAKE_TYPE(res_depth, src.channels()), buf);
-
const func_t func = funcs[src.depth()][src.channels() - 1];
return func(src, mask, buf);
CV_DbgAssert( mask.empty() || (mask.type() == CV_8UC1 && mask.size() == src.size()) );
- const int res_depth = std::max(src.depth(), CV_32F);
- cv::cuda::ensureSizeIsEnough(1, 1, CV_MAKE_TYPE(res_depth, src.channels()), buf);
-
const func_t func = funcs[src.depth()][src.channels() - 1];
return func(src, mask, buf);
CV_DbgAssert( mask.empty() || (mask.type() == CV_8UC1 && mask.size() == src.size()) );
- const int res_depth = CV_64F;
- cv::cuda::ensureSizeIsEnough(1, 1, CV_MAKE_TYPE(res_depth, src.channels()), buf);
-
const func_t func = funcs[src.depth()][src.channels() - 1];
return func(src, mask, buf);