From 762138e77e25905c804dd958073ee8abc1bf2538 Mon Sep 17 00:00:00 2001 From: elenagvo Date: Tue, 28 Nov 2017 15:55:58 +0300 Subject: [PATCH] define adaptiveMethod and thresholdType for HAL --- .../include/opencv2/imgproc/hal/interface.h | 20 +++++++++++++++++++ modules/imgproc/src/thresh.cpp | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/imgproc/include/opencv2/imgproc/hal/interface.h b/modules/imgproc/include/opencv2/imgproc/hal/interface.h index 23eb0baa40..f8dbcfe791 100644 --- a/modules/imgproc/include/opencv2/imgproc/hal/interface.h +++ b/modules/imgproc/include/opencv2/imgproc/hal/interface.h @@ -21,6 +21,26 @@ #define CV_HAL_MORPH_DILATE 1 //! @} +//! @name Threshold types +//! @sa cv::ThresholdTypes +//! @{ +#define CV_HAL_THRESH_BINARY 0 +#define CV_HAL_THRESH_BINARY_INV 1 +#define CV_HAL_THRESH_TRUNC 2 +#define CV_HAL_THRESH_TOZERO 3 +#define CV_HAL_THRESH_TOZERO_INV 4 +#define CV_HAL_THRESH_MASK 7 +#define CV_HAL_THRESH_OTSU 8 +#define CV_HAL_THRESH_TRIANGLE 16 +//! @} + +//! @name Adaptive threshold algorithm +//! @sa cv::AdaptiveThresholdTypes +//! @{ +#define CV_HAL_ADAPTIVE_THRESH_MEAN_C 0 +#define CV_HAL_ADAPTIVE_THRESH_GAUSSIAN_C 1 +//! @} + //! @} #endif diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 5a802b915f..b87f48e67c 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -1549,7 +1549,7 @@ void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue, Mat srcfloat,meanfloat; src.convertTo(srcfloat,CV_32F); meanfloat=srcfloat; - GaussianBlur(srcfloat, meanfloat, Size(blockSize, blockSize), 0, 0, BORDER_REPLICATE); + GaussianBlur(srcfloat, meanfloat, Size(blockSize, blockSize), 0, 0, BORDER_REPLICATE|BORDER_ISOLATED); meanfloat.convertTo(mean, src.type()); } else