摘要
【目的】准确获取红富士苹果的分级指标,为实现多特征融合的苹果分级提供依据。【方法】以均值滤波、全局亮度均衡化与图像裁剪方法,预处理实验所需的苹果图像;使用K-means聚类算法、OTSU最大类间方差法,将苹果灰度图转换为二值图;利用二值图与苹果原图的异或运算,提取苹果轮廓;采用苹果的二值图计算苹果的果实区域大小;使用颜色空间转换RGB-HSV中H通道划分果实红色区域;通过构建掩膜、形态学操作判断果体是否含有缺陷及计算其面积;构建最小外接矩形计算苹果的果径及果形;利用KNN分类算法实现多特征融合的苹果在线自动分级。【结果】基于K-means聚类与KNN分类相结合的苹果在线分级方法,在优于传统图像阈值分割效果的基础上,特级果分级准确率为97.14%,一级果分级准确率为100%,二级果分级准确率为93.75%,等外果分级准确率为100%,综合分级准确率达到97%。【结论】100个苹果测试准确率达到97%,验证了该分级方法的可行性与准确性。
【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.
作者
王迎超
张婧婧
达新民
耿新雪
WANG Yingchao;ZHANG Jingjing;DA Xinmin;GENG Xinxue(College of Computer and Information Engineering,Xinjiang Agricultural University,Urumqi 830052,China)
出处
《新疆农业科学》
CAS
CSCD
北大核心
2023年第3期643-650,共8页
Xinjiang Agricultural Sciences
基金
新疆维吾尔自治区自然科学基金(2022D01A202)
新疆农业大学研究生教育教学改革研究项目(xjaualk-yjs-2021012)。