1.腐蚀
操作对象:二值图像(黑/白)
目的:去除图片上的噪声(白色)
原理参考:形态学-腐蚀、膨胀、开操作、闭操作_Fishmemory的博客-CSDN博客
结构A被结构B腐蚀的定义为,
可以理解为,移动结构B,如果结构B与结构A的交集完全属于结构A的区域内,则保存该位置点,所有满足条件的点构成结构A被结构B腐蚀的结果。
接口函数:
cv.erode(
src,
kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]
)
-> dst
参数说明:
src input image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. dst output image of the same size and type as src. kernel structuring element used for erosion; if element=Mat()
, a3 x 3
rectangular structuring element is used. Kernel can be created using getStructuringElement.anchor position of the anchor within the element; default value (-1, -1) means that the anchor is at the element center. iterations number of times erosion is applied. borderType pixel extrapolation method, see BorderTypes. BORDER_WRAP is not supported. borderValue border value in case of a consta