mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
Merge pull request #25397 from asmorkalov:as/HAL_GaussianBlur_bit_exact
Added HAL function for popular bit-exact branch of GaussianBlur with sigma=0
This commit is contained in:
commit
05a54b1405
@ -885,7 +885,7 @@ inline int hal_ni_boxFilter(const uchar* src_data, size_t src_step, uchar* dst_d
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
@brief Blurs an image using a Gaussian filter.
|
||||
@brief Blurs an image using a generic Gaussian filter.
|
||||
@param src_data Source image data
|
||||
@param src_step Source image step
|
||||
@param dst_data Destination image data
|
||||
@ -910,6 +910,29 @@ inline int hal_ni_gaussianBlur(const uchar* src_data, size_t src_step, uchar* ds
|
||||
#define cv_hal_gaussianBlur hal_ni_gaussianBlur
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
@brief Blurs an image using a symmetric Gaussian filter with square kernel and sigma=0.
|
||||
@param src_data Source image data
|
||||
@param src_step Source image step
|
||||
@param dst_data Destination image data
|
||||
@param dst_step Destination image step
|
||||
@param width Source image width
|
||||
@param height Source image height
|
||||
@param depth Depth of source and destination image
|
||||
@param cn Number of channels
|
||||
@param margin_left Left margins for source image
|
||||
@param margin_top Top margins for source image
|
||||
@param margin_right Right margins for source image
|
||||
@param margin_bottom Bottom margins for source image
|
||||
@param ksize Width of kernel
|
||||
@param border_type Border type
|
||||
*/
|
||||
inline int hal_ni_gaussianBlurBinomial(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int depth, int cn, size_t margin_left, size_t margin_top, size_t margin_right, size_t margin_bottom, size_t ksize, int border_type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||
|
||||
//! @cond IGNORED
|
||||
#define cv_hal_gaussianBlurBinomial hal_ni_gaussianBlurBinomial
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
@brief Computes Sobel derivatives
|
||||
@param src_depth Depth of source image
|
||||
|
@ -683,8 +683,22 @@ void GaussianBlur(InputArray _src, OutputArray _dst, Size ksize,
|
||||
|
||||
if (src.data == dst.data)
|
||||
src = src.clone();
|
||||
|
||||
if ((sigma1 == 0.0) && (sigma2 == 0.0) && (ksize.height == ksize.width))
|
||||
{
|
||||
Point ofs;
|
||||
Size wsz(src.cols, src.rows);
|
||||
Mat src2 = src;
|
||||
if(!(borderType & BORDER_ISOLATED))
|
||||
src2.locateROI( wsz, ofs );
|
||||
|
||||
CALL_HAL(gaussianBlurBinomial, cv_hal_gaussianBlurBinomial, src2.ptr(), src2.step, dst.ptr(), dst.step, src2.cols, src2.rows, sdepth, cn,
|
||||
ofs.x, ofs.y, wsz.width - src2.cols - ofs.x, wsz.height - src2.rows - ofs.y, ksize.width, borderType&~BORDER_ISOLATED);
|
||||
}
|
||||
|
||||
CV_CPU_DISPATCH(GaussianBlurFixedPoint, (src, dst, (const uint16_t*)&fkx[0], (int)fkx.size(), (const uint16_t*)&fky[0], (int)fky.size(), borderType),
|
||||
CV_CPU_DISPATCH_MODES_ALL);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -720,8 +734,22 @@ void GaussianBlur(InputArray _src, OutputArray _dst, Size ksize,
|
||||
|
||||
if (src.data == dst.data)
|
||||
src = src.clone();
|
||||
|
||||
if ((sigma1 == 0.0) && (sigma2 == 0.0) && (ksize.height == ksize.width))
|
||||
{
|
||||
Point ofs;
|
||||
Size wsz(src.cols, src.rows);
|
||||
Mat src2 = src;
|
||||
if(!(borderType & BORDER_ISOLATED))
|
||||
src2.locateROI( wsz, ofs );
|
||||
|
||||
CALL_HAL(gaussianBlurBinomial, cv_hal_gaussianBlurBinomial, src2.ptr(), src2.step, dst.ptr(), dst.step, src2.cols, src2.rows, sdepth, cn,
|
||||
ofs.x, ofs.y, wsz.width - src2.cols - ofs.x, wsz.height - src2.rows - ofs.y, ksize.width, borderType&~BORDER_ISOLATED);
|
||||
}
|
||||
|
||||
CV_CPU_DISPATCH(GaussianBlurFixedPoint, (src, dst, (const uint32_t*)&fkx[0], (int)fkx.size(), (const uint32_t*)&fky[0], (int)fky.size(), borderType),
|
||||
CV_CPU_DISPATCH_MODES_ALL);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user