mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 01:13:28 +08:00
Deprecated convertTypeStr and made new variant that also takes the buffer size
This allows removing the unsafe sprintf.
This commit is contained in:
parent
e3e1f704a4
commit
58e4a880a2
@ -697,7 +697,8 @@ protected:
|
||||
Impl* p;
|
||||
};
|
||||
|
||||
CV_EXPORTS const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf);
|
||||
CV_EXPORTS CV_DEPRECATED const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf);
|
||||
CV_EXPORTS const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf, size_t buf_size);
|
||||
CV_EXPORTS const char* typeToStr(int t);
|
||||
CV_EXPORTS const char* memopTypeToStr(int t);
|
||||
CV_EXPORTS const char* vecopTypeToStr(int t);
|
||||
|
@ -500,12 +500,12 @@ static bool ocl_arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(CV_MAKETYPE(wdepth, kercn)),
|
||||
ocl::typeToStr(CV_MAKETYPE(wdepth, scalarcn)),
|
||||
ocl::typeToStr(wdepth), wdepth,
|
||||
ocl::convertTypeStr(depth1, wdepth, kercn, cvtstr[0]),
|
||||
ocl::convertTypeStr(depth2, wdepth, kercn, cvtstr[1]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, kercn, cvtstr[2]),
|
||||
ocl::convertTypeStr(depth1, wdepth, kercn, cvtstr[0], sizeof(cvtstr[0])),
|
||||
ocl::convertTypeStr(depth2, wdepth, kercn, cvtstr[1], sizeof(cvtstr[1])),
|
||||
ocl::convertTypeStr(wdepth, ddepth, kercn, cvtstr[2], sizeof(cvtstr[2])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "", kercn, rowsPerWI,
|
||||
oclop == OCL_OP_ABSDIFF && wdepth == CV_32S && ddepth == wdepth ?
|
||||
ocl::convertTypeStr(CV_8U, ddepth, kercn, cvtstr[3]) : "noconvert");
|
||||
ocl::convertTypeStr(CV_8U, ddepth, kercn, cvtstr[3], sizeof(cvtstr[3])) : "noconvert");
|
||||
|
||||
size_t usrdata_esz = CV_ELEM_SIZE(wdepth);
|
||||
const uchar* usrdata_p = (const uchar*)usrdata;
|
||||
@ -1106,7 +1106,7 @@ static bool ocl_compare(InputArray _src1, InputArray _src2, OutputArray _dst, in
|
||||
haveScalar ? "UNARY_OP" : "BINARY_OP",
|
||||
ocl::typeToStr(CV_MAKE_TYPE(depth1, kercn)),
|
||||
ocl::typeToStr(CV_8UC(kercn)), CV_8U, kercn,
|
||||
ocl::convertTypeStr(depth1, CV_8U, kercn, cvt),
|
||||
ocl::convertTypeStr(depth1, CV_8U, kercn, cvt, sizeof(cvt)),
|
||||
operationMap[op], ocl::typeToStr(depth1),
|
||||
ocl::typeToStr(depth1), ocl::typeToStr(CV_8U),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(depth1, scalarcn)), rowsPerWI,
|
||||
|
@ -59,8 +59,8 @@ static bool ocl_convertScaleAbs( InputArray _src, OutputArray _dst, double alpha
|
||||
ocl::typeToStr(CV_8UC(kercn)), CV_8U,
|
||||
ocl::typeToStr(CV_MAKE_TYPE(depth, kercn)),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, kercn)), wdepth,
|
||||
ocl::convertTypeStr(depth, wdepth, kercn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, CV_8U, kercn, cvt[1]),
|
||||
ocl::convertTypeStr(depth, wdepth, kercn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, CV_8U, kercn, cvt[1], sizeof(cvt[1])),
|
||||
ocl::typeToStr(wdepth), rowsPerWI,
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "");
|
||||
ocl::Kernel k("KF", ocl::core::arithm_oclsrc, build_opt);
|
||||
|
@ -606,8 +606,8 @@ static bool ocl_scaleAdd( InputArray _src1, double alpha, InputArray _src2, Outp
|
||||
" -D wdepth=%d%s -D rowsPerWI=%d",
|
||||
ocl::typeToStr(CV_MAKE_TYPE(depth, kercn)), depth,
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, kercn)),
|
||||
ocl::convertTypeStr(depth, wdepth, kercn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, depth, kercn, cvt[1]),
|
||||
ocl::convertTypeStr(depth, wdepth, kercn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, depth, kercn, cvt[1], sizeof(cvt[1])),
|
||||
ocl::typeToStr(wdepth), wdepth,
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "", rowsPerWI));
|
||||
if (k.empty())
|
||||
@ -1047,7 +1047,7 @@ static bool ocl_dot( InputArray _src1, InputArray _src2, double & res )
|
||||
"-D WGS=%d -D WGS2_ALIGNED=%d%s%s%s -D kercn=%d",
|
||||
ocl::typeToStr(CV_MAKE_TYPE(depth, kercn)), ocl::typeToStr(depth),
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(CV_MAKE_TYPE(ddepth, kercn)),
|
||||
ddepth, ocl::convertTypeStr(depth, ddepth, kercn, cvt),
|
||||
ddepth, ocl::convertTypeStr(depth, ddepth, kercn, cvt, sizeof(cvt)),
|
||||
(int)wgs, wgs2_aligned, doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
_src1.isContinuous() ? " -D HAVE_SRC_CONT" : "",
|
||||
_src2.isContinuous() ? " -D HAVE_SRC2_CONT" : "", kercn));
|
||||
|
@ -642,9 +642,9 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
|
||||
ocl::typeToStr(sdepth),
|
||||
ocl::typeToStr(ddepth),
|
||||
ocl::typeToStr(ddepth0),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0]),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[1]),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[2]),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[1], sizeof(cvt[1])),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[2], sizeof(cvt[2])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "");
|
||||
ocl::Kernel k("reduce_horz_opt", ocl::core::reduce2_oclsrc, build_opt);
|
||||
if (k.empty())
|
||||
@ -673,9 +673,9 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
|
||||
" -D convertToDT=%s -D convertToDT0=%s%s",
|
||||
ops[op], dim, cn, ddepth, ocl::typeToStr(useOptimized ? ddepth : sdepth),
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(ddepth0),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0]),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[1]),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[1], sizeof(cvt[1])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "");
|
||||
|
||||
ocl::Kernel k("reduce", ocl::core::reduce2_oclsrc, build_opt);
|
||||
|
@ -234,10 +234,10 @@ static bool ocl_meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv
|
||||
ocl::typeToStr(type), ocl::typeToStr(depth),
|
||||
ocl::typeToStr(dtype), ocl::typeToStr(ddepth), sqddepth,
|
||||
ocl::typeToStr(sqdtype), ocl::typeToStr(sqddepth),
|
||||
ocl::convertTypeStr(depth, sqddepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(depth, sqddepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
cn, isContinuous ? " -D HAVE_SRC_CONT" : "",
|
||||
isMaskContinuous ? " -D HAVE_MASK_CONT" : "",
|
||||
ocl::convertTypeStr(depth, ddepth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(depth, ddepth, cn, cvt[1], sizeof(cvt[1])),
|
||||
(int)wgs, wgs2_aligned, haveMask ? " -D HAVE_MASK" : "",
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "");
|
||||
|
||||
|
@ -1042,11 +1042,11 @@ bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int* minLoc
|
||||
needMinVal ? " -D NEED_MINVAL" : "", needMaxVal ? " -D NEED_MAXVAL" : "",
|
||||
needMinLoc ? " -D NEED_MINLOC" : "", needMaxLoc ? " -D NEED_MAXLOC" : "",
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(CV_MAKE_TYPE(ddepth, kercn)),
|
||||
ocl::convertTypeStr(depth, ddepth, kercn, cvt[0]),
|
||||
ocl::convertTypeStr(depth, ddepth, kercn, cvt[0], sizeof(cvt[0])),
|
||||
absValues ? " -D OP_ABS" : "",
|
||||
haveSrc2 ? " -D HAVE_SRC2" : "", maxVal2 ? " -D OP_CALC2" : "",
|
||||
haveSrc2 && _src2.isContinuous() ? " -D HAVE_SRC2_CONT" : "", ddepth,
|
||||
depth <= CV_32S && ddepth == CV_32S ? ocl::convertTypeStr(CV_8U, ddepth, kercn, cvt[1]) : "noconvert",
|
||||
depth <= CV_32S && ddepth == CV_32S ? ocl::convertTypeStr(CV_8U, ddepth, kercn, cvt[1], sizeof(cvt[1])) : "noconvert",
|
||||
MINMAX_STRUCT_ALIGNMENT);
|
||||
|
||||
ocl::Kernel k("minmaxloc", ocl::core::minmaxloc_oclsrc, opts);
|
||||
|
@ -1313,8 +1313,8 @@ static bool ocl_normalize( InputArray _src, InputOutputArray _dst, InputArray _m
|
||||
String opts = format("-D srcT=%s -D dstT=%s -D convertToWT=%s -D cn=%d -D rowsPerWI=%d"
|
||||
" -D convertToDT=%s -D workT=%s%s%s%s -D srcT1=%s -D dstT1=%s",
|
||||
ocl::typeToStr(stype), ocl::typeToStr(dtype),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0]), cn,
|
||||
rowsPerWI, ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0], sizeof(cvt[0])), cn,
|
||||
rowsPerWI, ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1], sizeof(cvt[1])),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, cn)),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
haveScale ? " -D HAVE_SCALE" : "",
|
||||
|
@ -7037,11 +7037,17 @@ const char* vecopTypeToStr(int type)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Deprecated due to size of buf buffer being unknowable.
|
||||
const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf)
|
||||
{
|
||||
// Since the size of buf is not given, we assume 50 because that's what all callers use.
|
||||
constexpr size_t buf_max = 50;
|
||||
|
||||
return convertTypeStr(sdepth, ddepth, cn, buf, buf_max);
|
||||
}
|
||||
|
||||
const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf, size_t buf_size)
|
||||
{
|
||||
if( sdepth == ddepth )
|
||||
return "noconvert";
|
||||
const char *typestr = typeToStr(CV_MAKETYPE(ddepth, cn));
|
||||
@ -7050,12 +7056,12 @@ const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf)
|
||||
(ddepth == CV_16S && sdepth <= CV_8S) ||
|
||||
(ddepth == CV_16U && sdepth == CV_8U))
|
||||
{
|
||||
snprintf(buf, buf_max, "convert_%s", typestr);
|
||||
snprintf(buf, buf_size, "convert_%s", typestr);
|
||||
}
|
||||
else if( sdepth >= CV_32F )
|
||||
snprintf(buf, buf_max, "convert_%s%s_rte", typestr, (ddepth < CV_32S ? "_sat" : ""));
|
||||
snprintf(buf, buf_size, "convert_%s%s_rte", typestr, (ddepth < CV_32S ? "_sat" : ""));
|
||||
else
|
||||
snprintf(buf, buf_max, "convert_%s_sat", typestr);
|
||||
snprintf(buf, buf_size, "convert_%s_sat", typestr);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ bool ocl_sum( InputArray _src, Scalar & res, int sum_op, InputArray _mask,
|
||||
ocl::typeToStr(CV_MAKE_TYPE(depth, mcn)), ocl::typeToStr(depth),
|
||||
ocl::typeToStr(dtype), ocl::typeToStr(CV_MAKE_TYPE(ddepth, mcn)),
|
||||
ocl::typeToStr(ddepth), ddepth, cn,
|
||||
ocl::convertTypeStr(depth, ddepth, mcn, cvt[0]),
|
||||
ocl::convertTypeStr(depth, ddepth, mcn, cvt[0], sizeof(cvt[0])),
|
||||
opMap[sum_op], (int)wgs, wgs2_aligned,
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
haveMask ? " -D HAVE_MASK" : "",
|
||||
@ -76,7 +76,7 @@ bool ocl_sum( InputArray _src, Scalar & res, int sum_op, InputArray _mask,
|
||||
haveMask && _mask.isContinuous() ? " -D HAVE_MASK_CONT" : "", kercn,
|
||||
haveSrc2 ? " -D HAVE_SRC2" : "", calc2 ? " -D OP_CALC2" : "",
|
||||
haveSrc2 && _src2.isContinuous() ? " -D HAVE_SRC2_CONT" : "",
|
||||
depth <= CV_32S && ddepth == CV_32S ? ocl::convertTypeStr(CV_8U, ddepth, convert_cn, cvt[1]) : "noconvert");
|
||||
depth <= CV_32S && ddepth == CV_32S ? ocl::convertTypeStr(CV_8U, ddepth, convert_cn, cvt[1], sizeof(cvt[1])) : "noconvert");
|
||||
|
||||
ocl::Kernel k("reduce", ocl::core::reduce_oclsrc, opts);
|
||||
if (k.empty())
|
||||
|
@ -1263,8 +1263,8 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
|
||||
ocl::Kernel k("convertTo", ocl::core::convert_oclsrc,
|
||||
format("-D srcT=%s -D WT=%s -D dstT=%s -D convertToWT=%s -D convertToDT=%s%s%s",
|
||||
ocl::typeToStr(sdepth), ocl::typeToStr(wdepth), ocl::typeToStr(ddepth),
|
||||
ocl::convertTypeStr(sdepth, wdepth, 1, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, 1, cvt[1]),
|
||||
ocl::convertTypeStr(sdepth, wdepth, 1, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth, 1, cvt[1], sizeof(cvt[1])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "", noScale ? " -D NO_SCALE" : ""));
|
||||
if (!k.empty())
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ static bool ocl_accumulate( InputArray _src, InputArray _src2, InputOutputArray
|
||||
opMap[op_type], haveMask ? " -D HAVE_MASK" : "",
|
||||
ocl::typeToStr(sdepth), kercn, ocl::typeToStr(ddepth),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "", rowsPerWI,
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt)));
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt, sizeof(cvt))));
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
||||
|
@ -129,10 +129,10 @@ static bool ocl_bilateralFilter_8u(InputArray _src, OutputArray _dst, int d,
|
||||
format("-D radius=%d -D maxk=%d -D cn=%d -D int_t=%s -D uint_t=uint%s -D convert_int_t=%s"
|
||||
" -D uchar_t=%s -D float_t=%s -D convert_float_t=%s -D convert_uchar_t=%s -D gauss_color_coeff=(float)%f",
|
||||
radius, maxk, cn, ocl::typeToStr(CV_32SC(cn)), cnstr.c_str(),
|
||||
ocl::convertTypeStr(CV_8U, CV_32S, cn, cvt[0]),
|
||||
ocl::convertTypeStr(CV_8U, CV_32S, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::typeToStr(type), ocl::typeToStr(CV_32FC(cn)),
|
||||
ocl::convertTypeStr(CV_32S, CV_32F, cn, cvt[1]),
|
||||
ocl::convertTypeStr(CV_32F, CV_8U, cn, cvt[2]), gauss_color_coeff));
|
||||
ocl::convertTypeStr(CV_32S, CV_32F, cn, cvt[1], sizeof(cvt[1])),
|
||||
ocl::convertTypeStr(CV_32F, CV_8U, cn, cvt[2], sizeof(cvt[2])), gauss_color_coeff));
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
||||
|
@ -353,7 +353,7 @@ static bool ocl_blendLinear( InputArray _src1, InputArray _src2, InputArray _wei
|
||||
char cvt[50];
|
||||
ocl::Kernel k("blendLinear", ocl::imgproc::blend_linear_oclsrc,
|
||||
format("-D T=%s -D cn=%d -D convertToT=%s", ocl::typeToStr(depth),
|
||||
cn, ocl::convertTypeStr(CV_32F, depth, 1, cvt)));
|
||||
cn, ocl::convertTypeStr(CV_32F, depth, 1, cvt, sizeof(cvt))));
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
||||
|
@ -210,8 +210,8 @@ static bool ocl_boxFilter( InputArray _src, OutputArray _dst, int ddepth,
|
||||
privDataWidth / pxLoadNumPixels, pxPerWorkItemY + ksize.height - 1,
|
||||
ocl::typeToStr(type), ocl::typeToStr(sdepth), ocl::typeToStr(dtype),
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(wtype), ocl::typeToStr(wdepth),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1], sizeof(cvt[1])),
|
||||
normalize ? " -D NORMALIZE" : "", sqr ? " -D SQR" : "",
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, pxLoadVecSize)) //PX_LOAD_FLOAT_VEC_CONV
|
||||
);
|
||||
@ -241,8 +241,8 @@ static bool ocl_boxFilter( InputArray _src, OutputArray _dst, int ddepth,
|
||||
" -D ST1=%s -D DT1=%s -D cn=%d",
|
||||
BLOCK_SIZE_X, BLOCK_SIZE_Y, ocl::typeToStr(type), ocl::typeToStr(CV_MAKE_TYPE(ddepth, cn)),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, cn)),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[1], sizeof(cvt[1])),
|
||||
anchor.x, anchor.y, ksize.width, ksize.height, borderMap[borderType],
|
||||
isolated ? " -D BORDER_ISOLATED" : "", doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
normalize ? " -D NORMALIZE" : "", sqr ? " -D SQR" : "",
|
||||
|
@ -187,7 +187,7 @@ static bool ocl_Canny(InputArray _src, const UMat& dx_, const UMat& dy_, OutputA
|
||||
ocl::Kernel with_sobel("stage1_with_sobel", ocl::imgproc::canny_oclsrc,
|
||||
format("-D WITH_SOBEL -D cn=%d -D TYPE=%s -D convert_floatN=%s -D floatN=%s -D GRP_SIZEX=%d -D GRP_SIZEY=%d%s",
|
||||
cn, ocl::memopTypeToStr(_src.depth()),
|
||||
ocl::convertTypeStr(_src.depth(), CV_32F, cn, cvt),
|
||||
ocl::convertTypeStr(_src.depth(), CV_32F, cn, cvt, sizeof(cvt)),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(CV_32F, cn)),
|
||||
lSizeX, lSizeY,
|
||||
L2gradient ? " -D L2GRAD" : ""));
|
||||
|
@ -590,8 +590,8 @@ static bool ocl_Laplacian5(InputArray _src, OutputArray _dst,
|
||||
(int)lt2[0], (int)lt2[1], kernelX.cols / 2,
|
||||
ocl::kernelToStr(kernelX, wdepth, "KERNEL_MATRIX_X").c_str(),
|
||||
ocl::kernelToStr(kernelY, wdepth, "KERNEL_MATRIX_Y").c_str(),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1], sizeof(cvt[1])),
|
||||
borderMap[borderType],
|
||||
ocl::typeToStr(sdepth), ocl::typeToStr(ddepth), ocl::typeToStr(wdepth),
|
||||
ocl::typeToStr(CV_MAKETYPE(sdepth, cn)),
|
||||
@ -633,8 +633,8 @@ static bool ocl_Laplacian5(InputArray _src, OutputArray _dst,
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, kercn)),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(ddepth, kercn)),
|
||||
ocl::typeToStr(wdepth), wdepth,
|
||||
ocl::convertTypeStr(depth, wdepth, kercn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, kercn, cvt[1]),
|
||||
ocl::convertTypeStr(depth, wdepth, kercn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth, kercn, cvt[1], sizeof(cvt[1])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : ""));
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
@ -651,8 +651,8 @@ static bool ocl_filter2D( InputArray _src, OutputArray _dst, int ddepth,
|
||||
privDataWidth / pxLoadNumPixels, pxPerWorkItemY + ksize.height - 1,
|
||||
ocl::typeToStr(type), ocl::typeToStr(sdepth), ocl::typeToStr(dtype),
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(wtype), ocl::typeToStr(wdepth),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1]), kerStr.c_str());
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1], sizeof(cvt[1])), kerStr.c_str());
|
||||
|
||||
if (!k.create("filter2DSmall", cv::ocl::imgproc::filter2DSmall_oclsrc, build_options))
|
||||
return false;
|
||||
@ -696,8 +696,8 @@ static bool ocl_filter2D( InputArray _src, OutputArray _dst, int ddepth,
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "", kerStr.c_str(),
|
||||
ocl::typeToStr(type), ocl::typeToStr(sdepth), ocl::typeToStr(dtype),
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(wtype), ocl::typeToStr(wdepth),
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1]));
|
||||
ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1], sizeof(cvt[1])));
|
||||
|
||||
localsize[0] = BLOCK_SIZE;
|
||||
globalsize[0] = DIVUP(sz.width, BLOCK_SIZE - (ksize.width - 1)) * BLOCK_SIZE;
|
||||
@ -771,7 +771,7 @@ static bool ocl_sepRowFilter2D(const UMat & src, UMat & buf, const Mat & kernelX
|
||||
extra_extrapolation ? "EXTRA_EXTRAPOLATION" : "NO_EXTRA_EXTRAPOLATION",
|
||||
isolated ? "BORDER_ISOLATED" : "NO_BORDER_ISOLATED",
|
||||
ocl::typeToStr(type), ocl::typeToStr(buf_type),
|
||||
ocl::convertTypeStr(sdepth, bdepth, cn, cvt),
|
||||
ocl::convertTypeStr(sdepth, bdepth, cn, cvt, sizeof(cvt)),
|
||||
ocl::typeToStr(sdepth), ocl::typeToStr(bdepth),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
int_arithm ? " -D INTEGER_ARITHMETIC" : "");
|
||||
@ -832,9 +832,9 @@ static bool ocl_sepColFilter2D(const UMat & buf, UMat & dst, const Mat & kernelY
|
||||
" -D srcT1=%s -D dstT1=%s -D SHIFT_BITS=%d%s%s",
|
||||
anchor, (int)localsize[0], (int)localsize[1], cn,
|
||||
ocl::typeToStr(buf_type), ocl::typeToStr(dtype),
|
||||
ocl::convertTypeStr(bdepth, floatT, cn, cvt[0]),
|
||||
ocl::convertTypeStr(bdepth, floatT, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::typeToStr(CV_MAKETYPE(floatT, cn)),
|
||||
ocl::convertTypeStr(shift_bits ? floatT : bdepth, ddepth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(shift_bits ? floatT : bdepth, ddepth, cn, cvt[1], sizeof(cvt[1])),
|
||||
ocl::typeToStr(bdepth), ocl::typeToStr(ddepth),
|
||||
2*shift_bits, doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
int_arithm ? " -D INTEGER_ARITHMETIC" : "");
|
||||
@ -901,9 +901,9 @@ static bool ocl_sepFilter2D_SinglePass(InputArray _src, OutputArray _dst,
|
||||
(int)lt2[0], (int)lt2[1], kernelX.cols / 2, kernelY.cols / 2,
|
||||
ocl::kernelToStr(kernelX, wdepth, "KERNEL_MATRIX_X").c_str(),
|
||||
ocl::kernelToStr(kernelY, wdepth, "KERNEL_MATRIX_Y").c_str(),
|
||||
ocl::typeToStr(stype), ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0]),
|
||||
ocl::typeToStr(stype), ocl::convertTypeStr(sdepth, wdepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, cn)), ocl::typeToStr(dtype),
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1]), borderMap[borderType],
|
||||
ocl::convertTypeStr(wdepth, ddepth, cn, cvt[1], sizeof(cvt[1])), borderMap[borderType],
|
||||
ocl::typeToStr(sdepth), ocl::typeToStr(ddepth), ocl::typeToStr(wdepth),
|
||||
cn, 2*shift_bits, int_arithm ? " -D INTEGER_ARITHMETIC" : "");
|
||||
|
||||
|
@ -1235,7 +1235,7 @@ static bool ocl_calcHist1(InputArray _src, OutputArray _hist, int ddepth = CV_32
|
||||
char cvt[50];
|
||||
ocl::Kernel k2("merge_histogram", ocl::imgproc::histogram_oclsrc,
|
||||
format("-D BINS=%d -D HISTS_COUNT=%d -D WGS=%d -D convertToHT=%s -D HT=%s",
|
||||
BINS, compunits, (int)wgs, ocl::convertTypeStr(CV_32S, ddepth, 1, cvt),
|
||||
BINS, compunits, (int)wgs, ocl::convertTypeStr(CV_32S, ddepth, 1, cvt, sizeof(cvt)),
|
||||
ocl::typeToStr(ddepth)));
|
||||
if (k2.empty())
|
||||
return false;
|
||||
|
@ -1346,9 +1346,9 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input
|
||||
+ format(" -D WT=%s -D convertToT=%s -D convertToWT=%s"
|
||||
" -D convertToWT2=%s -D WT2=%s",
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, cn)),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(CV_32S, wdepth, 2, cvt[2]),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[1], sizeof(cvt[1])),
|
||||
ocl::convertTypeStr(CV_32S, wdepth, 2, cvt[2], sizeof(cvt[2])),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, 2)));
|
||||
}
|
||||
int scalarcn = cn == 3 ? 4 : cn;
|
||||
@ -2490,8 +2490,8 @@ static bool ocl_warpTransform(InputArray _src, OutputArray _dst, InputArray _M0,
|
||||
ocl::typeToStr(CV_MAT_DEPTH(type)),
|
||||
ocl::typeToStr(sctype),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(wdepth, cn)), depth,
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, cvt[1], sizeof(cvt[1])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
useDouble ? "double" : "float",
|
||||
cn, rowsPerWI);
|
||||
|
@ -692,8 +692,8 @@ static bool ocl_morphSmall( InputArray _src, OutputArray _dst, InputArray _kerne
|
||||
ocl::typeToStr(type), ocl::typeToStr(depth),
|
||||
haveExtraMat ? ocl::typeToStr(wtype):"srcT",//to prevent overflow - WT
|
||||
haveExtraMat ? ocl::typeToStr(wdepth):"srcT1",//to prevent overflow - WT1
|
||||
haveExtraMat ? ocl::convertTypeStr(depth, wdepth, cn, cvt[0]) : "noconvert",//to prevent overflow - src to WT
|
||||
haveExtraMat ? ocl::convertTypeStr(wdepth, depth, cn, cvt[1]) : "noconvert",//to prevent overflow - WT to dst
|
||||
haveExtraMat ? ocl::convertTypeStr(depth, wdepth, cn, cvt[0], sizeof(cvt[0])) : "noconvert",//to prevent overflow - src to WT
|
||||
haveExtraMat ? ocl::convertTypeStr(wdepth, depth, cn, cvt[1], sizeof(cvt[1])) : "noconvert",//to prevent overflow - WT to dst
|
||||
ocl::typeToStr(CV_MAKE_TYPE(haveExtraMat ? wdepth : depth, pxLoadVecSize)), //PX_LOAD_FLOAT_VEC_CONV
|
||||
processing.c_str(), op2str[op],
|
||||
actual_op == op ? "" : cv::format(" -D %s", op2str[actual_op]).c_str());
|
||||
@ -853,8 +853,8 @@ static bool ocl_morphOp(InputArray _src, OutputArray _dst, InputArray _kernel,
|
||||
anchor.x, anchor.y, (int)localThreads[0], (int)localThreads[1], op2str[op],
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "", processing.c_str(),
|
||||
ocl::typeToStr(type), depth, cn, ocl::typeToStr(depth),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, cvt[1], sizeof(cvt[1])),
|
||||
ocl::typeToStr(CV_MAKE_TYPE(depth, scalarcn)),
|
||||
current_op == op ? "" : cv::format(" -D %s", op2str[current_op]).c_str());
|
||||
|
||||
|
@ -1170,8 +1170,8 @@ static bool ocl_pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz, in
|
||||
"-D T=%s -D FT=%s -D convertToT=%s -D convertToFT=%s%s "
|
||||
"-D T1=%s -D cn=%d -D kercn=%d -D fdepth=%d -D %s -D LOCAL_SIZE=%d",
|
||||
ocl::typeToStr(type), ocl::typeToStr(CV_MAKETYPE(float_depth, cn)),
|
||||
ocl::convertTypeStr(float_depth, depth, cn, cvt[0]),
|
||||
ocl::convertTypeStr(depth, float_depth, cn, cvt[1]),
|
||||
ocl::convertTypeStr(float_depth, depth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(depth, float_depth, cn, cvt[1], sizeof(cvt[1])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "", ocl::typeToStr(depth),
|
||||
cn, kercn, float_depth, borderMap[borderType], local_size
|
||||
);
|
||||
@ -1213,8 +1213,8 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int
|
||||
"-D T=%s -D FT=%s -D convertToT=%s -D convertToFT=%s%s "
|
||||
"-D T1=%s -D cn=%d -D LOCAL_SIZE=%d",
|
||||
ocl::typeToStr(type), ocl::typeToStr(CV_MAKETYPE(float_depth, channels)),
|
||||
ocl::convertTypeStr(float_depth, depth, channels, cvt[0]),
|
||||
ocl::convertTypeStr(depth, float_depth, channels, cvt[1]),
|
||||
ocl::convertTypeStr(float_depth, depth, channels, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(depth, float_depth, channels, cvt[1], sizeof(cvt[1])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
ocl::typeToStr(depth), channels, local_size
|
||||
);
|
||||
|
@ -3309,7 +3309,7 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
cv::String compileOpts = format("-D USE_SAMPLER -D depth=%d -D T=%s -D T1=%s "
|
||||
"-D convertToDT=%s -D cn=%d",
|
||||
depth, ocl::typeToStr(type), ocl::typeToStr(depth),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, buf[1]),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, buf[1], sizeof(buf[1])),
|
||||
cn);
|
||||
k.create("resizeSampler", ocl::imgproc::resize_oclsrc, compileOpts);
|
||||
|
||||
@ -3375,8 +3375,8 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
"-D WT=%s -D convertToWT=%s -D convertToDT=%s -D cn=%d "
|
||||
"-D INTER_RESIZE_COEF_BITS=%d",
|
||||
depth, ocl::typeToStr(type), ocl::typeToStr(depth), ocl::typeToStr(wtype),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, buf[0]),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, buf[1]),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, buf[0], sizeof(buf[0])),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, buf[1], sizeof(buf[1])),
|
||||
cn, INTER_RESIZE_COEF_BITS));
|
||||
if (k.empty())
|
||||
return false;
|
||||
@ -3393,8 +3393,8 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
"-D WT=%s -D convertToWT=%s -D convertToDT=%s -D cn=%d "
|
||||
"-D INTER_RESIZE_COEF_BITS=%d",
|
||||
depth, ocl::typeToStr(type), ocl::typeToStr(depth), ocl::typeToStr(wtype),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, buf[0]),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, buf[1]),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, buf[0], sizeof(buf[0])),
|
||||
ocl::convertTypeStr(wdepth, depth, cn, buf[1], sizeof(buf[1])),
|
||||
cn, INTER_RESIZE_COEF_BITS));
|
||||
if (k.empty())
|
||||
return false;
|
||||
@ -3422,7 +3422,7 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
char cvt[2][50];
|
||||
String buildOption = format("-D INTER_AREA -D T=%s -D T1=%s -D WTV=%s -D convertToWTV=%s -D cn=%d",
|
||||
ocl::typeToStr(type), ocl::typeToStr(depth), ocl::typeToStr(wtype),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[0]), cn);
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt[0], sizeof(cvt[0])), cn);
|
||||
|
||||
UMat alphaOcl, tabofsOcl, mapOcl;
|
||||
UMat dmap, smap;
|
||||
@ -3432,8 +3432,8 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
int wdepth2 = std::max(CV_32F, depth), wtype2 = CV_MAKE_TYPE(wdepth2, cn);
|
||||
buildOption = buildOption + format(" -D convertToT=%s -D WT2V=%s -D convertToWT2V=%s -D INTER_AREA_FAST"
|
||||
" -D XSCALE=%d -D YSCALE=%d -D SCALE=%ff",
|
||||
ocl::convertTypeStr(wdepth2, depth, cn, cvt[0]),
|
||||
ocl::typeToStr(wtype2), ocl::convertTypeStr(wdepth, wdepth2, cn, cvt[1]),
|
||||
ocl::convertTypeStr(wdepth2, depth, cn, cvt[0], sizeof(cvt[0])),
|
||||
ocl::typeToStr(wtype2), ocl::convertTypeStr(wdepth, wdepth2, cn, cvt[1], sizeof(cvt[1])),
|
||||
iscale_x, iscale_y, 1.0f / (iscale_x * iscale_y));
|
||||
|
||||
k.create("resizeAREA_FAST", ocl::imgproc::resize_oclsrc, buildOption);
|
||||
@ -3442,7 +3442,7 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
}
|
||||
else
|
||||
{
|
||||
buildOption = buildOption + format(" -D convertToT=%s", ocl::convertTypeStr(wdepth, depth, cn, cvt[0]));
|
||||
buildOption = buildOption + format(" -D convertToT=%s", ocl::convertTypeStr(wdepth, depth, cn, cvt[0], sizeof(cvt[0])));
|
||||
k.create("resizeAREA", ocl::imgproc::resize_oclsrc, buildOption);
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
@ -91,7 +91,7 @@ static bool sumTemplate(InputArray _src, UMat & result)
|
||||
ocl::Kernel k("calcSum", ocl::imgproc::match_template_oclsrc,
|
||||
format("-D CALC_SUM -D T=%s -D T1=%s -D WT=%s -D cn=%d -D convertToWT=%s -D WGS=%d -D WGS2_ALIGNED=%d",
|
||||
ocl::typeToStr(type), ocl::typeToStr(depth), ocl::typeToStr(wtype), cn,
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt),
|
||||
ocl::convertTypeStr(depth, wdepth, cn, cvt, sizeof(cvt)),
|
||||
(int)wgs, wgs2_aligned));
|
||||
if (k.empty())
|
||||
return false;
|
||||
@ -270,8 +270,8 @@ static bool matchTemplateNaive_CCORR(InputArray _image, InputArray _templ, Outpu
|
||||
|
||||
char cvt[50];
|
||||
char cvt1[50];
|
||||
const char* convertToWT1 = ocl::convertTypeStr(depth, wdepth, cn, cvt);
|
||||
const char* convertToWT = ocl::convertTypeStr(depth, wdepth, rated_cn, cvt1);
|
||||
const char* convertToWT1 = ocl::convertTypeStr(depth, wdepth, cn, cvt, sizeof(cvt));
|
||||
const char* convertToWT = ocl::convertTypeStr(depth, wdepth, rated_cn, cvt1, sizeof(cvt1));
|
||||
|
||||
ocl::Kernel k("matchTemplate_Naive_CCORR", ocl::imgproc::match_template_oclsrc,
|
||||
format("-D CCORR -D T=%s -D T1=%s -D WT=%s -D WT1=%s -D convertToWT=%s -D convertToWT1=%s -D cn=%d -D PIX_PER_WI_X=%d", ocl::typeToStr(type), ocl::typeToStr(depth), ocl::typeToStr(wtype1), ocl::typeToStr(wtype),
|
||||
@ -352,7 +352,7 @@ static bool matchTemplateNaive_SQDIFF(InputArray _image, InputArray _templ, Outp
|
||||
char cvt[50];
|
||||
ocl::Kernel k("matchTemplate_Naive_SQDIFF", ocl::imgproc::match_template_oclsrc,
|
||||
format("-D SQDIFF -D T=%s -D T1=%s -D WT=%s -D convertToWT=%s -D cn=%d", ocl::typeToStr(type), ocl::typeToStr(depth),
|
||||
ocl::typeToStr(wtype), ocl::convertTypeStr(depth, wdepth, cn, cvt), cn));
|
||||
ocl::typeToStr(wtype), ocl::convertTypeStr(depth, wdepth, cn, cvt, sizeof(cvt)), cn));
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
||||
|
@ -62,7 +62,7 @@ static bool ocl_calcAlmostDist2Weight(UMat & almostDist2Weight,
|
||||
format("-D OP_CALC_WEIGHTS -D FT=%s -D w_t=%s"
|
||||
" -D wlut_t=%s -D convert_wlut_t=%s%s%s",
|
||||
ocl::typeToStr(depth), ocl::typeToStr(CV_MAKE_TYPE(depth, hn)),
|
||||
ocl::typeToStr(CV_32SC(hn)), ocl::convertTypeStr(depth, CV_32S, hn, buf),
|
||||
ocl::typeToStr(CV_32SC(hn)), ocl::convertTypeStr(depth, CV_32S, hn, buf, sizeof(buf)),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "",
|
||||
normType == NORM_L1 ? " -D ABS" : ""));
|
||||
if (k.empty())
|
||||
@ -107,17 +107,17 @@ static bool ocl_fastNlMeansDenoising(InputArray _src, OutputArray _dst, const fl
|
||||
ocl::typeToStr(CV_32SC(hn)),
|
||||
depth == CV_8U ? ocl::typeToStr(CV_32SC(hn)) :
|
||||
format("long%s", hn > 1 ? format("%d", hn).c_str() : "").c_str(),
|
||||
depth == CV_8U ? ocl::convertTypeStr(CV_32S, CV_32S, hn, buf[0]) :
|
||||
depth == CV_8U ? ocl::convertTypeStr(CV_32S, CV_32S, hn, buf[0], sizeof(buf[0])) :
|
||||
format("convert_long%s", hn > 1 ? format("%d", hn).c_str() : "").c_str(),
|
||||
depth == CV_8U ? ocl::typeToStr(CV_32SC(cn)) :
|
||||
format("long%s", cn > 1 ? format("%d", cn).c_str() : "").c_str(),
|
||||
depth == CV_8U ? ocl::convertTypeStr(depth, CV_32S, cn, buf[1]) :
|
||||
depth == CV_8U ? ocl::convertTypeStr(depth, CV_32S, cn, buf[1], sizeof(buf[1])) :
|
||||
format("convert_long%s", cn > 1 ? format("%d", cn).c_str() : "").c_str(),
|
||||
BLOCK_COLS, BLOCK_ROWS,
|
||||
ctaSize, templateWindowHalfWize, searchWindowHalfSize,
|
||||
ocl::convertTypeStr(depth, CV_32S, cn, buf[2]), cn,
|
||||
ocl::convertTypeStr(depth, CV_32S, cn, buf[2], sizeof(buf[2])), cn,
|
||||
psz,
|
||||
ocl::convertTypeStr(CV_32S, depth, cn, buf[3]),
|
||||
ocl::convertTypeStr(CV_32S, depth, cn, buf[3], sizeof(buf[3])),
|
||||
normType == NORM_L1 ? " -D ABS" : "");
|
||||
|
||||
ocl::Kernel k("fastNlMeansDenoising", ocl::photo::nlmeans_oclsrc, opts);
|
||||
|
Loading…
Reference in New Issue
Block a user