|
|
|
@ -1295,11 +1295,19 @@ 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) |
|
|
|
|
GaussianBlur(src, mean, Size(blockSize, blockSize), 0, 0, BORDER_REPLICATE); |
|
|
|
|
else if (method == ADAPTIVE_THRESH_GAUSSIAN_C_FLOAT) |
|
|
|
|
{ |
|
|
|
|
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" ); |
|
|
|
|
|
|
|
|
|