1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

disabled 64f IPP DFT; added IPP Gaussian filter; added IPP GetRectSubPix; added IPP BilateralFilter (temporarily disabled)

This commit is contained in:
Vadim Pisarevsky
2013-08-06 18:31:06 +04:00
parent 2911b12145
commit 10fde1ca5c
4 changed files with 94 additions and 57 deletions
+18
View File
@@ -519,6 +519,12 @@ typedef CvStatus (CV_STDCALL *CvGetRectSubPixFunc)( const void* src, int src_ste
int dst_step, CvSize win_size,
CvPoint2D32f center );
typedef CvStatus (CV_STDCALL *CvIPPGetRectSubPixFunc)( const void* src, int src_step,
CvSize src_size, void* dst,
int dst_step, CvSize win_size,
CvPoint2D32f center,
CvPoint* minpt, CvPoint* maxpt );
CV_IMPL void
cvGetRectSubPix( const void* srcarr, void* dstarr, CvPoint2D32f center )
{
@@ -556,6 +562,18 @@ cvGetRectSubPix( const void* srcarr, void* dstarr, CvPoint2D32f center )
//if( dst_size.width > src_size.width || dst_size.height > src_size.height )
// CV_ERROR( CV_StsBadSize, "destination ROI must be smaller than source ROI" );
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
CvPoint minpt, maxpt;
int srctype = CV_MAT_TYPE(src->type), dsttype = CV_MAT_TYPE(dst->type);
CvIPPGetRectSubPixFunc ippfunc =
srctype == CV_8UC1 && dsttype == CV_8UC1 ? (CvIPPGetRectSubPixFunc)ippiCopySubpixIntersect_8u_C1R :
srctype == CV_8UC1 && dsttype == CV_32FC1 ? (CvIPPGetRectSubPixFunc)ippiCopySubpixIntersect_8u32f_C1R :
srctype == CV_32FC1 && dsttype == CV_32FC1 ? (CvIPPGetRectSubPixFunc)ippiCopySubpixIntersect_32f_C1R : 0;
if( ippfunc && ippfunc(src->data.ptr, src->step, src_size, dst->data.ptr,
dst->step, dst_size, center, &minpt, &maxpt) >= 0 )
return;
#endif
if( CV_ARE_DEPTHS_EQ( src, dst ))
{
+39
View File
@@ -856,6 +856,22 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
return;
#endif
#if defined HAVE_IPP && (IPP_VERSION_MAJOR >= 7)
if(src.type() == CV_32FC1 && sigma1 == sigma2 && ksize.width == ksize.height && sigma1 != 0.0 )
{
IppiSize roi = {src.cols, src.rows};
int bufSize = 0;
ippiFilterGaussGetBufferSize_32f_C1R(roi, ksize.width, &bufSize);
AutoBuffer<uchar> buf(bufSize+128);
if( ippiFilterGaussBorder_32f_C1R((const Ipp32f *)src.data, (int)src.step,
(Ipp32f *)dst.data, (int)dst.step,
roi, ksize.width, (Ipp32f)sigma1,
(IppiBorderType)borderType, 0.0,
alignPtr(&buf[0],32)) >= 0 )
return;
}
#endif
Ptr<FilterEngine> f = createGaussianFilter( src.type(), ksize, sigma1, sigma2, borderType );
f->apply( src, dst );
}
@@ -1888,6 +1904,29 @@ bilateralFilter_8u( const Mat& src, Mat& dst, int d,
radius = MAX(radius, 1);
d = radius*2 + 1;
#if 0 && defined HAVE_IPP && (IPP_VERSION_MAJOR >= 7)
if(cn == 1)
{
IppiSize kernel = {d, d};
IppiSize roi={src.cols, src.rows};
int bufsize=0;
ippiFilterBilateralGetBufSize_8u_C1R( ippiFilterBilateralGauss, roi, kernel, &bufsize);
AutoBuffer<uchar> buf(bufsize+128);
IppiFilterBilateralSpec *pSpec = (IppiFilterBilateralSpec *)alignPtr(&buf[0], 32);
ippiFilterBilateralInit_8u_C1R( ippiFilterBilateralGauss, kernel, sigma_color*sigma_color, sigma_space*sigma_space, 1, pSpec );
Mat tsrc;
const Mat* psrc = &src;
if( src.data == dst.data )
{
src.copyTo(tsrc);
psrc = &tsrc;
}
if( ippiFilterBilateral_8u_C1R(psrc->data, (int)psrc->step[0],
dst.data, (int)dst.step[0],
roi, kernel, pSpec) >= 0 )
return;
}
#endif
Mat temp;
copyMakeBorder( src, temp, radius, radius, radius, radius, borderType );