为了解决经典Otsu法对复杂图像分割的不足,提出了一种新的分割算法来提取零件的表面缺陷,将形态学和小波变换理论应用到Otsu算法中。该算法采用两次分割,分别为将零件从背景中分割出来以及将缺陷从零件中分割出来。算法首先采用形态学中的顶帽变换和底帽变换相结合将零件从图像背景中分离出来,得到目标图像;然后选择单层小波系数分解目标图像,再将分解后的图像进行低频重构,去除冗余信息和噪声;最后分别应用一维和二维Otsu算法将缺陷从低频重构后的图像中分割出来。实验证明,所提出的算法较经典的一维和二维Otsu算法,具有分割精度高、抗噪性能强的优点,并且改进后的一维Otsu算法要优于改进后的二维Otsu算法。
In order to overcome the weakness of classical Otsu algorithm in complex image segmentation, a new segmentation algorithm, which applies morphology and wavelet transform into the Otsu algorithm, is introduced to extract the surface defects, Two steps are included in this algorithm, one is the component segmentation from the background and the other one is the defect segmentation from the component. First, the target image was acquired through separating the part from background image using the morphology method. Then, the monolayer wavelet coefficient was applied to separate the target image. Third, the redundancy information in the image was removed by means of low-frequency reconstruction. Finally, the one and two dimensional Otsu algorithms were used to segment the defects from part surface separately. The experiments prove that this new algorithm has higher segmentation accuracy and better noise resistance than classical one and two dimensional Otsu. Moreover, the improved one-dimensional algorithms are superior to the two-dimensional ones.