1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Instrumentation for OpenCV API regions and IPP functions;

This commit is contained in:
Pavel Vlasov
2016-08-18 09:53:00 +03:00
parent 680ca88ce0
commit 30a6cee2fe
133 changed files with 1691 additions and 456 deletions
+63 -47
View File
@@ -1869,6 +1869,8 @@ namespace cv
{
static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _mask)
{
CV_INSTRUMENT_REGION_IPP()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype);
@@ -1876,28 +1878,28 @@ static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _m
if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && (mask.empty() || mask.isContinuous())))
{
typedef IppStatus (CV_STDCALL * ippiAdd)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize);
typedef IppStatus (CV_STDCALL * ippiAddMask)(const void * pSrc, int srcStep, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst,
typedef IppStatus (CV_STDCALL * IppiAdd)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize);
typedef IppStatus (CV_STDCALL * IppiAddMask)(const void * pSrc, int srcStep, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst,
int srcDstStep, IppiSize roiSize);
ippiAdd ippFunc = 0;
ippiAddMask ippFuncMask = 0;
IppiAdd ippiAdd_I = 0;
IppiAddMask ippiAdd_IM = 0;
if (mask.empty())
{
CV_SUPPRESS_DEPRECATED_START
ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAdd)ippiAdd_8u32f_C1IR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAdd)ippiAdd_16u32f_C1IR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAdd)ippiAdd_32f_C1IR : 0;
ippiAdd_I = sdepth == CV_8U && ddepth == CV_32F ? (IppiAdd)ippiAdd_8u32f_C1IR :
sdepth == CV_16U && ddepth == CV_32F ? (IppiAdd)ippiAdd_16u32f_C1IR :
sdepth == CV_32F && ddepth == CV_32F ? (IppiAdd)ippiAdd_32f_C1IR : 0;
CV_SUPPRESS_DEPRECATED_END
}
else if (scn == 1)
{
ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddMask)ippiAdd_8u32f_C1IMR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAddMask)ippiAdd_16u32f_C1IMR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAddMask)ippiAdd_32f_C1IMR : 0;
ippiAdd_IM = sdepth == CV_8U && ddepth == CV_32F ? (IppiAddMask)ippiAdd_8u32f_C1IMR :
sdepth == CV_16U && ddepth == CV_32F ? (IppiAddMask)ippiAdd_16u32f_C1IMR :
sdepth == CV_32F && ddepth == CV_32F ? (IppiAddMask)ippiAdd_32f_C1IMR : 0;
}
if (ippFunc || ippFuncMask)
if (ippiAdd_I || ippiAdd_IM)
{
IppStatus status = ippStsErr;
@@ -1913,11 +1915,11 @@ static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _m
}
size.width *= scn;
if (ippFunc)
status = ippFunc(src.ptr(), srcstep, dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
else if(ippFuncMask)
status = ippFuncMask(src.ptr(), srcstep, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
if (ippiAdd_I)
status = CV_INSTRUMENT_FUN_IPP(ippiAdd_I, src.ptr(), srcstep, dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
else if (ippiAdd_IM)
status = CV_INSTRUMENT_FUN_IPP(ippiAdd_IM, src.ptr(), srcstep, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
if (status >= 0)
return true;
@@ -1930,6 +1932,8 @@ static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _m
void cv::accumulate( InputArray _src, InputOutputArray _dst, InputArray _mask )
{
CV_INSTRUMENT_REGION()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype);
@@ -1963,6 +1967,8 @@ namespace cv
{
static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputArray _mask)
{
CV_INSTRUMENT_REGION_IPP()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype);
@@ -1973,23 +1979,23 @@ static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputA
typedef IppStatus (CV_STDCALL * ippiAddSquare)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize);
typedef IppStatus (CV_STDCALL * ippiAddSquareMask)(const void * pSrc, int srcStep, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst,
int srcDstStep, IppiSize roiSize);
ippiAddSquare ippFunc = 0;
ippiAddSquareMask ippFuncMask = 0;
ippiAddSquare ippiAddSquare_I = 0;
ippiAddSquareMask ippiAddSquare_IM = 0;
if (mask.empty())
{
ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_8u32f_C1IR :
ippiAddSquare_I = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_8u32f_C1IR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_16u32f_C1IR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_32f_C1IR : 0;
}
else if (scn == 1)
{
ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_8u32f_C1IMR :
ippiAddSquare_IM = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_8u32f_C1IMR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_16u32f_C1IMR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_32f_C1IMR : 0;
}
if (ippFunc || ippFuncMask)
if (ippiAddSquare_I || ippiAddSquare_IM)
{
IppStatus status = ippStsErr;
@@ -2005,11 +2011,11 @@ static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputA
}
size.width *= scn;
if (ippFunc)
status = ippFunc(src.ptr(), srcstep, dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
else if(ippFuncMask)
status = ippFuncMask(src.ptr(), srcstep, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
if (ippiAddSquare_I)
status = CV_INSTRUMENT_FUN_IPP(ippiAddSquare_I, src.ptr(), srcstep, dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
else if (ippiAddSquare_IM)
status = CV_INSTRUMENT_FUN_IPP(ippiAddSquare_IM, src.ptr(), srcstep, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
if (status >= 0)
return true;
@@ -2022,6 +2028,8 @@ static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputA
void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _mask )
{
CV_INSTRUMENT_REGION()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype);
@@ -2055,6 +2063,8 @@ namespace cv
static bool ipp_accumulate_product(InputArray _src1, InputArray _src2,
InputOutputArray _dst, InputArray _mask)
{
CV_INSTRUMENT_REGION_IPP()
int stype = _src1.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype);
@@ -2066,23 +2076,23 @@ static bool ipp_accumulate_product(InputArray _src1, InputArray _src2,
int src2Step, Ipp32f * pSrcDst, int srcDstStep, IppiSize roiSize);
typedef IppStatus (CV_STDCALL * ippiAddProductMask)(const void * pSrc1, int src1Step, const void * pSrc2, int src2Step,
const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst, int srcDstStep, IppiSize roiSize);
ippiAddProduct ippFunc = 0;
ippiAddProductMask ippFuncMask = 0;
ippiAddProduct ippiAddProduct_I = 0;
ippiAddProductMask ippiAddProduct_IM = 0;
if (mask.empty())
{
ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_8u32f_C1IR :
ippiAddProduct_I = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_8u32f_C1IR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_16u32f_C1IR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_32f_C1IR : 0;
}
else if (scn == 1)
{
ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_8u32f_C1IMR :
ippiAddProduct_IM = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_8u32f_C1IMR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_16u32f_C1IMR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_32f_C1IMR : 0;
}
if (ippFunc || ippFuncMask)
if (ippiAddProduct_I || ippiAddProduct_IM)
{
IppStatus status = ippStsErr;
@@ -2099,12 +2109,12 @@ static bool ipp_accumulate_product(InputArray _src1, InputArray _src2,
}
size.width *= scn;
if (ippFunc)
status = ippFunc(src1.ptr(), src1step, src2.ptr(), src2step, dst.ptr<Ipp32f>(),
dststep, ippiSize(size.width, size.height));
else if(ippFuncMask)
status = ippFuncMask(src1.ptr(), src1step, src2.ptr(), src2step, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
if (ippiAddProduct_I)
status = CV_INSTRUMENT_FUN_IPP(ippiAddProduct_I, src1.ptr(), src1step, src2.ptr(), src2step, dst.ptr<Ipp32f>(),
dststep, ippiSize(size.width, size.height));
else if (ippiAddProduct_IM)
status = CV_INSTRUMENT_FUN_IPP(ippiAddProduct_IM, src1.ptr(), src1step, src2.ptr(), src2step, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height));
if (status >= 0)
return true;
@@ -2120,6 +2130,8 @@ static bool ipp_accumulate_product(InputArray _src1, InputArray _src2,
void cv::accumulateProduct( InputArray _src1, InputArray _src2,
InputOutputArray _dst, InputArray _mask )
{
CV_INSTRUMENT_REGION()
int stype = _src1.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype);
@@ -2154,6 +2166,8 @@ namespace cv
static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst,
double alpha, InputArray _mask )
{
CV_INSTRUMENT_REGION_IPP()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype);
@@ -2166,23 +2180,23 @@ static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst,
typedef IppStatus (CV_STDCALL * ippiAddWeightedMask)(const void * pSrc, int srcStep, const Ipp8u * pMask,
int maskStep, Ipp32f * pSrcDst,
int srcDstStep, IppiSize roiSize, Ipp32f alpha);
ippiAddWeighted ippFunc = 0;
ippiAddWeightedMask ippFuncMask = 0;
ippiAddWeighted ippiAddWeighted_I = 0;
ippiAddWeightedMask ippiAddWeighted_IM = 0;
if (mask.empty())
{
ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_8u32f_C1IR :
ippiAddWeighted_I = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_8u32f_C1IR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_16u32f_C1IR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_32f_C1IR : 0;
}
else if (scn == 1)
{
ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_8u32f_C1IMR :
ippiAddWeighted_IM = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_8u32f_C1IMR :
sdepth == CV_16U && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_16u32f_C1IMR :
sdepth == CV_32F && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_32f_C1IMR : 0;
}
if (ippFunc || ippFuncMask)
if (ippiAddWeighted_I || ippiAddWeighted_IM)
{
IppStatus status = ippStsErr;
@@ -2198,11 +2212,11 @@ static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst,
}
size.width *= scn;
if (ippFunc)
status = ippFunc(src.ptr(), srcstep, dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha);
else if(ippFuncMask)
status = ippFuncMask(src.ptr(), srcstep, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha);
if (ippiAddWeighted_I)
status = CV_INSTRUMENT_FUN_IPP(ippiAddWeighted_I, src.ptr(), srcstep, dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha);
else if (ippiAddWeighted_IM)
status = CV_INSTRUMENT_FUN_IPP(ippiAddWeighted_IM, src.ptr(), srcstep, mask.ptr<Ipp8u>(), maskstep,
dst.ptr<Ipp32f>(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha);
if (status >= 0)
return true;
@@ -2216,6 +2230,8 @@ static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst,
void cv::accumulateWeighted( InputArray _src, InputOutputArray _dst,
double alpha, InputArray _mask )
{
CV_INSTRUMENT_REGION()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype);
+2
View File
@@ -674,6 +674,8 @@ approxPolyDP_( const Point_<T>* src_contour, int count0, Point_<T>* dst_contour,
void cv::approxPolyDP( InputArray _curve, OutputArray _approxCurve,
double epsilon, bool closed )
{
CV_INSTRUMENT_REGION()
Mat curve = _curve.getMat();
int npoints = curve.checkVector(2), depth = curve.depth();
CV_Assert( npoints >= 0 && (depth == CV_32S || depth == CV_32F));
+2
View File
@@ -121,6 +121,8 @@ static bool ocl_blendLinear( InputArray _src1, InputArray _src2, InputArray _wei
void cv::blendLinear( InputArray _src1, InputArray _src2, InputArray _weights1, InputArray _weights2, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
int type = _src1.type(), depth = CV_MAT_DEPTH(type);
Size size = _src1.size();
+7 -3
View File
@@ -66,6 +66,8 @@ static void CannyImpl(Mat& dx_, Mat& dy_, Mat& _dst, double low_thresh, double h
template <bool useCustomDeriv>
static bool ippCanny(const Mat& _src, const Mat& dx_, const Mat& dy_, Mat& _dst, float low, float high)
{
CV_INSTRUMENT_REGION_IPP()
#if USE_IPP_CANNY
int size = 0, size1 = 0;
IppiSize roi = { _src.cols, _src.rows };
@@ -98,13 +100,13 @@ static bool ippCanny(const Mat& _src, const Mat& dx_, const Mat& dy_, Mat& _dst,
if (!useCustomDeriv)
{
Mat _dx(_src.rows, _src.cols, CV_16S);
if( ippiFilterSobelNegVertBorder_8u16s_C1R(_src.ptr(), (int)_src.step,
if( CV_INSTRUMENT_FUN_IPP(ippiFilterSobelNegVertBorder_8u16s_C1R, _src.ptr(), (int)_src.step,
_dx.ptr<short>(), (int)_dx.step, roi,
ippMskSize3x3, ippBorderRepl, 0, buffer) < 0 )
return false;
Mat _dy(_src.rows, _src.cols, CV_16S);
if( ippiFilterSobelHorizBorder_8u16s_C1R(_src.ptr(), (int)_src.step,
if( CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizBorder_8u16s_C1R, _src.ptr(), (int)_src.step,
_dy.ptr<short>(), (int)_dy.step, roi,
ippMskSize3x3, ippBorderRepl, 0, buffer) < 0 )
return false;
@@ -118,7 +120,7 @@ static bool ippCanny(const Mat& _src, const Mat& dx_, const Mat& dy_, Mat& _dst,
dy = dy_;
}
if( ippiCanny_16s8u_C1R(dx.ptr<short>(), (int)dx.step,
if( CV_INSTRUMENT_FUN_IPP(ippiCanny_16s8u_C1R, dx.ptr<short>(), (int)dx.step,
dy.ptr<short>(), (int)dy.step,
_dst.ptr(), (int)_dst.step, roi, low, high, buffer) < 0 )
return false;
@@ -718,6 +720,8 @@ void Canny( InputArray _src, OutputArray _dst,
double low_thresh, double high_thresh,
int aperture_size, bool L2gradient )
{
CV_INSTRUMENT_REGION()
const int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
const Size size = _src.size();
+2
View File
@@ -351,6 +351,8 @@ namespace
void CLAHE_Impl::apply(cv::InputArray _src, cv::OutputArray _dst)
{
CV_INSTRUMENT_REGION()
CV_Assert( _src.type() == CV_8UC1 || _src.type() == CV_16UC1 );
#ifdef HAVE_OPENCL
+82 -36
View File
@@ -226,6 +226,8 @@ public:
virtual void operator()(const Range& range) const
{
CV_INSTRUMENT_REGION_IPP();
const void *yS = src_data + src_step * range.start;
void *yD = dst_data + dst_step * range.start;
if( !cvt(yS, static_cast<int>(src_step), yD, static_cast<int>(dst_step), width, range.end - range.start) )
@@ -278,19 +280,19 @@ bool CvtColorIPPLoopCopy(const uchar * src_data, size_t src_step, int src_type,
static IppStatus CV_STDCALL ippiSwapChannels_8u_C3C4Rf(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep,
IppiSize roiSize, const int *dstOrder)
{
return ippiSwapChannels_8u_C3C4R(pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP8u);
return CV_INSTRUMENT_FUN_IPP(ippiSwapChannels_8u_C3C4R, pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP8u);
}
static IppStatus CV_STDCALL ippiSwapChannels_16u_C3C4Rf(const Ipp16u* pSrc, int srcStep, Ipp16u* pDst, int dstStep,
IppiSize roiSize, const int *dstOrder)
{
return ippiSwapChannels_16u_C3C4R(pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP16u);
return CV_INSTRUMENT_FUN_IPP(ippiSwapChannels_16u_C3C4R, pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP16u);
}
static IppStatus CV_STDCALL ippiSwapChannels_32f_C3C4Rf(const Ipp32f* pSrc, int srcStep, Ipp32f* pDst, int dstStep,
IppiSize roiSize, const int *dstOrder)
{
return ippiSwapChannels_32f_C3C4R(pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP32f);
return CV_INSTRUMENT_FUN_IPP(ippiSwapChannels_32f_C3C4R, pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP32f);
}
static ippiReorderFunc ippiSwapChannelsC3C4RTab[] =
@@ -409,18 +411,18 @@ static ippiGeneralFunc ippiLUVToRGBTab[] =
struct IPPGeneralFunctor
{
IPPGeneralFunctor(ippiGeneralFunc _func) : func(_func){}
IPPGeneralFunctor(ippiGeneralFunc _func) : ippiColorConvertGeneral(_func){}
bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const
{
return func ? func(src, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0 : false;
return ippiColorConvertGeneral ? CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, src, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0 : false;
}
private:
ippiGeneralFunc func;
ippiGeneralFunc ippiColorConvertGeneral;
};
struct IPPReorderFunctor
{
IPPReorderFunctor(ippiReorderFunc _func, int _order0, int _order1, int _order2) : func(_func)
IPPReorderFunctor(ippiReorderFunc _func, int _order0, int _order1, int _order2) : ippiColorConvertReorder(_func)
{
order[0] = _order0;
order[1] = _order1;
@@ -429,17 +431,17 @@ struct IPPReorderFunctor
}
bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const
{
return func ? func(src, srcStep, dst, dstStep, ippiSize(cols, rows), order) >= 0 : false;
return ippiColorConvertReorder ? CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, src, srcStep, dst, dstStep, ippiSize(cols, rows), order) >= 0 : false;
}
private:
ippiReorderFunc func;
ippiReorderFunc ippiColorConvertReorder;
int order[4];
};
struct IPPColor2GrayFunctor
{
IPPColor2GrayFunctor(ippiColor2GrayFunc _func) :
func(_func)
ippiColorToGray(_func)
{
coeffs[0] = 0.114f;
coeffs[1] = 0.587f;
@@ -447,61 +449,61 @@ struct IPPColor2GrayFunctor
}
bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const
{
return func ? func(src, srcStep, dst, dstStep, ippiSize(cols, rows), coeffs) >= 0 : false;
return ippiColorToGray ? CV_INSTRUMENT_FUN_IPP(ippiColorToGray, src, srcStep, dst, dstStep, ippiSize(cols, rows), coeffs) >= 0 : false;
}
private:
ippiColor2GrayFunc func;
ippiColor2GrayFunc ippiColorToGray;
Ipp32f coeffs[3];
};
struct IPPGray2BGRFunctor
{
IPPGray2BGRFunctor(ippiGeneralFunc _func) :
func(_func)
ippiGrayToBGR(_func)
{
}
bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const
{
if (func == 0)
if (ippiGrayToBGR == 0)
return false;
const void* srcarray[3] = { src, src, src };
return func(srcarray, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0;
return CV_INSTRUMENT_FUN_IPP(ippiGrayToBGR, srcarray, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0;
}
private:
ippiGeneralFunc func;
ippiGeneralFunc ippiGrayToBGR;
};
struct IPPGray2BGRAFunctor
{
IPPGray2BGRAFunctor(ippiGeneralFunc _func1, ippiReorderFunc _func2, int _depth) :
func1(_func1), func2(_func2), depth(_depth)
ippiColorConvertGeneral(_func1), ippiColorConvertReorder(_func2), depth(_depth)
{
}
bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const
{
if (func1 == 0 || func2 == 0)
if (ippiColorConvertGeneral == 0 || ippiColorConvertReorder == 0)
return false;
const void* srcarray[3] = { src, src, src };
Mat temp(rows, cols, CV_MAKETYPE(depth, 3));
if(func1(srcarray, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0)
if(CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, srcarray, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0)
return false;
int order[4] = {0, 1, 2, 3};
return func2(temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0;
return CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0;
}
private:
ippiGeneralFunc func1;
ippiReorderFunc func2;
ippiGeneralFunc ippiColorConvertGeneral;
ippiReorderFunc ippiColorConvertReorder;
int depth;
};
struct IPPReorderGeneralFunctor
{
IPPReorderGeneralFunctor(ippiReorderFunc _func1, ippiGeneralFunc _func2, int _order0, int _order1, int _order2, int _depth) :
func1(_func1), func2(_func2), depth(_depth)
ippiColorConvertReorder(_func1), ippiColorConvertGeneral(_func2), depth(_depth)
{
order[0] = _order0;
order[1] = _order1;
@@ -510,18 +512,18 @@ struct IPPReorderGeneralFunctor
}
bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const
{
if (func1 == 0 || func2 == 0)
if (ippiColorConvertReorder == 0 || ippiColorConvertGeneral == 0)
return false;
Mat temp;
temp.create(rows, cols, CV_MAKETYPE(depth, 3));
if(func1(src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows), order) < 0)
if(CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows), order) < 0)
return false;
return func2(temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows)) >= 0;
return CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows)) >= 0;
}
private:
ippiReorderFunc func1;
ippiGeneralFunc func2;
ippiReorderFunc ippiColorConvertReorder;
ippiGeneralFunc ippiColorConvertGeneral;
int order[4];
int depth;
};
@@ -529,7 +531,7 @@ private:
struct IPPGeneralReorderFunctor
{
IPPGeneralReorderFunctor(ippiGeneralFunc _func1, ippiReorderFunc _func2, int _order0, int _order1, int _order2, int _depth) :
func1(_func1), func2(_func2), depth(_depth)
ippiColorConvertGeneral(_func1), ippiColorConvertReorder(_func2), depth(_depth)
{
order[0] = _order0;
order[1] = _order1;
@@ -538,18 +540,18 @@ struct IPPGeneralReorderFunctor
}
bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const
{
if (func1 == 0 || func2 == 0)
if (ippiColorConvertGeneral == 0 || ippiColorConvertReorder == 0)
return false;
Mat temp;
temp.create(rows, cols, CV_MAKETYPE(depth, 3));
if(func1(src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0)
if(CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0)
return false;
return func2(temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0;
return CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0;
}
private:
ippiGeneralFunc func1;
ippiReorderFunc func2;
ippiGeneralFunc ippiColorConvertGeneral;
ippiReorderFunc ippiColorConvertReorder;
int order[4];
int depth;
};
@@ -7386,6 +7388,8 @@ void cvtBGRtoBGR(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int scn, int dcn, bool swapBlue)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoBGR, cv_hal_cvtBGRtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, scn, dcn, swapBlue);
#if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700
@@ -7447,6 +7451,8 @@ void cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step,
int width, int height,
int scn, bool swapBlue, int greenBits)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoBGR5x5, cv_hal_cvtBGRtoBGR5x5, src_data, src_step, dst_data, dst_step, width, height, scn, swapBlue, greenBits);
#if defined(HAVE_IPP) && IPP_DISABLE_BLOCK // breaks OCL accuracy tests
@@ -7493,6 +7499,8 @@ void cvtBGR5x5toBGR(const uchar * src_data, size_t src_step,
int width, int height,
int dcn, bool swapBlue, int greenBits)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGR5x5toBGR, cv_hal_cvtBGR5x5toBGR, src_data, src_step, dst_data, dst_step, width, height, dcn, swapBlue, greenBits);
#if defined(HAVE_IPP) && IPP_VERSION_X100 < 900
@@ -7539,6 +7547,8 @@ void cvtBGRtoGray(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int scn, bool swapBlue)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoGray, cv_hal_cvtBGRtoGray, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue);
#if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700
@@ -7586,6 +7596,8 @@ void cvtGraytoBGR(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int dcn)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtGraytoBGR, cv_hal_cvtGraytoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn);
#if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700
@@ -7620,6 +7632,8 @@ void cvtBGR5x5toGray(const uchar * src_data, size_t src_step,
int width, int height,
int greenBits)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGR5x5toGray, cv_hal_cvtBGR5x5toGray, src_data, src_step, dst_data, dst_step, width, height, greenBits);
CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, RGB5x52Gray(greenBits));
}
@@ -7630,6 +7644,8 @@ void cvtGraytoBGR5x5(const uchar * src_data, size_t src_step,
int width, int height,
int greenBits)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtGraytoBGR5x5, cv_hal_cvtGraytoBGR5x5, src_data, src_step, dst_data, dst_step, width, height, greenBits);
CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, Gray2RGB5x5(greenBits));
}
@@ -7640,6 +7656,8 @@ void cvtBGRtoYUV(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int scn, bool swapBlue, bool isCbCr)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoYUV, cv_hal_cvtBGRtoYUV, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue, isCbCr);
#if defined(HAVE_IPP) && IPP_DISABLE_BLOCK
@@ -7693,6 +7711,8 @@ void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int dcn, bool swapBlue, bool isCbCr)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtYUVtoBGR, cv_hal_cvtYUVtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue, isCbCr);
@@ -7747,6 +7767,8 @@ void cvtBGRtoXYZ(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int scn, bool swapBlue)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoXYZ, cv_hal_cvtBGRtoXYZ, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue);
#if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700
@@ -7793,6 +7815,8 @@ void cvtXYZtoBGR(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int dcn, bool swapBlue)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtXYZtoBGR, cv_hal_cvtXYZtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue);
#if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700
@@ -7840,6 +7864,8 @@ void cvtBGRtoHSV(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoHSV, cv_hal_cvtBGRtoHSV, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue, isFullRange, isHSV);
#if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700
@@ -7925,6 +7951,8 @@ void cvtHSVtoBGR(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtHSVtoBGR, cv_hal_cvtHSVtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue, isFullRange, isHSV);
#if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700
@@ -8014,6 +8042,8 @@ void cvtBGRtoLab(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int scn, bool swapBlue, bool isLab, bool srgb)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoLab, cv_hal_cvtBGRtoLab, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue, isLab, srgb);
#if defined(HAVE_IPP) && IPP_DISABLE_BLOCK
@@ -8109,6 +8139,8 @@ void cvtLabtoBGR(const uchar * src_data, size_t src_step,
int width, int height,
int depth, int dcn, bool swapBlue, bool isLab, bool srgb)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtLabtoBGR, cv_hal_cvtLabtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue, isLab, srgb);
#if defined(HAVE_IPP) && IPP_DISABLE_BLOCK
@@ -8202,6 +8234,8 @@ void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
int dst_width, int dst_height,
int dcn, bool swapBlue, int uIdx)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtTwoPlaneYUVtoBGR, cv_hal_cvtTwoPlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx);
int blueIdx = swapBlue ? 2 : 0;
const uchar* uv = src_data + src_step * static_cast<size_t>(dst_height);
@@ -8224,6 +8258,8 @@ void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
int dst_width, int dst_height,
int dcn, bool swapBlue, int uIdx)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtThreePlaneYUVtoBGR, cv_hal_cvtThreePlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx);
const uchar* u = src_data + src_step * static_cast<size_t>(dst_height);
const uchar* v = src_data + src_step * static_cast<size_t>(dst_height + dst_height/4) + (dst_width/2) * ((dst_height % 4)/2);
@@ -8249,6 +8285,8 @@ void cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step,
int width, int height,
int scn, bool swapBlue, int uIdx)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtBGRtoThreePlaneYUV, cv_hal_cvtBGRtoThreePlaneYUV, src_data, src_step, dst_data, dst_step, width, height, scn, swapBlue, uIdx);
int blueIdx = swapBlue ? 2 : 0;
switch(blueIdx + uIdx*10)
@@ -8266,6 +8304,8 @@ void cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
int width, int height,
int dcn, bool swapBlue, int uIdx, int ycn)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtOnePlaneYUVtoBGR, cv_hal_cvtOnePlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, width, height, dcn, swapBlue, uIdx, ycn);
int blueIdx = swapBlue ? 2 : 0;
switch(dcn*1000 + blueIdx*100 + uIdx*10 + ycn)
@@ -8290,6 +8330,8 @@ void cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step,
uchar * dst_data, size_t dst_step,
int width, int height)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtRGBAtoMultipliedRGBA, cv_hal_cvtRGBAtoMultipliedRGBA, src_data, src_step, dst_data, dst_step, width, height);
#ifdef HAVE_IPP
@@ -8308,6 +8350,8 @@ void cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step,
uchar * dst_data, size_t dst_step,
int width, int height)
{
CV_INSTRUMENT_REGION()
CALL_HAL(cvtMultipliedRGBAtoRGBA, cv_hal_cvtMultipliedRGBAtoRGBA, src_data, src_step, dst_data, dst_step, width, height);
CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, mRGBA2RGBA<uchar>());
}
@@ -8398,6 +8442,8 @@ inline bool isFullRange(int code)
void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
{
CV_INSTRUMENT_REGION()
int stype = _src.type();
int scn = CV_MAT_CN(stype), depth = CV_MAT_DEPTH(stype), uidx, gbits, ycn;
@@ -8596,8 +8642,8 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(dstSz, CV_MAKETYPE(depth, dcn));
dst = _dst.getMat();
#ifdef HAVE_IPP
if (ippStsNoErr == ippiCopy_8u_C1R(src.data, (int)src.step, dst.data, (int)dst.step,
ippiSize(dstSz.width, dstSz.height)))
if (CV_INSTRUMENT_FUN_IPP(ippiCopy_8u_C1R, src.data, (int)src.step, dst.data, (int)dst.step,
ippiSize(dstSz.width, dstSz.height)) >= 0)
break;
#endif
src(Range(0, dstSz.height), Range::all()).copyTo(dst);
+2
View File
@@ -492,6 +492,8 @@ namespace colormap
void ColorMap::operator()(InputArray _src, OutputArray _dst) const
{
CV_INSTRUMENT_REGION()
if(_lut.total() != 256)
CV_Error(Error::StsAssert, "cv::LUT only supports tables of size 256.");
Mat src = _src.getMat();
+4
View File
@@ -1704,6 +1704,8 @@ cvFindContours( void* img, CvMemStorage* storage,
void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours,
OutputArray _hierarchy, int mode, int method, Point offset )
{
CV_INSTRUMENT_REGION()
// Sanity check: output must be of type vector<vector<Point>>
CV_Assert((_contours.kind() == _InputArray::STD_VECTOR_VECTOR || _contours.kind() == _InputArray::STD_VECTOR_MAT ||
_contours.kind() == _InputArray::STD_VECTOR_UMAT));
@@ -1757,6 +1759,8 @@ void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours,
void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours,
int mode, int method, Point offset)
{
CV_INSTRUMENT_REGION()
findContours(_image, _contours, noArray(), mode, method, offset);
}
+4
View File
@@ -128,6 +128,8 @@ struct CHullCmpPoints
void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool returnPoints )
{
CV_INSTRUMENT_REGION()
Mat points = _points.getMat();
int i, total = points.checkVector(2), depth = points.depth(), nout = 0;
int miny_ind = 0, maxy_ind = 0;
@@ -264,6 +266,8 @@ void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool ret
void convexityDefects( InputArray _points, InputArray _hull, OutputArray _defects )
{
CV_INSTRUMENT_REGION()
Mat points = _points.getMat();
int i, j = 0, npoints = points.checkVector(2, CV_32S);
CV_Assert( npoints >= 0 );
+23 -11
View File
@@ -528,6 +528,8 @@ namespace cv
{
static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType )
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 800
Mat src = _src.getMat();
_dst.create( src.size(), CV_32FC1 );
@@ -552,23 +554,23 @@ static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockS
(kerSize == 3 || kerSize == 5) && (blockSize == 3 || blockSize == 5))
{
ippiMinEigenValGetBufferSize getBufferSizeFunc = 0;
ippiMinEigenVal minEigenValFunc = 0;
ippiMinEigenVal ippiMinEigenVal_C1R = 0;
float norm_coef = 0.f;
if (src.type() == CV_8UC1)
{
getBufferSizeFunc = (ippiMinEigenValGetBufferSize) ippiMinEigenValGetBufferSize_8u32f_C1R;
minEigenValFunc = (ippiMinEigenVal) ippiMinEigenVal_8u32f_C1R;
ippiMinEigenVal_C1R = (ippiMinEigenVal) ippiMinEigenVal_8u32f_C1R;
norm_coef = 1.f / 255.f;
} else if (src.type() == CV_32FC1)
{
getBufferSizeFunc = (ippiMinEigenValGetBufferSize) ippiMinEigenValGetBufferSize_32f_C1R;
minEigenValFunc = (ippiMinEigenVal) ippiMinEigenVal_32f_C1R;
ippiMinEigenVal_C1R = (ippiMinEigenVal) ippiMinEigenVal_32f_C1R;
norm_coef = 255.f;
}
norm_coef = kerType == ippKernelSobel ? norm_coef : norm_coef / 2.45f;
if (getBufferSizeFunc && minEigenValFunc)
if (getBufferSizeFunc && ippiMinEigenVal_C1R)
{
int bufferSize;
IppiSize srcRoi = { src.cols, src.rows };
@@ -576,9 +578,9 @@ static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockS
if (ok >= 0)
{
AutoBuffer<uchar> buffer(bufferSize);
ok = minEigenValFunc(src.ptr(), (int) src.step, dst.ptr<Ipp32f>(), (int) dst.step, srcRoi, kerType, kerSize, blockSize, buffer);
ok = CV_INSTRUMENT_FUN_IPP(ippiMinEigenVal_C1R, src.ptr(), (int) src.step, dst.ptr<Ipp32f>(), (int) dst.step, srcRoi, kerType, kerSize, blockSize, buffer);
CV_SUPPRESS_DEPRECATED_START
if (ok >= 0) ok = ippiMulC_32f_C1IR(norm_coef, dst.ptr<Ipp32f>(), (int) dst.step, srcRoi);
if (ok >= 0) ok = CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1IR, norm_coef, dst.ptr<Ipp32f>(), (int) dst.step, srcRoi);
CV_SUPPRESS_DEPRECATED_END
if (ok >= 0)
{
@@ -599,6 +601,8 @@ static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockS
void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
ocl_cornerMinEigenValVecs(_src, _dst, blockSize, ksize, 0.0, borderType, MINEIGENVAL))
@@ -609,7 +613,7 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
#endif
CV_IPP_RUN(((borderTypeNI == BORDER_REPLICATE && (!_src.isSubmatrix() || isolated)) &&
(kerSize == 3 || kerSize == 5) && (blockSize == 3 || blockSize == 5)) && IPP_VERSION_X100 >= 800,
ipp_cornerMinEigenVal( _src, _dst, blockSize, ksize, borderType ));
ipp_cornerMinEigenVal( _src, _dst, blockSize, ksize, borderType ));
Mat src = _src.getMat();
@@ -625,6 +629,8 @@ namespace cv
{
static bool ipp_cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksize, double k, int borderType )
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK
Mat src = _src.getMat();
_dst.create( src.size(), CV_32FC1 );
@@ -658,11 +664,11 @@ static bool ipp_cornerHarris( InputArray _src, OutputArray _dst, int blockSize,
IppStatus status = (IppStatus)-1;
if (depth == CV_8U)
status = ippiHarrisCorner_8u32f_C1R((const Ipp8u *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize,
filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer);
status = CV_INSTRUMENT_FUN_IPP(ippiHarrisCorner_8u32f_C1R,((const Ipp8u *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize,
filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer));
else if (depth == CV_32F)
status = ippiHarrisCorner_32f_C1R((const Ipp32f *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize,
filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer);
status = CV_INSTRUMENT_FUN_IPP(ippiHarrisCorner_32f_C1R,((const Ipp32f *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize,
filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer));
ippsFree(buffer);
if (status >= 0)
@@ -683,6 +689,8 @@ static bool ipp_cornerHarris( InputArray _src, OutputArray _dst, int blockSize,
void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksize, double k, int borderType )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
ocl_cornerMinEigenValVecs(_src, _dst, blockSize, ksize, k, borderType, HARRIS))
@@ -706,6 +714,8 @@ void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksi
void cv::cornerEigenValsAndVecs( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType )
{
CV_INSTRUMENT_REGION()
Mat src = _src.getMat();
Size dsz = _dst.size();
int dtype = _dst.type();
@@ -719,6 +729,8 @@ void cv::cornerEigenValsAndVecs( InputArray _src, OutputArray _dst, int blockSiz
void cv::preCornerDetect( InputArray _src, OutputArray _dst, int ksize, int borderType )
{
CV_INSTRUMENT_REGION()
int type = _src.type();
CV_Assert( type == CV_8UC1 || type == CV_32FC1 );
+2
View File
@@ -44,6 +44,8 @@
void cv::cornerSubPix( InputArray _image, InputOutputArray _corners,
Size win, Size zeroZone, TermCriteria criteria )
{
CV_INSTRUMENT_REGION()
const int MAX_ITERS = 100;
int win_w = win.width * 2 + 1, win_h = win.height * 2 + 1;
int i, j, k;
+2
View File
@@ -1615,6 +1615,8 @@ static void Bayer2RGB_EdgeAware_T(const Mat& src, Mat& dst, int code)
void cv::demosaicing(InputArray _src, OutputArray _dst, int code, int dcn)
{
CV_INSTRUMENT_REGION()
Mat src = _src.getMat(), dst;
Size sz = src.size();
int scn = src.channels(), depth = src.depth();
+34 -20
View File
@@ -184,6 +184,8 @@ namespace cv
{
static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, double scale, double delta, int borderType)
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810
if ((0 > dx) || (0 > dy) || (1 != dx + dy))
return false;
@@ -230,7 +232,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx
pBuffer = ippsMalloc_8u(bufferSize);
if (NULL == pBuffer)
return false;
sts = ippiFilterScharrHorizMaskBorder_8u16s_C1R(src.ptr(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrHorizMaskBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
}
else
{
@@ -239,7 +241,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx
pBuffer = ippsMalloc_8u(bufferSize);
if (NULL == pBuffer)
return false;
sts = ippiFilterScharrVertMaskBorder_8u16s_C1R(src.ptr(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrVertMaskBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
}
ippsFree(pBuffer);
}
@@ -253,7 +255,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx
pBuffer = ippsMalloc_8u(bufferSize);
if (NULL == pBuffer)
return false;
sts = ippiFilterScharrHorizMaskBorder_16s_C1R(src.ptr<Ipp16s>(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrHorizMaskBorder_16s_C1R, src.ptr<Ipp16s>(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
}
else
{
@@ -262,7 +264,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx
pBuffer = ippsMalloc_8u(bufferSize);
if (NULL == pBuffer)
return false;
sts = ippiFilterScharrVertMaskBorder_16s_C1R(src.ptr<Ipp16s>(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrVertMaskBorder_16s_C1R, src.ptr<Ipp16s>(), (int)src.step, dst.ptr<Ipp16s>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
}
ippsFree(pBuffer);
}
@@ -276,7 +278,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx
pBuffer = ippsMalloc_8u(bufferSize);
if (NULL == pBuffer)
return false;
sts = ippiFilterScharrHorizMaskBorder_32f_C1R(src.ptr<Ipp32f>(), (int)src.step, dst.ptr<Ipp32f>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrHorizMaskBorder_32f_C1R, src.ptr<Ipp32f>(), (int)src.step, dst.ptr<Ipp32f>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
}
else
{
@@ -285,14 +287,14 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx
pBuffer = ippsMalloc_8u(bufferSize);
if (NULL == pBuffer)
return false;
sts = ippiFilterScharrVertMaskBorder_32f_C1R(src.ptr<Ipp32f>(), (int)src.step, dst.ptr<Ipp32f>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrVertMaskBorder_32f_C1R, src.ptr<Ipp32f>(), (int)src.step, dst.ptr<Ipp32f>(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer);
}
ippsFree(pBuffer);
if (sts < 0)
return false;;
if (FLT_EPSILON < fabs(scale - 1.0))
sts = ippiMulC_32f_C1R(dst.ptr<Ipp32f>(), (int)dst.step, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, roiSize);
sts = CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1R, dst.ptr<Ipp32f>(), (int)dst.step, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, roiSize);
}
return (0 <= sts);
#else
@@ -303,6 +305,8 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx
static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType)
{
CV_INSTRUMENT_REGION_IPP()
if ((borderType != BORDER_REPLICATE) || ((3 != ksize) && (5 != ksize)))
return false;
if (fabs(delta) > FLT_EPSILON)
@@ -333,7 +337,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx,
buffer.allocate(bufSize);
#endif
if (0 > ippiFilterSobelNegVertBorder_8u16s_C1R(src.ptr<Ipp8u>(), (int)src.step,
if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelNegVertBorder_8u16s_C1R, src.ptr<Ipp8u>(), (int)src.step,
dst.ptr<Ipp16s>(), (int)dst.step, roi, kernel,
ippBorderRepl, 0, (Ipp8u*)(char*)buffer))
return false;
@@ -352,7 +356,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx,
buffer.allocate(bufSize);
#endif
if (0 > ippiFilterSobelHorizBorder_8u16s_C1R(src.ptr<Ipp8u>(), (int)src.step,
if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizBorder_8u16s_C1R, src.ptr<Ipp8u>(), (int)src.step,
dst.ptr<Ipp16s>(), (int)dst.step, roi, kernel,
ippBorderRepl, 0, (Ipp8u*)(char*)buffer))
return false;
@@ -371,7 +375,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx,
buffer.allocate(bufSize);
#endif
if (0 > ippiFilterSobelVertSecondBorder_8u16s_C1R(src.ptr<Ipp8u>(), (int)src.step,
if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelVertSecondBorder_8u16s_C1R, src.ptr<Ipp8u>(), (int)src.step,
dst.ptr<Ipp16s>(), (int)dst.step, roi, kernel,
ippBorderRepl, 0, (Ipp8u*)(char*)buffer))
return false;
@@ -390,7 +394,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx,
buffer.allocate(bufSize);
#endif
if (0 > ippiFilterSobelHorizSecondBorder_8u16s_C1R(src.ptr<Ipp8u>(), (int)src.step,
if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizSecondBorder_8u16s_C1R, src.ptr<Ipp8u>(), (int)src.step,
dst.ptr<Ipp16s>(), (int)dst.step, roi, kernel,
ippBorderRepl, 0, (Ipp8u*)(char*)buffer))
return false;
@@ -456,12 +460,12 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx,
buffer.allocate(bufSize);
#endif
if (0 > ippiFilterSobelVertSecondBorder_32f_C1R(src.ptr<Ipp32f>(), (int)src.step,
if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelVertSecondBorder_32f_C1R, src.ptr<Ipp32f>(), (int)src.step,
dst.ptr<Ipp32f>(), (int)dst.step, roi, kernel,
ippBorderRepl, 0, (Ipp8u*)(char*)buffer))
return false;
if(scale != 1)
ippiMulC_32f_C1R(dst.ptr<Ipp32f>(), (int)dst.step, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows));
CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1R, dst.ptr<Ipp32f>(), (int)dst.step, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows));
return true;
}
@@ -477,13 +481,13 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx,
buffer.allocate(bufSize);
#endif
if (0 > ippiFilterSobelHorizSecondBorder_32f_C1R(src.ptr<Ipp32f>(), (int)src.step,
if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizSecondBorder_32f_C1R, src.ptr<Ipp32f>(), (int)src.step,
dst.ptr<Ipp32f>(), (int)dst.step, roi, kernel,
ippBorderRepl, 0, (Ipp8u*)(char*)buffer))
return false;
if(scale != 1)
ippiMulC_32f_C1R(dst.ptr<Ipp32f>(), (int)dst.step, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows));
CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1R, dst.ptr<Ipp32f>(), (int)dst.step, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows));
return true;
}
}
@@ -492,6 +496,8 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx,
static bool ipp_sobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType)
{
CV_INSTRUMENT_REGION_IPP()
if (ksize < 0)
{
if (IPPDerivScharr(_src, _dst, ddepth, dx, dy, scale, delta, borderType))
@@ -510,6 +516,8 @@ static bool ipp_sobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int
void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
int ksize, double scale, double delta, int borderType )
{
CV_INSTRUMENT_REGION()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype);
if (ddepth < 0)
ddepth = sdepth;
@@ -549,6 +557,8 @@ void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
void cv::Scharr( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
double scale, double delta, int borderType )
{
CV_INSTRUMENT_REGION()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype);
if (ddepth < 0)
ddepth = sdepth;
@@ -733,6 +743,8 @@ namespace cv
static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksize,
double scale, double delta, int borderType)
{
CV_INSTRUMENT_REGION_IPP()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype);
if (ddepth < 0)
ddepth = sdepth;
@@ -758,7 +770,7 @@ static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksi
if (borderTypeIpp >= 0 && ippiFilterLaplacianGetBufferSize_##ippfavor##_C1R(roisize, masksize, &bufsize) >= 0) \
{ \
Ipp8u * buffer = ippsMalloc_8u(bufsize); \
status = ippiFilterLaplacianBorder_##ippfavor##_C1R(src.ptr<ippsrctype>(), (int)src.step, dst.ptr<ippdsttype>(), \
status = CV_INSTRUMENT_FUN_IPP(ippiFilterLaplacianBorder_##ippfavor##_C1R, src.ptr<ippsrctype>(), (int)src.step, dst.ptr<ippdsttype>(), \
(int)dst.step, roisize, masksize, borderTypeIpp, 0, buffer); \
ippsFree(buffer); \
} \
@@ -770,18 +782,18 @@ static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksi
IPP_FILTER_LAPLACIAN(Ipp8u, Ipp16s, 8u16s);
if (needScale && status >= 0)
status = ippiMulC_16s_C1IRSfs((Ipp16s)iscale, dst.ptr<Ipp16s>(), (int)dst.step, roisize, 0);
status = CV_INSTRUMENT_FUN_IPP(ippiMulC_16s_C1IRSfs, (Ipp16s)iscale, dst.ptr<Ipp16s>(), (int)dst.step, roisize, 0);
if (needDelta && status >= 0)
status = ippiAddC_16s_C1IRSfs((Ipp16s)idelta, dst.ptr<Ipp16s>(), (int)dst.step, roisize, 0);
status = CV_INSTRUMENT_FUN_IPP(ippiAddC_16s_C1IRSfs, (Ipp16s)idelta, dst.ptr<Ipp16s>(), (int)dst.step, roisize, 0);
}
else if (sdepth == CV_32F && ddepth == CV_32F)
{
IPP_FILTER_LAPLACIAN(Ipp32f, Ipp32f, 32f);
if (needScale && status >= 0)
status = ippiMulC_32f_C1IR((Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, roisize);
status = CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1IR, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, roisize);
if (needDelta && status >= 0)
status = ippiAddC_32f_C1IR((Ipp32f)delta, dst.ptr<Ipp32f>(), (int)dst.step, roisize);
status = CV_INSTRUMENT_FUN_IPP(ippiAddC_32f_C1IR, (Ipp32f)delta, dst.ptr<Ipp32f>(), (int)dst.step, roisize);
}
CV_SUPPRESS_DEPRECATED_END
@@ -799,6 +811,8 @@ static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksi
void cv::Laplacian( InputArray _src, OutputArray _dst, int ddepth, int ksize,
double scale, double delta, int borderType )
{
CV_INSTRUMENT_REGION()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype);
if (ddepth < 0)
ddepth = sdepth;
+8 -4
View File
@@ -693,7 +693,7 @@ static void distanceTransform_L1_8U(InputArray _src, OutputArray _dst)
{
IppiSize roi = { src.cols, src.rows };
Ipp32s pMetrics[2] = { 1, 2 }; //L1, 3x3 mask
if (ippiDistanceTransform_3x3_8u_C1R(src.ptr<uchar>(), (int)src.step, dst.ptr<uchar>(), (int)dst.step, roi, pMetrics)>=0)
if (CV_INSTRUMENT_FUN_IPP(ippiDistanceTransform_3x3_8u_C1R, src.ptr<uchar>(), (int)src.step, dst.ptr<uchar>(), (int)dst.step, roi, pMetrics) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -710,6 +710,8 @@ static void distanceTransform_L1_8U(InputArray _src, OutputArray _dst)
void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labels,
int distType, int maskSize, int labelType )
{
CV_INSTRUMENT_REGION()
Mat src = _src.getMat(), labels;
bool need_labels = _labels.needed();
@@ -754,7 +756,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
if (status>=0)
{
pBuffer = (Ipp8u *)ippMalloc( bufSize );
status = ippiTrueDistanceTransform_8u32f_C1R(src.ptr<uchar>(),(int)src.step, dst.ptr<float>(), (int)dst.step, roi, pBuffer);
status = CV_INSTRUMENT_FUN_IPP(ippiTrueDistanceTransform_8u32f_C1R, src.ptr<uchar>(), (int)src.step, dst.ptr<float>(), (int)dst.step, roi, pBuffer);
ippFree( pBuffer );
if (status>=0)
{
@@ -789,7 +791,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
CV_IPP_CHECK()
{
IppiSize roi = { src.cols, src.rows };
if (ippiDistanceTransform_3x3_8u32f_C1R(src.ptr<uchar>(), (int)src.step, dst.ptr<float>(), (int)dst.step, roi, _mask)>=0)
if (CV_INSTRUMENT_FUN_IPP(ippiDistanceTransform_3x3_8u32f_C1R, src.ptr<uchar>(), (int)src.step, dst.ptr<float>(), (int)dst.step, roi, _mask) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -806,7 +808,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
CV_IPP_CHECK()
{
IppiSize roi = { src.cols, src.rows };
if (ippiDistanceTransform_5x5_8u32f_C1R(src.ptr<uchar>(), (int)src.step, dst.ptr<float>(), (int)dst.step, roi, _mask)>=0)
if (CV_INSTRUMENT_FUN_IPP(ippiDistanceTransform_5x5_8u32f_C1R, src.ptr<uchar>(), (int)src.step, dst.ptr<float>(), (int)dst.step, roi, _mask) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -848,6 +850,8 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
void cv::distanceTransform( InputArray _src, OutputArray _dst,
int distanceType, int maskSize, int dstType)
{
CV_INSTRUMENT_REGION()
if (distanceType == CV_DIST_L1 && dstType==CV_8U)
distanceTransform_L1_8U(_src, _dst);
else
+36
View File
@@ -79,6 +79,8 @@ FillConvexPoly( Mat& img, const Point* v, int npts,
bool clipLine( Size img_size, Point& pt1, Point& pt2 )
{
CV_INSTRUMENT_REGION()
int64 x1, y1, x2, y2;
int c1, c2;
int64 right = img_size.width-1, bottom = img_size.height-1;
@@ -138,6 +140,8 @@ bool clipLine( Size img_size, Point& pt1, Point& pt2 )
bool clipLine( Rect img_rect, Point& pt1, Point& pt2 )
{
CV_INSTRUMENT_REGION()
Point tl = img_rect.tl();
pt1 -= tl; pt2 -= tl;
bool inside = clipLine(img_rect.size(), pt1, pt2);
@@ -922,6 +926,8 @@ void ellipse2Poly( Point center, Size axes, int angle,
int arc_start, int arc_end,
int delta, std::vector<Point>& pts )
{
CV_INSTRUMENT_REGION()
float alpha, beta;
double size_a = axes.width, size_b = axes.height;
double cx = center.x, cy = center.y;
@@ -1726,6 +1732,8 @@ void drawMarker(Mat& img, Point position, const Scalar& color, int markerType, i
void line( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color,
int thickness, int line_type, int shift )
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
if( line_type == CV_AA && img.depth() != CV_8U )
@@ -1742,6 +1750,8 @@ void line( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color,
void arrowedLine(InputOutputArray img, Point pt1, Point pt2, const Scalar& color,
int thickness, int line_type, int shift, double tipLength)
{
CV_INSTRUMENT_REGION()
const double tipSize = norm(pt1-pt2)*tipLength; // Factor to normalize the size of the tip depending on the length of the arrow
line(img, pt1, pt2, color, thickness, line_type, shift);
@@ -1761,6 +1771,8 @@ void rectangle( InputOutputArray _img, Point pt1, Point pt2,
const Scalar& color, int thickness,
int lineType, int shift )
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
if( lineType == CV_AA && img.depth() != CV_8U )
@@ -1792,6 +1804,8 @@ void rectangle( Mat& img, Rect rec,
const Scalar& color, int thickness,
int lineType, int shift )
{
CV_INSTRUMENT_REGION()
CV_Assert( 0 <= shift && shift <= XY_SHIFT );
if( rec.area() > 0 )
rectangle( img, rec.tl(), rec.br() - Point(1<<shift,1<<shift),
@@ -1802,6 +1816,8 @@ void rectangle( Mat& img, Rect rec,
void circle( InputOutputArray _img, Point center, int radius,
const Scalar& color, int thickness, int line_type, int shift )
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
if( line_type == CV_AA && img.depth() != CV_8U )
@@ -1830,6 +1846,8 @@ void ellipse( InputOutputArray _img, Point center, Size axes,
double angle, double start_angle, double end_angle,
const Scalar& color, int thickness, int line_type, int shift )
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
if( line_type == CV_AA && img.depth() != CV_8U )
@@ -1856,6 +1874,8 @@ void ellipse( InputOutputArray _img, Point center, Size axes,
void ellipse(InputOutputArray _img, const RotatedRect& box, const Scalar& color,
int thickness, int lineType)
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
if( lineType == CV_AA && img.depth() != CV_8U )
@@ -1878,6 +1898,8 @@ void ellipse(InputOutputArray _img, const RotatedRect& box, const Scalar& color,
void fillConvexPoly( Mat& img, const Point* pts, int npts,
const Scalar& color, int line_type, int shift )
{
CV_INSTRUMENT_REGION()
if( !pts || npts <= 0 )
return;
@@ -1895,6 +1917,8 @@ void fillPoly( Mat& img, const Point** pts, const int* npts, int ncontours,
const Scalar& color, int line_type,
int shift, Point offset )
{
CV_INSTRUMENT_REGION()
if( line_type == CV_AA && img.depth() != CV_8U )
line_type = 8;
@@ -1920,6 +1944,8 @@ void fillPoly( Mat& img, const Point** pts, const int* npts, int ncontours,
void polylines( Mat& img, const Point* const* pts, const int* npts, int ncontours, bool isClosed,
const Scalar& color, int thickness, int line_type, int shift )
{
CV_INSTRUMENT_REGION()
if( line_type == CV_AA && img.depth() != CV_8U )
line_type = 8;
@@ -2155,6 +2181,8 @@ void putText( InputOutputArray _img, const String& text, Point org,
int thickness, int line_type, bool bottomLeftOrigin )
{
CV_INSTRUMENT_REGION()
if ( text.empty() )
{
return;
@@ -2252,6 +2280,8 @@ Size getTextSize( const String& text, int fontFace, double fontScale, int thickn
void cv::fillConvexPoly(InputOutputArray _img, InputArray _points,
const Scalar& color, int lineType, int shift)
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat(), points = _points.getMat();
CV_Assert(points.checkVector(2, CV_32S) >= 0);
fillConvexPoly(img, points.ptr<Point>(), points.rows*points.cols*points.channels()/2, color, lineType, shift);
@@ -2261,6 +2291,8 @@ void cv::fillConvexPoly(InputOutputArray _img, InputArray _points,
void cv::fillPoly(InputOutputArray _img, InputArrayOfArrays pts,
const Scalar& color, int lineType, int shift, Point offset)
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
int i, ncontours = (int)pts.total();
if( ncontours == 0 )
@@ -2285,6 +2317,8 @@ void cv::polylines(InputOutputArray _img, InputArrayOfArrays pts,
bool isClosed, const Scalar& color,
int thickness, int lineType, int shift )
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
bool manyContours = pts.kind() == _InputArray::STD_VECTOR_VECTOR ||
pts.kind() == _InputArray::STD_VECTOR_MAT;
@@ -2347,6 +2381,8 @@ void cv::drawContours( InputOutputArray _image, InputArrayOfArrays _contours,
int lineType, InputArray _hierarchy,
int maxLevel, Point offset )
{
CV_INSTRUMENT_REGION()
Mat image = _image.getMat(), hierarchy = _hierarchy.getMat();
CvMat _cimage = image;
+2
View File
@@ -1144,6 +1144,8 @@ float cv::EMD( InputArray _signature1, InputArray _signature2,
int distType, InputArray _cost,
float* lowerBound, OutputArray _flow )
{
CV_INSTRUMENT_REGION()
Mat signature1 = _signature1.getMat(), signature2 = _signature2.getMat();
Mat cost = _cost.getMat(), flow;
+2
View File
@@ -269,6 +269,8 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
InputArray _mask, int blockSize,
bool useHarrisDetector, double harrisK )
{
CV_INSTRUMENT_REGION()
CV_Assert( qualityLevel > 0 && minDistance >= 0 && maxCorners >= 0 );
CV_Assert( _mask.empty() || (_mask.type() == CV_8UC1 && _mask.sameSize(_image)) );
+30 -20
View File
@@ -379,6 +379,8 @@ int FilterEngine::proceed( const uchar* src, int srcstep, int count,
void FilterEngine::apply(const Mat& src, Mat& dst, const Size & wsz, const Point & ofs)
{
CV_INSTRUMENT_REGION()
CV_Assert( src.type() == srcType && dst.type() == dstType );
int y = start(src, wsz, ofs);
@@ -1411,6 +1413,8 @@ private:
mutable int bufsz;
int ippiOperator(const uchar* _src, uchar* _dst, int width, int cn) const
{
CV_INSTRUMENT_REGION_IPP()
int _ksize = kernel.rows + kernel.cols - 1;
if ((1 != cn && 3 != cn) || width < _ksize*8)
return 0;
@@ -1432,10 +1436,10 @@ private:
float borderValue[] = {0.f, 0.f, 0.f};
// here is the trick. IPP needs border type and extrapolates the row. We did it already.
// So we pass anchor=0 and ignore the right tail of results since they are incorrect there.
if( (cn == 1 && ippiFilterRowBorderPipeline_32f_C1R(src, step, &dst, roisz, _kx, _ksize, 0,
ippBorderRepl, borderValue[0], bufptr) < 0) ||
(cn == 3 && ippiFilterRowBorderPipeline_32f_C3R(src, step, &dst, roisz, _kx, _ksize, 0,
ippBorderRepl, borderValue, bufptr) < 0))
if( (cn == 1 && CV_INSTRUMENT_FUN_IPP(ippiFilterRowBorderPipeline_32f_C1R,(src, step, &dst, roisz, _kx, _ksize, 0,
ippBorderRepl, borderValue[0], bufptr)) < 0) ||
(cn == 3 && CV_INSTRUMENT_FUN_IPP(ippiFilterRowBorderPipeline_32f_C3R,(src, step, &dst, roisz, _kx, _ksize, 0,
ippBorderRepl, borderValue, bufptr)) < 0))
{
setIppErrorStatus();
return 0;
@@ -4540,39 +4544,39 @@ struct ReplacementFilter : public hal::Filter2D
};
#ifdef HAVE_IPP
typedef IppStatus(CV_STDCALL* ippiFilterBorder)(
typedef IppStatus(CV_STDCALL* IppiFilterBorder)(
const void* pSrc, int srcStep, void* pDst, int dstStep,
IppiSize dstRoiSize, IppiBorderType border, const void* borderValue,
const IppiFilterBorderSpec* pSpec, Ipp8u* pBuffer);
static ippiFilterBorder getIppFunc(int stype)
static IppiFilterBorder getIppFunc(int stype)
{
switch (stype)
{
case CV_8UC1:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_8u_C1R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_8u_C1R);
case CV_8UC3:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_8u_C3R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_8u_C3R);
case CV_8UC4:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_8u_C4R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_8u_C4R);
case CV_16UC1:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_16u_C1R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_16u_C1R);
case CV_16UC3:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_16u_C3R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_16u_C3R);
case CV_16UC4:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_16u_C4R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_16u_C4R);
case CV_16SC1:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_16s_C1R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_16s_C1R);
case CV_16SC3:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_16s_C3R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_16s_C3R);
case CV_16SC4:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_16s_C4R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_16s_C4R);
case CV_32FC1:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_32f_C1R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_32f_C1R);
case CV_32FC3:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_32f_C3R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_32f_C3R);
case CV_32FC4:
return reinterpret_cast<ippiFilterBorder>(ippiFilterBorder_32f_C4R);
return reinterpret_cast<IppiFilterBorder>(ippiFilterBorder_32f_C4R);
default:
return 0;
}
@@ -4689,12 +4693,14 @@ struct IppFilter : public hal::Filter2D
void apply(uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int, int, int, int)
{
CV_INSTRUMENT_REGION_IPP()
if (dst_data == src_data)
CV_Error(Error::StsBadArg, "Inplace IPP Filter2D is not supported");
ippiFilterBorder ippFunc = getIppFunc(src_type);
IppiFilterBorder ippiFilterBorder = getIppFunc(src_type);
IppiSize dstRoiSize = { width, height };
kernel_type borderValue[4] = { 0, 0, 0, 0 };
IppStatus status = ippFunc(src_data, (int)src_step, dst_data, (int)dst_step, dstRoiSize, ippBorderType, borderValue, spec, buffer);
IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiFilterBorder, src_data, (int)src_step, dst_data, (int)dst_step, dstRoiSize, ippBorderType, borderValue, spec, buffer);
if (status >= 0) {
CV_IMPL_ADD(CV_IMPL_IPP);
}
@@ -4988,6 +4994,8 @@ void cv::filter2D( InputArray _src, OutputArray _dst, int ddepth,
InputArray _kernel, Point anchor0,
double delta, int borderType )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_dst.isUMat() && _src.dims() <= 2,
ocl_filter2D(_src, _dst, ddepth, _kernel, anchor0, delta, borderType))
@@ -5015,6 +5023,8 @@ void cv::sepFilter2D( InputArray _src, OutputArray _dst, int ddepth,
InputArray _kernelX, InputArray _kernelY, Point anchor,
double delta, int borderType )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_dst.isUMat() && _src.dims() <= 2 && (size_t)_src.rows() > _kernelY.total() && (size_t)_src.cols() > _kernelX.total(),
ocl_sepFilter2D(_src, _dst, ddepth, _kernelX, _kernelY, anchor, delta, borderType))
+4
View File
@@ -459,6 +459,8 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
Point seedPoint, Scalar newVal, Rect* rect,
Scalar loDiff, Scalar upDiff, int flags )
{
CV_INSTRUMENT_REGION()
ConnectedComp comp;
std::vector<FFillSegment> buffer;
@@ -629,6 +631,8 @@ int cv::floodFill( InputOutputArray _image, Point seedPoint,
Scalar newVal, Rect* rect,
Scalar loDiff, Scalar upDiff, int flags )
{
CV_INSTRUMENT_REGION()
return floodFill(_image, Mat(), seedPoint, newVal, rect, loDiff, upDiff, flags);
}
@@ -415,6 +415,8 @@ namespace
void GeneralizedHoughBallardImpl::calcHist()
{
CV_INSTRUMENT_REGION()
CV_Assert( imageEdges_.type() == CV_8UC1 );
CV_Assert( imageDx_.type() == CV_32FC1 && imageDx_.size() == imageSize_);
CV_Assert( imageDy_.type() == imageDx_.type() && imageDy_.size() == imageSize_);
+4
View File
@@ -94,6 +94,8 @@ cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] )
double cv::pointPolygonTest( InputArray _contour, Point2f pt, bool measureDist )
{
CV_INSTRUMENT_REGION()
double result = 0;
Mat contour = _contour.getMat();
int i, total = contour.checkVector(2), counter = 0;
@@ -504,6 +506,8 @@ static int intersectConvexConvex_( const Point2f* P, int n, const Point2f* Q, in
float cv::intersectConvexConvex( InputArray _p1, InputArray _p2, OutputArray _p12, bool handleNested )
{
CV_INSTRUMENT_REGION()
Mat p1 = _p1.getMat(), p2 = _p2.getMat();
CV_Assert( p1.depth() == CV_32S || p1.depth() == CV_32F );
CV_Assert( p2.depth() == CV_32S || p2.depth() == CV_32F );
+2
View File
@@ -529,6 +529,8 @@ void cv::grabCut( InputArray _img, InputOutputArray _mask, Rect rect,
InputOutputArray _bgdModel, InputOutputArray _fgdModel,
int iterCount, int mode )
{
CV_INSTRUMENT_REGION()
Mat img = _img.getMat();
Mat& mask = _mask.getMatRef();
Mat& bgdModel = _bgdModel.getMatRef();
+22 -1
View File
@@ -1188,6 +1188,8 @@ public:
virtual void operator() (const Range & range) const
{
CV_INSTRUMENT_REGION_IPP()
Ipp32s levelNum = histSize + 1;
Mat phist(hist->size(), hist->type(), Scalar::all(0));
#if IPP_VERSION_X100 >= 900
@@ -1226,7 +1228,7 @@ public:
return;
}
IppStatus status = ippiHistogram_8u_C1R(src->ptr(range.start), (int)src->step, ippiSize(src->cols, range.end - range.start),
IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiHistogram_8u_C1R, src->ptr(range.start), (int)src->step, ippiSize(src->cols, range.end - range.start),
phist.ptr<Ipp32u>(), pSpec, pBuffer);
if(pSpec) ippFree(pSpec);
@@ -1269,6 +1271,8 @@ static bool ipp_calchist(const Mat* images, int nimages, const int* channels,
InputArray _mask, OutputArray _hist, int dims, const int* histSize,
const float** ranges, bool uniform, bool accumulate )
{
CV_INSTRUMENT_REGION_IPP()
Mat mask = _mask.getMat();
CV_Assert(dims > 0 && histSize);
@@ -1311,6 +1315,7 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels,
InputArray _mask, OutputArray _hist, int dims, const int* histSize,
const float** ranges, bool uniform, bool accumulate )
{
CV_INSTRUMENT_REGION()
CV_IPP_RUN(nimages == 1 && images[0].type() == CV_8UC1 && dims == 1 && channels &&
channels[0] == 0 && _mask.getMat().empty() && images[0].dims <= 2 &&
@@ -1602,6 +1607,8 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels,
InputArray _mask, SparseMat& hist, int dims, const int* histSize,
const float** ranges, bool uniform, bool accumulate )
{
CV_INSTRUMENT_REGION()
Mat mask = _mask.getMat();
calcHist( images, nimages, channels, mask, hist, dims, histSize,
ranges, uniform, accumulate, false );
@@ -1614,6 +1621,8 @@ void cv::calcHist( InputArrayOfArrays images, const std::vector<int>& channels,
const std::vector<float>& ranges,
bool accumulate )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(images.total() == 1 && channels.size() == 1 && images.channels(0) == 1 &&
channels[0] == 0 && images.isUMatVector() && mask.empty() && !accumulate &&
histSize.size() == 1 && histSize[0] == BINS && ranges.size() == 2 &&
@@ -1941,6 +1950,8 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels,
InputArray _hist, OutputArray _backProject,
const float** ranges, double scale, bool uniform )
{
CV_INSTRUMENT_REGION()
Mat hist = _hist.getMat();
std::vector<uchar*> ptrs;
std::vector<int> deltas;
@@ -2104,6 +2115,8 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels,
const SparseMat& hist, OutputArray _backProject,
const float** ranges, double scale, bool uniform )
{
CV_INSTRUMENT_REGION()
std::vector<uchar*> ptrs;
std::vector<int> deltas;
std::vector<double> uniranges;
@@ -2283,6 +2296,8 @@ void cv::calcBackProject( InputArrayOfArrays images, const std::vector<int>& cha
const std::vector<float>& ranges,
double scale )
{
CV_INSTRUMENT_REGION()
#ifdef HAVE_OPENCL
Size histSize = hist.size();
bool _1D = histSize.height == 1 || histSize.width == 1;
@@ -2335,6 +2350,8 @@ void cv::calcBackProject( InputArrayOfArrays images, const std::vector<int>& cha
double cv::compareHist( InputArray _H1, InputArray _H2, int method )
{
CV_INSTRUMENT_REGION()
Mat H1 = _H1.getMat(), H2 = _H2.getMat();
const Mat* arrays[] = {&H1, &H2, 0};
Mat planes[2];
@@ -2541,6 +2558,8 @@ double cv::compareHist( InputArray _H1, InputArray _H2, int method )
double cv::compareHist( const SparseMat& H1, const SparseMat& H2, int method )
{
CV_INSTRUMENT_REGION()
double result = 0;
int i, dims = H1.dims();
@@ -3685,6 +3704,8 @@ static bool ocl_equalizeHist(InputArray _src, OutputArray _dst)
void cv::equalizeHist( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_Assert( _src.type() == CV_8UC1 );
if (_src.empty())
+8 -2
View File
@@ -109,7 +109,7 @@ HoughLinesStandard( const Mat& img, float rho, float theta,
lines.resize(ipp_linesMax);
IppStatus ok = ippiHoughLineGetSize_8u_C1R(srcSize, delta, ipp_linesMax, &bufferSize);
Ipp8u* buffer = ippsMalloc_8u(bufferSize);
if (ok >= 0) ok = ippiHoughLine_Region_8u32f_C1R(image, step, srcSize, (IppPointPolar*) &lines[0], dstRoi, ipp_linesMax, &linesCount, delta, threshold, buffer);
if (ok >= 0) {ok = CV_INSTRUMENT_FUN_IPP(ippiHoughLine_Region_8u32f_C1R,(image, step, srcSize, (IppPointPolar*) &lines[0], dstRoi, ipp_linesMax, &linesCount, delta, threshold, buffer))};
ippsFree(buffer);
if (ok >= 0)
{
@@ -443,7 +443,7 @@ HoughLinesProbabilistic( Mat& image,
Ipp8u* buffer = ippsMalloc_8u(bufferSize);
pSpec = (IppiHoughProbSpec*) malloc(specSize);
if (ok >= 0) ok = ippiHoughProbLineInit_8u32f_C1R(srcSize, delta, ippAlgHintNone, pSpec);
if (ok >= 0) ok = ippiHoughProbLine_8u32f_C1R(image.data, image.step, srcSize, threshold, lineLength, lineGap, (IppiPoint*) &lines[0], ipp_linesMax, &linesCount, buffer, pSpec);
if (ok >= 0) {ok = CV_INSTRUMENT_FUN_IPP(ippiHoughProbLine_8u32f_C1R,(image.data, image.step, srcSize, threshold, lineLength, lineGap, (IppiPoint*) &lines[0], ipp_linesMax, &linesCount, buffer, pSpec))};
free(pSpec);
ippsFree(buffer);
@@ -850,6 +850,8 @@ void cv::HoughLines( InputArray _image, OutputArray _lines,
double rho, double theta, int threshold,
double srn, double stn, double min_theta, double max_theta )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(srn == 0 && stn == 0 && _image.isUMat() && _lines.isUMat(),
ocl_HoughLines(_image, _lines, rho, theta, threshold, min_theta, max_theta));
@@ -869,6 +871,8 @@ void cv::HoughLinesP(InputArray _image, OutputArray _lines,
double rho, double theta, int threshold,
double minLineLength, double maxGap )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_image.isUMat() && _lines.isUMat(),
ocl_HoughLinesP(_image, _lines, rho, theta, threshold, minLineLength, maxGap));
@@ -1322,6 +1326,8 @@ void cv::HoughCircles( InputArray _image, OutputArray _circles,
double param1, double param2,
int minRadius, int maxRadius )
{
CV_INSTRUMENT_REGION()
Ptr<CvMemStorage> storage(cvCreateMemStorage(STORAGE_SIZE));
Mat image = _image.getMat();
CvMat c_image = image;
+48 -14
View File
@@ -69,6 +69,8 @@ namespace cv
template <int channels, typename Type>
bool IPPSetSimple(cv::Scalar value, void *dataPointer, int step, IppiSize &size, ippiSetFunc func)
{
CV_INSTRUMENT_REGION_IPP()
Type values[channels];
for( int i = 0; i < channels; i++ )
values[i] = saturate_cast<Type>(value[i]);
@@ -77,16 +79,18 @@ namespace cv
static bool IPPSet(const cv::Scalar &value, void *dataPointer, int step, IppiSize &size, int channels, int depth)
{
CV_INSTRUMENT_REGION_IPP()
if( channels == 1 )
{
switch( depth )
{
case CV_8U:
return ippiSet_8u_C1R(saturate_cast<Ipp8u>(value[0]), (Ipp8u *)dataPointer, step, size) >= 0;
return CV_INSTRUMENT_FUN_IPP(ippiSet_8u_C1R,(saturate_cast<Ipp8u>(value[0]), (Ipp8u *)dataPointer, step, size)) >= 0;
case CV_16U:
return ippiSet_16u_C1R(saturate_cast<Ipp16u>(value[0]), (Ipp16u *)dataPointer, step, size) >= 0;
return CV_INSTRUMENT_FUN_IPP(ippiSet_16u_C1R,(saturate_cast<Ipp16u>(value[0]), (Ipp16u *)dataPointer, step, size)) >= 0;
case CV_32F:
return ippiSet_32f_C1R(saturate_cast<Ipp32f>(value[0]), (Ipp32f *)dataPointer, step, size) >= 0;
return CV_INSTRUMENT_FUN_IPP(ippiSet_32f_C1R,(saturate_cast<Ipp32f>(value[0]), (Ipp32f *)dataPointer, step, size)) >= 0;
}
}
else
@@ -2712,7 +2716,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
#define CHECK_IPP_STATUS(STATUS) if (STATUS < 0) { *ok = false; return; }
#define SET_IPP_RESIZE_LINEAR_FUNC_PTR(TYPE, CN) \
func = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \
ippiResize = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \
CHECK_IPP_STATUS(ippiResizeGetSize_##TYPE(srcSize, dstSize, (IppiInterpolationType)mode, 0, &specSize, &initSize));\
specBuf.allocate(specSize);\
pSpec = (uchar*)specBuf;\
@@ -2720,7 +2724,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
#define SET_IPP_RESIZE_LINEAR_FUNC_64_PTR(TYPE, CN) \
if (mode == (int)ippCubic) { *ok = false; return; } \
func = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \
ippiResize = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \
CHECK_IPP_STATUS(ippiResizeGetSize_##TYPE(srcSize, dstSize, (IppiInterpolationType)mode, 0, &specSize, &initSize));\
specBuf.allocate(specSize);\
pSpec = (uchar*)specBuf;\
@@ -2729,7 +2733,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
getSrcOffsetFunc = (ippiResizeGetSrcOffset) ippiResizeGetSrcOffset_##TYPE;
#define SET_IPP_RESIZE_CUBIC_FUNC_PTR(TYPE, CN) \
func = (ippiResizeFunc)ippiResizeCubic_##TYPE##_##CN##R; \
ippiResize = (ippiResizeFunc)ippiResizeCubic_##TYPE##_##CN##R; \
CHECK_IPP_STATUS(ippiResizeGetSize_##TYPE(srcSize, dstSize, (IppiInterpolationType)mode, 0, &specSize, &initSize));\
specBuf.allocate(specSize);\
pSpec = (uchar*)specBuf;\
@@ -2752,7 +2756,7 @@ public:
IPPresizeInvoker(const Mat & _src, Mat & _dst, double _inv_scale_x, double _inv_scale_y, int _mode, bool *_ok) :
ParallelLoopBody(), src(_src), dst(_dst), inv_scale_x(_inv_scale_x),
inv_scale_y(_inv_scale_y), pSpec(NULL), mode(_mode),
func(NULL), getBufferSizeFunc(NULL), getSrcOffsetFunc(NULL), ok(_ok)
ippiResize(NULL), getBufferSizeFunc(NULL), getSrcOffsetFunc(NULL), ok(_ok)
{
*ok = true;
IppiSize srcSize, dstSize;
@@ -2791,6 +2795,8 @@ public:
virtual void operator() (const Range& range) const
{
CV_INSTRUMENT_REGION_IPP()
if (*ok == false)
return;
@@ -2812,7 +2818,7 @@ public:
AutoBuffer<uchar> buf(bufsize + 64);
uchar* bufptr = alignPtr((uchar*)buf, 32);
if( func( pSrc, (int)src.step[0], pDst, (int)dst.step[0], dstOffset, dstSize, ippBorderRepl, 0, pSpec, bufptr ) < 0 )
if( CV_INSTRUMENT_FUN_IPP(ippiResize, pSrc, (int)src.step[0], pDst, (int)dst.step[0], dstOffset, dstSize, ippBorderRepl, 0, pSpec, bufptr) < 0 )
*ok = false;
else
{
@@ -2827,7 +2833,7 @@ private:
void *pSpec;
AutoBuffer<uchar> specBuf;
int mode;
ippiResizeFunc func;
ippiResizeFunc ippiResize;
ippiResizeGetBufferSize getBufferSizeFunc;
ippiResizeGetSrcOffset getSrcOffsetFunc;
bool *ok;
@@ -3095,6 +3101,8 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
static bool ipp_resize_mt(Mat & src, Mat & dst,
double inv_scale_x, double inv_scale_y, int interpolation)
{
CV_INSTRUMENT_REGION_IPP()
int mode = -1;
if (interpolation == INTER_LINEAR && src.rows >= 2 && src.cols >= 2)
mode = ippLinear;
@@ -3123,6 +3131,8 @@ void resize(int src_type,
uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
double inv_scale_x, double inv_scale_y, int interpolation)
{
CV_INSTRUMENT_REGION()
CV_Assert((dst_width * dst_height > 0) || (inv_scale_x > 0 && inv_scale_y > 0));
if (inv_scale_x < DBL_EPSILON || inv_scale_y < DBL_EPSILON)
{
@@ -3475,6 +3485,8 @@ void resize(int src_type,
void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
double inv_scale_x, double inv_scale_y, int interpolation )
{
CV_INSTRUMENT_REGION()
Size ssize = _src.size();
CV_Assert( ssize.width > 0 && ssize.height > 0 );
@@ -4760,6 +4772,8 @@ public:
virtual void operator() (const Range & range) const
{
CV_INSTRUMENT_REGION_IPP()
IppiRect srcRoiRect = { 0, 0, src.cols, src.rows };
Mat dstRoi = dst.rowRange(range);
IppiSize dstRoiSize = ippiSize(dstRoi.size());
@@ -4772,9 +4786,9 @@ public:
return;
}
if (ippFunc(src.ptr(), ippiSize(src.size()), (int)src.step, srcRoiRect,
if (CV_INSTRUMENT_FUN_PTR_CALL_IPP(ippFunc,(src.ptr(), ippiSize(src.size()), (int)src.step, srcRoiRect,
map1.ptr<Ipp32f>(), (int)map1.step, map2.ptr<Ipp32f>(), (int)map2.step,
dstRoi.ptr(), (int)dstRoi.step, dstRoiSize, ippInterpolation) < 0)
dstRoi.ptr(), (int)dstRoi.step, dstRoiSize, ippInterpolation)) < 0)
*ok = false;
else
{
@@ -4798,6 +4812,8 @@ void cv::remap( InputArray _src, OutputArray _dst,
InputArray _map1, InputArray _map2,
int interpolation, int borderType, const Scalar& borderValue )
{
CV_INSTRUMENT_REGION()
static RemapNNFunc nn_tab[] =
{
remapNearest<uchar>, remapNearest<schar>, remapNearest<ushort>, remapNearest<short>,
@@ -4940,6 +4956,8 @@ void cv::convertMaps( InputArray _map1, InputArray _map2,
OutputArray _dstmap1, OutputArray _dstmap2,
int dstm1type, bool nninterpolate )
{
CV_INSTRUMENT_REGION()
Mat map1 = _map1.getMat(), map2 = _map2.getMat(), dstmap1, dstmap2;
Size size = map1.size();
const Mat *m1 = &map1, *m2 = &map2;
@@ -5589,6 +5607,8 @@ public:
virtual void operator() (const Range& range) const
{
CV_INSTRUMENT_REGION_IPP()
IppiSize srcsize = { src.cols, src.rows };
IppiRect srcroi = { 0, 0, src.cols, src.rows };
IppiRect dstroi = { 0, range.start, dst.cols, range.end - range.start };
@@ -5605,8 +5625,8 @@ public:
}
// Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr
IppStatus status = func( src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(),
(int)dst.step[0], dstroi, coeffs, mode );
IppStatus status = CV_INSTRUMENT_FUN_PTR_CALL_IPP(func,( src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(),
(int)dst.step[0], dstroi, coeffs, mode ));
if( status < 0)
*ok = false;
else
@@ -5768,6 +5788,8 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
InputArray _M0, Size dsize,
int flags, int borderType, const Scalar& borderValue )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
ocl_warpTransform(_src, _dst, _M0, dsize, flags, borderType,
borderValue, OCL_OP_AFFINE))
@@ -6230,6 +6252,8 @@ public:
virtual void operator() (const Range& range) const
{
CV_INSTRUMENT_REGION_IPP()
IppiSize srcsize = {src.cols, src.rows};
IppiRect srcroi = {0, 0, src.cols, src.rows};
IppiRect dstroi = {0, range.start, dst.cols, range.end - range.start};
@@ -6246,7 +6270,7 @@ public:
}
}
IppStatus status = func(src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(), (int)dst.step[0], dstroi, coeffs, mode);
IppStatus status = CV_INSTRUMENT_FUN_PTR_CALL_IPP(func,(src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(), (int)dst.step[0], dstroi, coeffs, mode));
if (status != ippStsNoErr)
*ok = false;
else
@@ -6290,6 +6314,8 @@ void warpPerspectve(int src_type,
void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
Size dsize, int flags, int borderType, const Scalar& borderValue )
{
CV_INSTRUMENT_REGION()
CV_Assert( _src.total() > 0 );
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
@@ -6381,6 +6407,8 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale )
{
CV_INSTRUMENT_REGION()
angle *= CV_PI/180;
double alpha = cos(angle)*scale;
double beta = sin(angle)*scale;
@@ -6424,6 +6452,8 @@ cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale )
*/
cv::Mat cv::getPerspectiveTransform( const Point2f src[], const Point2f dst[] )
{
CV_INSTRUMENT_REGION()
Mat M(3, 3, CV_64F), X(8, 1, CV_64F, M.ptr());
double a[8][8], b[8];
Mat A(8, 8, CV_64F, a), B(8, 1, CV_64F, b);
@@ -6778,6 +6808,8 @@ cvLogPolar( const CvArr* srcarr, CvArr* dstarr,
void cv::logPolar( InputArray _src, OutputArray _dst,
Point2f center, double M, int flags )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_src.isUMat() && _dst.isUMat(),
ocl_logPolar(_src, _dst, center, M, flags));
Mat src_with_border; // don't scope this variable (it holds image data)
@@ -6987,6 +7019,8 @@ void cvLinearPolar( const CvArr* srcarr, CvArr* dstarr,
void cv::linearPolar( InputArray _src, OutputArray _dst,
Point2f center, double maxRadius, int flags )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_src.isUMat() && _dst.isUMat(),
ocl_linearPolar(_src, _dst, center, maxRadius, flags));
Mat src_with_border; // don't scope this variable (it holds image data)
+2
View File
@@ -49,6 +49,8 @@ namespace cv
int rotatedRectangleIntersection( const RotatedRect& rect1, const RotatedRect& rect2, OutputArray intersectingRegion )
{
CV_INSTRUMENT_REGION()
const float samePointEps = 0.00001f; // used to test if two points are the same
Point2f vec1[4], vec2[4];
+2
View File
@@ -594,6 +594,8 @@ static void fitLine3D( Point3f * points, int count, int dist,
void cv::fitLine( InputArray _points, OutputArray _line, int distType,
double param, double reps, double aeps )
{
CV_INSTRUMENT_REGION()
Mat points = _points.getMat();
float linebuf[6]={0.f};
+6
View File
@@ -412,6 +412,8 @@ LineSegmentDetectorImpl::LineSegmentDetectorImpl(int _refine, double _scale, dou
void LineSegmentDetectorImpl::detect(InputArray _image, OutputArray _lines,
OutputArray _width, OutputArray _prec, OutputArray _nfa)
{
CV_INSTRUMENT_REGION()
Mat_<double> img = _image.getMat();
CV_Assert(!img.empty() && img.channels() == 1);
@@ -1154,6 +1156,8 @@ inline bool LineSegmentDetectorImpl::isAligned(const int& address, const double&
void LineSegmentDetectorImpl::drawSegments(InputOutputArray _image, InputArray lines)
{
CV_INSTRUMENT_REGION()
CV_Assert(!_image.empty() && (_image.channels() == 1 || _image.channels() == 3));
Mat gray;
@@ -1191,6 +1195,8 @@ void LineSegmentDetectorImpl::drawSegments(InputOutputArray _image, InputArray l
int LineSegmentDetectorImpl::compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image)
{
CV_INSTRUMENT_REGION()
Size sz = size;
if (_image.needed() && _image.size() != size) sz = _image.size();
CV_Assert(sz.area());
+2
View File
@@ -43,6 +43,8 @@
double cv::matchShapes(InputArray contour1, InputArray contour2, int method, double)
{
CV_INSTRUMENT_REGION()
double ma[7], mb[7];
int i, sma, smb;
double eps = 1.e-5;
+7 -1
View File
@@ -566,6 +566,8 @@ static bool ocl_moments( InputArray _src, Moments& m, bool binary)
cv::Moments cv::moments( InputArray _src, bool binary )
{
CV_INSTRUMENT_REGION()
const int TILE_SIZE = 32;
MomentsInTileFunc func = 0;
uchar nzbuf[TILE_SIZE*TILE_SIZE];
@@ -609,7 +611,7 @@ cv::Moments cv::moments( InputArray _src, bool binary )
if (ippFunc)
{
if (ippFunc(mat.data, (int)mat.step, roi, moment) >= 0)
if (CV_INSTRUMENT_FUN_IPP(ippFunc,(mat.data, (int)mat.step, roi, moment)) >= 0)
{
IppiPoint point = { 0, 0 };
ippiGetSpatialMoment_64f(moment, 0, 0, 0, point, &m.m00);
@@ -740,6 +742,8 @@ cv::Moments cv::moments( InputArray _src, bool binary )
void cv::HuMoments( const Moments& m, double hu[7] )
{
CV_INSTRUMENT_REGION()
double t0 = m.nu30 + m.nu12;
double t1 = m.nu21 + m.nu03;
@@ -767,6 +771,8 @@ void cv::HuMoments( const Moments& m, double hu[7] )
void cv::HuMoments( const Moments& m, OutputArray _hu )
{
CV_INSTRUMENT_REGION()
_hu.create(7, 1, CV_64F);
Mat hu = _hu.getMat();
CV_Assert( hu.isContinuous() );
+12 -4
View File
@@ -1145,10 +1145,10 @@ struct IppMorphTrait<cvtype>\
IppStatus morphInit(IppiSize roiSize, const Ipp8u* pMask, IppiSize maskSize, IppiMorphState* pMorphSpec, Ipp8u* pBuffer) {return ippiMorphologyBorderInit_##flavor(roiSize, pMask, maskSize, pMorphSpec, pBuffer);}\
IppStatus filterGetMinSize(IppiSize dstRoiSize, IppiSize maskSize, IppDataType dataType, int numChannels, int* pBufferSize) {return ippiFilterMinBorderGetBufferSize(dstRoiSize, maskSize, dataType, numChannels, pBufferSize);}\
IppStatus filterGetMaxSize(IppiSize dstRoiSize, IppiSize maskSize, IppDataType dataType, int numChannels, int* pBufferSize) {return ippiFilterMaxBorderGetBufferSize(dstRoiSize, maskSize, dataType, numChannels, pBufferSize);}\
IppStatus filterMinBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiFilterMinBorder_##flavor(pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\
IppStatus filterMaxBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiFilterMaxBorder_##flavor(pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\
IppStatus morphDilate(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiDilateBorder_##flavor(pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\
IppStatus morphErode(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiErodeBorder_##flavor(pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\
IppStatus filterMinBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiFilterMinBorder_##flavor, pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\
IppStatus filterMaxBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiFilterMaxBorder_##flavor, pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\
IppStatus morphDilate(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiDilateBorder_##flavor, pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\
IppStatus morphErode(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiErodeBorder_##flavor, pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\
};
#else
@@ -1333,6 +1333,8 @@ struct IppMorphImpl : public IppMorphBaseImpl
int roi_width, int roi_height, int roi_x, int roi_y,
int roi_width2, int roi_height2, int roi_x2, int roi_y2)
{
CV_INSTRUMENT_REGION_IPP()
CV_UNUSED(roi_width); CV_UNUSED(roi_height); CV_UNUSED(roi_x); CV_UNUSED(roi_y);
CV_UNUSED(roi_width2); CV_UNUSED(roi_height2); CV_UNUSED(roi_x2); CV_UNUSED(roi_y2);
if (src_data == dst_data)
@@ -1873,6 +1875,8 @@ void cv::erode( InputArray src, OutputArray dst, InputArray kernel,
Point anchor, int iterations,
int borderType, const Scalar& borderValue )
{
CV_INSTRUMENT_REGION()
morphOp( MORPH_ERODE, src, dst, kernel, anchor, iterations, borderType, borderValue );
}
@@ -1881,6 +1885,8 @@ void cv::dilate( InputArray src, OutputArray dst, InputArray kernel,
Point anchor, int iterations,
int borderType, const Scalar& borderValue )
{
CV_INSTRUMENT_REGION()
morphOp( MORPH_DILATE, src, dst, kernel, anchor, iterations, borderType, borderValue );
}
@@ -1952,6 +1958,8 @@ void cv::morphologyEx( InputArray _src, OutputArray _dst, int op,
InputArray _kernel, Point anchor, int iterations,
int borderType, const Scalar& borderValue )
{
CV_INSTRUMENT_REGION()
Mat kernel = _kernel.getMat();
if (kernel.empty())
{
+4
View File
@@ -490,6 +490,8 @@ static Point2d weightedCentroid(InputArray _src, cv::Point peakLocation, cv::Siz
cv::Point2d cv::phaseCorrelate(InputArray _src1, InputArray _src2, InputArray _window, double* response)
{
CV_INSTRUMENT_REGION()
Mat src1 = _src1.getMat();
Mat src2 = _src2.getMat();
Mat window = _window.getMat();
@@ -571,6 +573,8 @@ cv::Point2d cv::phaseCorrelate(InputArray _src1, InputArray _src2, InputArray _w
void cv::createHanningWindow(OutputArray _dst, cv::Size winSize, int type)
{
CV_INSTRUMENT_REGION()
CV_Assert( type == CV_32FC1 || type == CV_64FC1 );
_dst.create(winSize, type);
+12
View File
@@ -1187,6 +1187,8 @@ namespace cv
{
static bool ipp_pyrdown( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType )
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK
Size dsz = _dsz.area() == 0 ? Size((_src.cols() + 1)/2, (_src.rows() + 1)/2) : _dsz;
bool isolated = (borderType & BORDER_ISOLATED) != 0;
@@ -1245,6 +1247,8 @@ static bool ipp_pyrdown( InputArray _src, OutputArray _dst, const Size& _dsz, in
void cv::pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType )
{
CV_INSTRUMENT_REGION()
CV_Assert(borderType != BORDER_CONSTANT);
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
@@ -1292,6 +1296,8 @@ namespace cv
{
static bool ipp_pyrup( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType )
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK
Size sz = _src.dims() <= 2 ? _src.size() : Size();
Size dsz = _dsz.area() == 0 ? Size(_src.cols()*2, _src.rows()*2) : _dsz;
@@ -1348,6 +1354,8 @@ static bool ipp_pyrup( InputArray _src, OutputArray _dst, const Size& _dsz, int
void cv::pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType )
{
CV_INSTRUMENT_REGION()
CV_Assert(borderType == BORDER_DEFAULT);
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
@@ -1396,6 +1404,8 @@ namespace cv
{
static bool ipp_buildpyramid( InputArray _src, OutputArrayOfArrays _dst, int maxlevel, int borderType )
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK
Mat src = _src.getMat();
_dst.create( maxlevel + 1, 1, 0 );
@@ -1506,6 +1516,8 @@ static bool ipp_buildpyramid( InputArray _src, OutputArrayOfArrays _dst, int max
void cv::buildPyramid( InputArray _src, OutputArrayOfArrays _dst, int maxlevel, int borderType )
{
CV_INSTRUMENT_REGION()
CV_Assert(borderType != BORDER_CONSTANT);
if (_src.dims() <= 2 && _dst.isUMatVector())
+4
View File
@@ -346,6 +346,8 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
cv::RotatedRect cv::minAreaRect( InputArray _points )
{
CV_INSTRUMENT_REGION()
Mat hull;
Point2f out[3];
RotatedRect box;
@@ -404,6 +406,8 @@ cvMinAreaRect2( const CvArr* array, CvMemStorage* /*storage*/ )
void cv::boxPoints(cv::RotatedRect box, OutputArray _pts)
{
CV_INSTRUMENT_REGION()
_pts.create(4, 2, CV_32F);
Mat pts = _pts.getMat();
box.points(pts.ptr<Point2f>());
+6 -4
View File
@@ -365,6 +365,8 @@ getQuadrangleSubPix_8u32f_CnR( const uchar* src, size_t src_step, Size src_size,
void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center,
OutputArray _patch, int patchType )
{
CV_INSTRUMENT_REGION()
Mat image = _image.getMat();
int depth = image.depth(), cn = image.channels();
int ddepth = patchType < 0 ? depth : CV_MAT_DEPTH(patchType);
@@ -387,15 +389,15 @@ void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center,
IppiPoint_32f icenter = {center.x, center.y};
IppiSize src_size={image.cols, image.rows}, win_size={patch.cols, patch.rows};
int srctype = image.type();
ippiGetRectSubPixFunc ippfunc =
ippiGetRectSubPixFunc ippiCopySubpixIntersect =
srctype == CV_8UC1 && ddepth == CV_8U ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u_C1R :
srctype == CV_8UC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u32f_C1R :
srctype == CV_32FC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_32f_C1R : 0;
if( ippfunc)
if( ippiCopySubpixIntersect)
{
if (ippfunc(image.ptr(), (int)image.step, src_size, patch.ptr(),
(int)patch.step, win_size, icenter, &minpt, &maxpt) >= 0 )
if (CV_INSTRUMENT_FUN_IPP(ippiCopySubpixIntersect, image.ptr(), (int)image.step, src_size, patch.ptr(),
(int)patch.step, win_size, icenter, &minpt, &maxpt) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
+4
View File
@@ -87,6 +87,8 @@ allocWSNodes( std::vector<WSNode>& storage )
void cv::watershed( InputArray _src, InputOutputArray _markers )
{
CV_INSTRUMENT_REGION()
// Labels for pixels
const int IN_QUEUE = -2; // Pixel visited
const int WSHED = -1; // Pixel belongs to watershed
@@ -332,6 +334,8 @@ void cv::pyrMeanShiftFiltering( InputArray _src, OutputArray _dst,
double sp0, double sr, int max_level,
TermCriteria termcrit )
{
CV_INSTRUMENT_REGION()
Mat src0 = _src.getMat();
if( src0.empty() )
+10
View File
@@ -206,6 +206,8 @@ static void findMinEnclosingCircle(const PT *pts, int count, Point2f &center, fl
// see Welzl, Emo. Smallest enclosing disks (balls and ellipsoids). Springer Berlin Heidelberg, 1991.
void cv::minEnclosingCircle( InputArray _points, Point2f& _center, float& _radius )
{
CV_INSTRUMENT_REGION()
Mat points = _points.getMat();
int count = points.checkVector(2);
int depth = points.depth();
@@ -275,6 +277,8 @@ void cv::minEnclosingCircle( InputArray _points, Point2f& _center, float& _radiu
// calculates length of a curve (e.g. contour perimeter)
double cv::arcLength( InputArray _curve, bool is_closed )
{
CV_INSTRUMENT_REGION()
Mat curve = _curve.getMat();
int count = curve.checkVector(2);
int depth = curve.depth();
@@ -308,6 +312,8 @@ double cv::arcLength( InputArray _curve, bool is_closed )
// area of a whole sequence
double cv::contourArea( InputArray _contour, bool oriented )
{
CV_INSTRUMENT_REGION()
Mat contour = _contour.getMat();
int npoints = contour.checkVector(2);
int depth = contour.depth();
@@ -339,6 +345,8 @@ double cv::contourArea( InputArray _contour, bool oriented )
cv::RotatedRect cv::fitEllipse( InputArray _points )
{
CV_INSTRUMENT_REGION()
Mat points = _points.getMat();
int i, n = points.checkVector(2);
int depth = points.depth();
@@ -668,6 +676,8 @@ static Rect maskBoundingRect( const Mat& img )
cv::Rect cv::boundingRect(InputArray array)
{
CV_INSTRUMENT_REGION()
Mat m = array.getMat();
return m.depth() <= CV_8U ? maskBoundingRect(m) : pointSetBoundingRect(m);
}
+24 -4
View File
@@ -1367,6 +1367,8 @@ static bool ipp_boxfilter( InputArray _src, OutputArray _dst, int ddepth,
Size ksize, Point anchor,
bool normalize, int borderType )
{
CV_INSTRUMENT_REGION_IPP()
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype);
if( ddepth < 0 )
ddepth = sdepth;
@@ -1405,7 +1407,7 @@ static bool ipp_boxfilter( InputArray _src, OutputArray _dst, int ddepth,
Ipp8u * buffer = ippsMalloc_8u(bufSize); \
ippType borderValue[4] = { 0, 0, 0, 0 }; \
ippBorderType = ippBorderType == BORDER_CONSTANT ? ippBorderConst : ippBorderRepl; \
IppStatus status = ippiFilterBoxBorder_##flavor(src.ptr<ippType>(), (int)src.step, dst.ptr<ippType>(), \
IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiFilterBoxBorder_##flavor, src.ptr<ippType>(), (int)src.step, dst.ptr<ippType>(), \
(int)dst.step, roiSize, maskSize, \
(IppiBorderType)ippBorderType, borderValue, buffer); \
ippsFree(buffer); \
@@ -1459,6 +1461,8 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
Size ksize, Point anchor,
bool normalize, int borderType )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN(_dst.isUMat(), ocl_boxFilter(_src, _dst, ddepth, ksize, anchor, borderType, normalize))
Mat src = _src.getMat();
@@ -1507,6 +1511,8 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
void cv::blur( InputArray src, OutputArray dst,
Size ksize, Point anchor, int borderType )
{
CV_INSTRUMENT_REGION()
boxFilter( src, dst, -1, ksize, anchor, true, borderType );
}
@@ -1589,6 +1595,8 @@ void cv::sqrBoxFilter( InputArray _src, OutputArray _dst, int ddepth,
Size ksize, Point anchor,
bool normalize, int borderType )
{
CV_INSTRUMENT_REGION()
int srcType = _src.type(), sdepth = CV_MAT_DEPTH(srcType), cn = CV_MAT_CN(srcType);
Size size = _src.size();
@@ -1733,6 +1741,8 @@ static bool ipp_GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
double sigma1, double sigma2,
int borderType )
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810
if ((borderType & BORDER_ISOLATED) == 0 && _src.isSubmatrix())
return false;
@@ -1771,14 +1781,14 @@ static bool ipp_GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
#define IPP_FILTER_GAUSS_C1(ippfavor) \
{ \
Ipp##ippfavor borderValues = 0; \
status = ippiFilterGaussianBorder_##ippfavor##_C1R(src.ptr<Ipp##ippfavor>(), (int)src.step, \
status = CV_INSTRUMENT_FUN_IPP(ippiFilterGaussianBorder_##ippfavor##_C1R, src.ptr<Ipp##ippfavor>(), (int)src.step, \
dst.ptr<Ipp##ippfavor>(), (int)dst.step, roiSize, borderValues, spec, buffer); \
}
#define IPP_FILTER_GAUSS_CN(ippfavor, ippcn) \
{ \
Ipp##ippfavor borderValues[] = { 0, 0, 0 }; \
status = ippiFilterGaussianBorder_##ippfavor##_C##ippcn##R(src.ptr<Ipp##ippfavor>(), (int)src.step, \
status = CV_INSTRUMENT_FUN_IPP(ippiFilterGaussianBorder_##ippfavor##_C##ippcn##R, src.ptr<Ipp##ippfavor>(), (int)src.step, \
dst.ptr<Ipp##ippfavor>(), (int)dst.step, roiSize, borderValues, spec, buffer); \
}
@@ -1825,6 +1835,8 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
double sigma1, double sigma2,
int borderType )
{
CV_INSTRUMENT_REGION()
int type = _src.type();
Size size = _src.size();
_dst.create( size, type );
@@ -2768,6 +2780,8 @@ namespace cv
{
static bool ipp_medianFilter( InputArray _src0, OutputArray _dst, int ksize )
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810
Mat src0 = _src0.getMat();
_dst.create( src0.size(), src0.type() );
@@ -2780,7 +2794,7 @@ static bool ipp_medianFilter( InputArray _src0, OutputArray _dst, int ksize )
ippDataType, CV_MAT_CN(type), &bufSize) >= 0) \
{ \
Ipp8u * buffer = ippsMalloc_8u(bufSize); \
IppStatus status = ippiFilterMedianBorder_##flavor(src.ptr<ippType>(), (int)src.step, \
IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiFilterMedianBorder_##flavor, src.ptr<ippType>(), (int)src.step, \
dst.ptr<ippType>(), (int)dst.step, dstRoiSize, maskSize, \
ippBorderRepl, (ippType)0, buffer); \
ippsFree(buffer); \
@@ -2824,6 +2838,8 @@ static bool ipp_medianFilter( InputArray _src0, OutputArray _dst, int ksize )
void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize )
{
CV_INSTRUMENT_REGION()
CV_Assert( (ksize % 2 == 1) && (_src0.dims() <= 2 ));
if( ksize <= 1 )
@@ -3070,6 +3086,8 @@ public:
virtual void operator() (const Range& range) const
{
CV_INSTRUMENT_REGION_IPP()
int d = radius * 2 + 1;
IppiSize kernel = {d, d};
IppiSize roi={dst.cols, range.end - range.start};
@@ -3665,6 +3683,8 @@ void cv::bilateralFilter( InputArray _src, OutputArray _dst, int d,
double sigmaColor, double sigmaSpace,
int borderType )
{
CV_INSTRUMENT_REGION()
_dst.create( _src.size(), _src.type() );
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
+1
View File
@@ -78,6 +78,7 @@ static inline void spatialGradientKernel( T& vx, T& vy,
void spatialGradient( InputArray _src, OutputArray _dx, OutputArray _dy,
int ksize, int borderType )
{
CV_INSTRUMENT_REGION()
// Prepare InputArray src
Mat src = _src.getMat();
+10
View File
@@ -275,6 +275,8 @@ void Subdiv2D::deletePoint(int vidx)
int Subdiv2D::locate(Point2f pt, int& _edge, int& _vertex)
{
CV_INSTRUMENT_REGION()
int vertex = 0;
int i, maxEdges = (int)(qedges.size() * 4);
@@ -409,6 +411,8 @@ isPtInCircle3( Point2f pt, Point2f a, Point2f b, Point2f c)
int Subdiv2D::insert(Point2f pt)
{
CV_INSTRUMENT_REGION()
int curr_point = 0, curr_edge = 0, deleted_edge = 0;
int location = locate( pt, curr_edge, curr_point );
@@ -479,12 +483,16 @@ int Subdiv2D::insert(Point2f pt)
void Subdiv2D::insert(const std::vector<Point2f>& ptvec)
{
CV_INSTRUMENT_REGION()
for( size_t i = 0; i < ptvec.size(); i++ )
insert(ptvec[i]);
}
void Subdiv2D::initDelaunay( Rect rect )
{
CV_INSTRUMENT_REGION()
float big_coord = 3.f * MAX( rect.width, rect.height );
float rx = (float)rect.x;
float ry = (float)rect.y;
@@ -644,6 +652,8 @@ isRightOf2( const Point2f& pt, const Point2f& org, const Point2f& diff )
int Subdiv2D::findNearest(Point2f pt, Point2f* nearestPt)
{
CV_INSTRUMENT_REGION()
if( !validGeometry )
calcVoronoi();
+12 -4
View File
@@ -425,6 +425,8 @@ namespace cv
{
static bool ipp_integral(InputArray _src, OutputArray _sum, OutputArray _sqsum, OutputArray _tilted, int sdepth, int sqdepth)
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 != 900 // Disabled on ICV due invalid results
int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
if( sdepth <= 0 )
@@ -452,22 +454,22 @@ static bool ipp_integral(InputArray _src, OutputArray _sum, OutputArray _sqsum,
{
if( _sqsum.needed() )
{
status = ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0 );
status = CV_INSTRUMENT_FUN_IPP(ippiSqrIntegral_8u32f64f_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0);
}
else
{
status = ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, srcRoiSize, 0 );
status = CV_INSTRUMENT_FUN_IPP(ippiIntegral_8u32f_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, srcRoiSize, 0);
}
}
else if( sdepth == CV_32S )
{
if( _sqsum.needed() )
{
status = ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0 );
status = CV_INSTRUMENT_FUN_IPP(ippiSqrIntegral_8u32s64f_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0);
}
else
{
status = ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, srcRoiSize, 0 );
status = CV_INSTRUMENT_FUN_IPP(ippiIntegral_8u32s_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, srcRoiSize, 0);
}
}
if (0 <= status)
@@ -486,6 +488,8 @@ static bool ipp_integral(InputArray _src, OutputArray _sum, OutputArray _sqsum,
void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, OutputArray _tilted, int sdepth, int sqdepth )
{
CV_INSTRUMENT_REGION()
int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
if( sdepth <= 0 )
sdepth = depth == CV_8U ? CV_32S : CV_64F;
@@ -559,11 +563,15 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output
void cv::integral( InputArray src, OutputArray sum, int sdepth )
{
CV_INSTRUMENT_REGION()
integral( src, sum, noArray(), noArray(), sdepth );
}
void cv::integral( InputArray src, OutputArray sum, OutputArray sqsum, int sdepth, int sqdepth )
{
CV_INSTRUMENT_REGION()
integral( src, sum, sqsum, noArray(), sdepth, sqdepth );
}
+14 -6
View File
@@ -566,6 +566,8 @@ typedef IppStatus (CV_STDCALL * ippimatchTemplate)(const void*, int, IppiSize, c
static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst)
{
CV_INSTRUMENT_REGION_IPP()
IppStatus status;
IppiSize srcRoiSize = {src.cols,src.rows};
@@ -576,11 +578,11 @@ static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst)
int depth = src.depth();
ippimatchTemplate ippFunc =
ippimatchTemplate ippiCrossCorrNorm =
depth==CV_8U ? (ippimatchTemplate)ippiCrossCorrNorm_8u32f_C1R:
depth==CV_32F? (ippimatchTemplate)ippiCrossCorrNorm_32f_C1R: 0;
if (ippFunc==0)
if (ippiCrossCorrNorm==0)
return false;
IppEnum funCfg = (IppEnum)(ippAlgAuto | ippiNormNone | ippiROIValid);
@@ -591,7 +593,7 @@ static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst)
pBuffer = ippsMalloc_8u( bufSize );
status = ippFunc(src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr<Ipp32f>(), (int)dst.step, funCfg, pBuffer);
status = CV_INSTRUMENT_FUN_IPP(ippiCrossCorrNorm, src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr<Ipp32f>(), (int)dst.step, funCfg, pBuffer);
ippsFree( pBuffer );
return status >= 0;
@@ -599,6 +601,8 @@ static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst)
static bool ipp_sqrDistance(const Mat& src, const Mat& tpl, Mat& dst)
{
CV_INSTRUMENT_REGION_IPP()
IppStatus status;
IppiSize srcRoiSize = {src.cols,src.rows};
@@ -609,11 +613,11 @@ static bool ipp_sqrDistance(const Mat& src, const Mat& tpl, Mat& dst)
int depth = src.depth();
ippimatchTemplate ippFunc =
ippimatchTemplate ippiSqrDistanceNorm =
depth==CV_8U ? (ippimatchTemplate)ippiSqrDistanceNorm_8u32f_C1R:
depth==CV_32F? (ippimatchTemplate)ippiSqrDistanceNorm_32f_C1R: 0;
if (ippFunc==0)
if (ippiSqrDistanceNorm==0)
return false;
IppEnum funCfg = (IppEnum)(ippAlgAuto | ippiNormNone | ippiROIValid);
@@ -624,7 +628,7 @@ static bool ipp_sqrDistance(const Mat& src, const Mat& tpl, Mat& dst)
pBuffer = ippsMalloc_8u( bufSize );
status = ippFunc(src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr<Ipp32f>(), (int)dst.step, funCfg, pBuffer);
status = CV_INSTRUMENT_FUN_IPP(ippiSqrDistanceNorm, src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr<Ipp32f>(), (int)dst.step, funCfg, pBuffer);
ippsFree( pBuffer );
return status >= 0;
@@ -1041,6 +1045,8 @@ namespace cv
{
static bool ipp_matchTemplate( Mat& img, Mat& templ, Mat& result, int method, int cn )
{
CV_INSTRUMENT_REGION_IPP()
bool useIppMT = (templ.rows < img.rows/2 && templ.cols < img.cols/2);
if(cn == 1 && useIppMT)
@@ -1069,6 +1075,8 @@ static bool ipp_matchTemplate( Mat& img, Mat& templ, Mat& result, int method, in
void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result, int method, InputArray _mask )
{
CV_INSTRUMENT_REGION()
if (!_mask.empty())
{
cv::matchTemplateMask(_img, _templ, _result, method, _mask);
+22 -16
View File
@@ -91,12 +91,12 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
switch( type )
{
case THRESH_TRUNC:
if (_src.data == _dst.data && ippiThreshold_GT_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh) >= 0)
if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_8u_C1IR, _dst.ptr(), (int)dst_step, sz, thresh) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
}
if (ippiThreshold_GT_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh) >= 0)
if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_8u_C1R, _src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -104,12 +104,12 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
setIppErrorStatus();
break;
case THRESH_TOZERO:
if (_src.data == _dst.data && ippiThreshold_LTVal_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0)
if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_8u_C1IR, _dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
}
if (ippiThreshold_LTVal_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0)
if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_8u_C1R, _src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh + 1, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -117,12 +117,12 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
setIppErrorStatus();
break;
case THRESH_TOZERO_INV:
if (_src.data == _dst.data && ippiThreshold_GTVal_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0)
if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_8u_C1IR, _dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
}
if (ippiThreshold_GTVal_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0)
if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_8u_C1R, _src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -428,12 +428,12 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
switch( type )
{
case THRESH_TRUNC:
if (_src.data == _dst.data && ippiThreshold_GT_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0)
if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_16s_C1IR, dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
}
if (ippiThreshold_GT_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0)
if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_16s_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -441,12 +441,12 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
setIppErrorStatus();
break;
case THRESH_TOZERO:
if (_src.data == _dst.data && ippiThreshold_LTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0)
if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_16s_C1IR, dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
}
if (ippiThreshold_LTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh+1, 0) >= 0)
if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_16s_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -454,12 +454,12 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
setIppErrorStatus();
break;
case THRESH_TOZERO_INV:
if (_src.data == _dst.data && ippiThreshold_GTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0)
if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_16s_C1IR, dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
}
if (ippiThreshold_GTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0)
if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_16s_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -689,7 +689,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
switch( type )
{
case THRESH_TRUNC:
if (0 <= ippiThreshold_GT_32f_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh))
if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh))
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -697,7 +697,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
setIppErrorStatus();
break;
case THRESH_TOZERO:
if (0 <= ippiThreshold_LTVal_32f_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh+FLT_EPSILON, 0))
if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh + FLT_EPSILON, 0))
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -705,7 +705,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
setIppErrorStatus();
break;
case THRESH_TOZERO_INV:
if (0 <= ippiThreshold_GTVal_32f_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0))
if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0))
{
CV_IMPL_ADD(CV_IMPL_IPP);
return;
@@ -1176,11 +1176,13 @@ thresh_64f(const Mat& _src, Mat& _dst, double thresh, double maxval, int type)
#ifdef HAVE_IPP
static bool ipp_getThreshVal_Otsu_8u( const unsigned char* _src, int step, Size size, unsigned char &thresh)
{
CV_INSTRUMENT_REGION_IPP()
#if IPP_VERSION_X100 >= 810
int ippStatus = -1;
IppiSize srcSize = { size.width, size.height };
CV_SUPPRESS_DEPRECATED_START
ippStatus = ippiComputeThreshold_Otsu_8u_C1R(_src, step, srcSize, &thresh);
ippStatus = CV_INSTRUMENT_FUN_IPP(ippiComputeThreshold_Otsu_8u_C1R, _src, step, srcSize, &thresh);
CV_SUPPRESS_DEPRECATED_END
if(ippStatus >= 0)
@@ -1464,6 +1466,8 @@ static bool ocl_threshold( InputArray _src, OutputArray _dst, double & thresh, d
double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double maxval, int type )
{
CV_INSTRUMENT_REGION()
CV_OCL_RUN_(_src.dims() <= 2 && _dst.isUMat(),
ocl_threshold(_src, _dst, thresh, maxval, type), thresh)
@@ -1557,6 +1561,8 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m
void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue,
int method, int type, int blockSize, double delta )
{
CV_INSTRUMENT_REGION()
Mat src = _src.getMat();
CV_Assert( src.type() == CV_8UC1 );
CV_Assert( blockSize % 2 == 1 && blockSize > 1 );
+2
View File
@@ -182,6 +182,8 @@ void cv::initUndistortRectifyMap( InputArray _cameraMatrix, InputArray _distCoef
void cv::undistort( InputArray _src, OutputArray _dst, InputArray _cameraMatrix,
InputArray _distCoeffs, InputArray _newCameraMatrix )
{
CV_INSTRUMENT_REGION()
Mat src = _src.getMat(), cameraMatrix = _cameraMatrix.getMat();
Mat distCoeffs = _distCoeffs.getMat(), newCameraMatrix = _newCameraMatrix.getMat();