摘要
以图像处理技术为基础,根据苹果分级标准展开红色着色比、缺陷检测、果径测量的模型设计研究。首先将苹果图像转换到YCbCr颜色空间,借助K-means聚类算法、OTSU最大类间方差法得到最优分阈值,将灰度图转换为二值图。使用大小为10的模版对图片做闭预算,并填充内部小孔洞,得到的白色的果实区域,从而实现果体与背景区域的有效分割。随后通过Gamma变换将苹果图像中灰度值区间拉伸,建立苹果颜色分级模型;在YCbCr图片中进行簇数为3的K-means聚类,且使用碟型结构元素对图片做开运算,对连通域进行标记,进而完成苹果的缺陷检测;最后通过最小外接圆计算苹果果径。实验结果表明,基于K-means聚类方法进行苹果分级系统设计,其图像处理速度较快且分割效果较好,能够为相关果类的分级设计提供借鉴和参考。
Based on image processing technology,the model design of red color ratio,defect detection and fruit diameter measurement is studied according to apple grading requirements.Firstly,the original apple image is transformed into YCbCr color space.The optimal threshold is obtained by K-means clustering algorithm and OTSU maximum inter-class variance method,and the gray image is converted into a binary image.A 10-size template is used to close the budget of the image and fill the small holes in the image to get the white fruit area,so as to realize the effective segmentation of the fruit body and the background area.Then,the gray value interval of the apple image is stretched by Gamma transform,and the apple color grading model is established.At the same time,K-means clustering with 3 clusters is carried out in YCbCr image space,and the connected region is marked by disc structure elements to complete the defect detection part of the apple.Finally,the apple diameter is calculated by the minimum circumferential circle.The experimental results show that the design of apple grading system based on K-means clustering method has faster image processing speed and better segmentation effect,which can provide reference for other fruit grading design.
作者
张婧婧
程芸涛
达新民
ZHANG Jingjing;CHENG Yuntao;DA Xinmin(College of Computer and Information Engineering,Xinjiang Agricultural University,Urumqi 830052)
出处
《计算机与数字工程》
2021年第8期1656-1660,共5页
Computer & Digital Engineering
基金
新疆维吾尔自治区自然科学基金项目(编号:2018D01A17)资助。