针对光学检测印刷电路板(PcB)时需要进行图像分割的问题,提出一种结合K-均值聚类算法的分水岭算法,用于PCB彩色图像分割,即首先将PCB彩色图像聚类,分成不同的颜色区域,按照不同区域进行分水岭分割,最后,将分割线透明的加在原始图像上,完成分割。实验表明,本文提出的算法可以分割PCB彩色图像,并且分割效果好。
According to the problem of optical detection printed circuit board (PCB) need image segmentation, a kind of combination clustering algorithm and watershed algorithm in PCB color image segmentation algorithm is put forward. Firstly, the PCB color image is clustered to divide into different color area, then the different area is segmented by watershed segmentation algorithm. At last, the cut-off rule transparent is added to the original image, the segmentation is completed. Experiments show that the proposed algorithm can split PCB color image, and segmentation effect is good.