English

中国农机化学报

中国农机化学报 ›› 2024, Vol. 45 ›› Issue (2): 151-156.DOI: 10.13733/j.jcam.issn.2095-5553.2024.02.022

• 农产品加工工程 • 上一篇    下一篇

基于SSA-Kmeans聚类算法的青菜杂质图像分割

刘可心1,赵爽1,苗玉彬2   

  • 出版日期:2024-02-15 发布日期:2024-03-19
  • 基金资助:
    上海市科技兴农项目(沪农科创字(2019)第2-2号);国家自然科学基金项目(51975361)

Image segmentation of green vegetable impurities based on SSA-Kmeans clustering algorithm

Liu Kexin1, Zhao Shuang1, Miao Yubin2   

  • Online:2024-02-15 Published:2024-03-19

摘要: 为解决青菜包装生产线在加工过程中的杂质在线检测问题,提出一种基于SSA-Kmeans的青菜杂质图像分割算法。首先利用直方图均衡化进行彩色图像增强以降低光照影响;其次基于麻雀搜索算法对初始聚类中心寻优,根据得到的最佳聚类中心,选取包含颜色信息的ab二维数据进行Kmeans聚类;然后对聚类后的图像二值化处理并用形态学滤波方法校正,最终完成图像分割。利用该算法对落叶、枯叶和黄叶等杂质进行图像分割试验,杂质平均匹配率为93.22%,平均误分率为0.70%,平均准确率为92.52%。与FCM算法、Kmeans算法、PSO-Kmeans算法的对比试验表明:本文算法分割精度更优,对不同杂质的分割均表现出良好的鲁棒性,为实现青菜杂质在线检测提供一种新方法支撑,对提高青菜机械化生产水平具有一定的实用价值。

关键词: 青菜生产, 杂质检测, Kmeans聚类, 麻雀搜索算法

Abstract: In order to solve the problem of online detection of impurities in green vegetable packaging production line during processing, a green vegetable impurity image segmentation algorithm based on SSA-Kmeans is proposed. Firstly, the color image is enhanced by histogram equalization to reduce the effect of illumination. Secondly, the initial clustering center is optimized based on the sparrow search algorithm, and the ab two-dimensional data containing color information is selected for Kmeans clustering according to the best clustering center obtained. After that, the clustered image is binarized and corrected by morphological filtering method to finally complete the image segmentation. Using this algorithm for image segmentation experiments on impurities such as fallen leaves, dead leaves and yellow leaves, the average matching rate of impurities is 93.22%, the average misclassification rate is 0.70%, and the average accuracy rate is 92.52%. The comparison experiments with FCM algorithm, Kmeans algorithm and PSO-Kmeans algorithm show that the segmentation accuracy of the algorithm in this paper is better, and the segmentation of different impurities shows good robustness, which provides a new method to support the realization of automatic picking of impurities in green vegetable and has certain practical value to improve the mechanized production of green vegetable.

Key words: green vegetable production, impurity detection, Kmeans clustering, sparrow search algorithm

中图分类号: