新疆农业科学 ›› 2023, Vol. 60 ›› Issue (3): 643-650.DOI: 10.6048/j.issn.1001-4330.2023.03.015

• 植物保护·设施农业·农产品加工工程·微生物 • 上一篇    下一篇

基于K-means与KNN的多特征苹果在线分级

王迎超(), 张婧婧(), 达新民, 耿新雪   

  1. 新疆农业大学计算机与信息工程学院,乌鲁木齐 830052
  • 收稿日期:2022-08-18 出版日期:2023-03-20 发布日期:2023-04-18
  • 通信作者: 张婧婧(1981-),女,湖南宁乡人,副教授,硕士生导师,研究方向为农业信息化技术,(E-mail)zjj@xjau.edu.cn
  • 作者简介:王迎超(1997-),男,河南驻马店人,硕士研究生,研究方向为图像处理,(E-mail)945697714@qq.com.
  • 基金资助:
    新疆维吾尔自治区自然科学基金(2022D01A202);新疆农业大学研究生教育教学改革研究项目(xjaualk-yjs-2021012)

Design of Multi-feature Apple Online Grading System Based on K-means and KNN

WANG Yingchao(), ZHANG Jingjing(), DA Xinmin, GENG Xinxue   

  1. College of Computer and Information Engineering, Xinjiang Agricultural University, Urumqi 830052, China
  • Received:2022-08-18 Online:2023-03-20 Published:2023-04-18
  • Correspondence author: ZHANG Jingjing (1981-), female, Hunan Province,associate professor, Research direction: agricultural information technology,(E-mail)zjj@xjau.edu.cn
  • Supported by:
    Natural Science Foundation of Xinjiang Uygur Autonomous Region(2022D01A202);Postgraduate Education and Teaching Reform of Xinjiang Agricultural University(xjaualk-yjs-2021012)

摘要:

【目的】准确获取红富士苹果的分级指标,为实现多特征融合的苹果分级提供依据。【方法】以均值滤波、全局亮度均衡化与图像裁剪方法,预处理实验所需的苹果图像;使用K-means聚类算法、OTSU最大类间方差法,将苹果灰度图转换为二值图;利用二值图与苹果原图的异或运算,提取苹果轮廓;采用苹果的二值图计算苹果的果实区域大小;使用颜色空间转换RGB-HSV中H通道划分果实红色区域;通过构建掩膜、形态学操作判断果体是否含有缺陷及计算其面积;构建最小外接矩形计算苹果的果径及果形;利用KNN分类算法实现多特征融合的苹果在线自动分级。【结果】基于K-means聚类与KNN分类相结合的苹果在线分级方法,在优于传统图像阈值分割效果的基础上,特级果分级准确率为97.14%,一级果分级准确率为100%,二级果分级准确率为93.75%,等外果分级准确率为100%,综合分级准确率达到97%。【结论】100个苹果测试准确率达到97%,验证了该分级方法的可行性与准确性。

关键词: 多特征融合; 苹果自动分级; K-means; OTSU; KNN

Abstract:

【Objective】 To study the automatic classification method based on the combination of K-means clustering and KNN nearest neighbor classification with a view to providing basis for accurately obtaining the classification index of Red Fuji apple and realizing multi feature fusion apple classification.【Methods】 The apple images needed in the experiment were preprocessed by means of mean filtering, global brightness equalization and image clipping; K-means clustering algorithm and OTSU maximum interclass variance method were used to convert apple gray image into binary image; Using the XOR operation between the binary graph and the original apple graph, the apple contour is extracted; The area size of apple fruit was calculated by using the binary map of apple; The H-channel in RGB-HSV was transformed into red region of fruit by color space; The construction of mask and morphological operation was applied to judge whether the fruit body contained defects and calculate its area; The minimum circumscribed rectangle was constructed to calculate the fruit diameter and shape of apple; KNN classification algorithm was used to realize on-line automatic classification of apple with multi feature fusion. 【Results】 The experimental results show that the automatic Apple classification system based on K-means clustering and KNN classification has a classification accuracy of 97% without reducing the effect of traditional image threshold segmentation. 【Conclusion】 Through testing 100 apples,the accuracy reached 97%,which verified the feasibility and accuracy of the grading method.

Key words: multi feature fusion; automatic apple grading; K-means; OTSU; KNN

中图分类号: 


ISSN 1001-4330 CN 65-1097/S
邮发代号:58-18
国外代号:BM3342
主管:新疆农业科学院
主办:新疆农业科学院 新疆农业大学 新疆农学会

出版单位:《新疆农业科学》编辑部
地址:乌鲁木齐市南昌路403号新疆农业科学院
邮编:830091
电话:0991-4502046
E-mail:xjnykx-h@xaas.ac.cn


版权所有 © 《新疆农业科学》编辑部
本系统由北京玛格泰克科技发展有限公司设计开发
总访问量: 今日访问: 在线人数:
网站
微信公众号
淘宝购买
微店购买