阈值分割之自适应阈值原理及adaptiveThreshold参数意义

OpenCV自适应阈值原理及参数意义

opencv自适应阈值原理

1、先将原图像进行平滑(均值平滑,中值平滑,高斯平滑…),得到一个平滑后的图像记为smoothImg;
2、得到自适应矩阵 Thresh = (1-ratio)*smoothImg ; ratio一般为0.15
3、利用局部阈值进行分割 , 即利用Thresh和原图进行比较分割
优点是对于光照不均匀的图像进行二值化处理,相对会比全局性的二值化(OTSU算法和最大熵算法、全局Thresh)效果会好。

adaptiveThreshold参数意义


@param src Source 8-bit single-channel image.
@param dst Destination image of the same size and the same type as src.
@param maxValue Non-zero value assigned to the pixels for which the condition is satisfied
@param adaptiveMethod Adaptive thresholding algorithm to use, see #AdaptiveThresholdTypes.
The #BORDER_REPLICATE | #BORDER_ISOLATED is used to process boundaries.
@param thresholdType Thresholding type that must be either #THRESH_BINARY or #THRESH_BINARY_INV,
see #ThresholdTypes.
@param blockSize Size of a pixel neighborhood that is used to calculate a threshold value for the
pixel: 3, 5, 7, and so on.
@param C Constant subtracted from the mean or
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值