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