mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
add HAL for adaptiveThreshold
This commit is contained in:
@@ -630,6 +630,23 @@ inline int hal_ni_medianBlur(const uchar* src_data, size_t src_step, uchar* dst_
|
||||
#define cv_hal_medianBlur hal_ni_medianBlur
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
@brief Calculates adaptive threshold
|
||||
@param src_data,src_step Source image
|
||||
@param dst_data,dst_step Destination image
|
||||
@param width,height Source image dimensions
|
||||
@param maxValue Value assigned to the pixels for which the condition is satisfied
|
||||
@param adaptiveMethod Adaptive thresholding algorithm
|
||||
@param thresholdType Thresholding type
|
||||
@param blockSize Size of a pixel neighborhood that is used to calculate a threshold value
|
||||
@param C Constant subtracted from the mean or weighted mean
|
||||
*/
|
||||
inline int hal_ni_adaptiveThreshold(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||
|
||||
//! @cond IGNORED
|
||||
#define cv_hal_adaptiveThreshold hal_ni_adaptiveThreshold
|
||||
//! @endcond
|
||||
|
||||
//! @}
|
||||
|
||||
#if defined __GNUC__
|
||||
|
||||
@@ -1530,6 +1530,9 @@ void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue,
|
||||
return;
|
||||
}
|
||||
|
||||
CALL_HAL(adaptiveThreshold, cv_hal_adaptiveThreshold, src.data, src.step, dst.data, dst.step, src.cols, src.rows,
|
||||
maxValue, method, type, blockSize, delta);
|
||||
|
||||
Mat mean;
|
||||
|
||||
if( src.data != dst.data )
|
||||
@@ -1537,7 +1540,7 @@ void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue,
|
||||
|
||||
if (method == ADAPTIVE_THRESH_MEAN_C)
|
||||
boxFilter( src, mean, src.type(), Size(blockSize, blockSize),
|
||||
Point(-1,-1), true, BORDER_REPLICATE );
|
||||
Point(-1,-1), true, BORDER_REPLICATE|BORDER_ISOLATED );
|
||||
else if (method == ADAPTIVE_THRESH_GAUSSIAN_C)
|
||||
{
|
||||
Mat srcfloat,meanfloat;
|
||||
|
||||
Reference in New Issue
Block a user