mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Merge pull request #4149 from LaurentBerger:ThreshGaussianFloat
This commit is contained in:
commit
4a2aad5bba
@ -1301,11 +1301,17 @@ void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue,
|
||||
if( src.data != dst.data )
|
||||
mean = dst;
|
||||
|
||||
if( method == ADAPTIVE_THRESH_MEAN_C )
|
||||
if (method == ADAPTIVE_THRESH_MEAN_C)
|
||||
boxFilter( src, mean, src.type(), Size(blockSize, blockSize),
|
||||
Point(-1,-1), true, BORDER_REPLICATE );
|
||||
else if( method == ADAPTIVE_THRESH_GAUSSIAN_C )
|
||||
GaussianBlur( src, mean, Size(blockSize, blockSize), 0, 0, BORDER_REPLICATE );
|
||||
else if (method == ADAPTIVE_THRESH_GAUSSIAN_C)
|
||||
{
|
||||
Mat srcfloat,meanfloat;
|
||||
src.convertTo(srcfloat,CV_32F);
|
||||
meanfloat=srcfloat;
|
||||
GaussianBlur(srcfloat, meanfloat, Size(blockSize, blockSize), 0, 0, BORDER_REPLICATE);
|
||||
meanfloat.convertTo(dst, src.type());
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadFlag, "Unknown/unsupported adaptive threshold method" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user