改进圆形Hough变换的田间红提葡萄果穗成熟度判别

2020-06-20 03:02周文静查志华
农业工程学报 2020年9期
关键词:果粒成熟度果穗

周文静,查志华,吴 杰,2

改进圆形Hough变换的田间红提葡萄果穗成熟度判别

周文静1,查志华1,吴 杰1,2※

(1. 石河子大学机械电气工程学院,石河子 832003;2. 绿洲特色经济作物生产机械化教育部工程研究中心,石河子 832003)

针对田间环境下红提葡萄果穗成熟度人眼判断效率低且易误判的问题,该研究采用K近邻(K-nearest neighbor,KNN)算法和最大类间方差(Otsu)法分别对葡萄果穗图像背景分割以找到最佳分割效果,采用圆形Hough变换识别葡萄果粒,并开发了可判别葡萄果穗成熟度的算法。研究结果表明,不论顺光、逆光或者与田间背景相似的绿色果穗,KNN法可实现良好的背景分割,然后圆形Hough变换法在边缘阈值和灵敏度分别取0.15和0.942时,识别葡萄果粒的准确率可达96.56%。在此研究基础上,采用该研究开发的葡萄果穗成熟度判断算法,可根据颜色将果粒划分不同成熟度等级,并实现对果穗成熟度判别,判别准确率为91.14%。该研究结果可为果农适宜期收获葡萄及自动化采摘提供重要指导。

图像处理;识别;机器视觉;Hough变换;成熟度;果穗

0 引 言

红提葡萄以鲜食为主,采摘后无后熟期,选择最佳采摘期对采后红提葡萄品质至关重要[1-2]。由于在同一时期,果园中红提葡萄的不同植株、每一株的不同果穗以及同一果穗上不同葡萄果粒间均存在颜色的差异,依靠人眼判断葡萄成熟度效率低且易疲劳,很容易发生果穗成熟度误判而导致过早采摘或过熟采摘,过早采摘不利于销售,而过熟采摘易出现烂果,不利于贮运且使货架期缩短[2-4]。因此,如何快速准确判断红提葡萄果穗的成熟度,对提高红提葡萄商品率具有重要意义。

葡萄表皮颜色与其成熟度密切相关[5-6]。2012年,Rodriguez-Pulido等[7]在CIELab(Commission International Éclair-age Lab)和HSI(Hue Saturation Intensity)颜色空间上对葡萄图像进行直方图阈值处理,实现了多粒葡萄成熟度快速判别,然而该研究是实验室采集葡萄图像,回避了田间复杂环境中存在的诸如待检对象与背景颜色相近、遮挡和不同光照影响等因素对图像分析的干扰,不适于田间葡萄果穗成熟度的快速准确检测。为此,Pothen和Nuske[8]在Rodriguez-Pulido等[7]研究基础上,提出了一种关键点检测法[9],克服了背景颜色和光照的影响,能够较准确识别每粒葡萄并判断成熟度,从而可以通过计算成熟葡萄粒数占整穗粒数百分比,实现葡萄果穗成熟度分级。但是该方法难以准确识别被遮挡葡萄,果穗成熟度判断准确率也不够理想。在葡萄估产或机器人采摘研究中,圆形Hough变换法对不完全信息处理具有很好鲁棒性[10],能够最大程度解决被遮挡果实提取困难的问题[11-13]。但是这一方法易将田间图像中出现的近似圆形边缘误识别为葡萄果粒。因此在应用Hough变换法识别红提葡萄果粒时,必须找到合适方法消除葡萄果穗图像中近圆形边缘干扰,以提高葡萄果粒识别准确率。

对葡萄图像进行背景分割,可最大程度消除背景中干扰因素。在各种背景分割方法中,基于区域生长的背景分割法对接近背景颜色的果实分割效果较差[14]。图像边缘检测的背景分割方法能够分割出与背景颜色相近的果实[15-17],但易受光照和果实纹理影响而背景分割效果欠佳[14]。以一种卷积神经网络Mask R-CNN为主的像素级背景分割,尽管分割效果良好,但需要训练大量像素级标记的样本而耗时过长[18-19]。机器学习算法具有图像像素分类的优势,近年来有应用K均值(K-means)聚类算法[20-22]、线性分类器[23]、K近邻(K-Nearest Neighbor,KNN)分类器分别进行绿色果实背景分割的报道[24-25],在这些算法中,KNN法对田间绿色葡萄和绿苹果都取得了很高的分割准确率。此外,最大类间方差(Otsu)法可采用RGB图像(R、G和B分别代表图像红色、绿色和蓝色3个通道)的色差R-G[26]、R-B和G-R[27]、色差比(R-G)/(G-B)[28]以及归一化的(R-G)/(R+G)[29]进行果蔬图像的背景分割,其中司永胜等[28]研究发现,发现采用单一的R-G色差对不同光照下苹果图像阈值分割结果有较多噪声,归一化的红绿色差(R-G)/(R+G)对绿色苹果识别率可达92%[29]。由上述表明,KNN法和Otsu方法对果蔬背景分割都具有一定优势。

因此,本研究分别采用KNN和Otsu 2种方法对红提葡萄果穗图像进行背景分割,通过比较获得较好的背景分割效果;然后在此研究基础上,采用圆形Hough变换法准确识别背景分割的果穗图像中的葡萄果粒,结合颜色特征判断葡萄果粒成熟度,进而实现红提葡萄果穗成熟度较准确判别,为果农适宜期收获和今后自动化采摘提供研究基础。

1 材料与方法

1.1 葡萄果穗图像采集

试验所用红提葡萄图像样本采自新疆维吾尔自治区石河子市石河子大学试验园(44°20′N,85°59′E),海拔373 m,栽植龄均在3 a以上,单篱架,南北成行,多主面扇形整枝,架面通风,透光良好,株距0.9~1.2 m,行距2.7 m。

本研究于2018年红提葡萄采收期的8月11日至9月15日,采集田间自然生长条件下葡萄果穗图像。采样时间在每日上午8:00—12:00之间。采用智能手机(HUAWEI Mate 10)获取红提葡萄RGB图像,手机摄像头距葡萄果穗13~57 cm,像素分辨率为3 968×2 976(4∶3)。图像采集时,采用随机方式在同一株的上、中、下位置拍摄不同着色率的红提葡萄,采集图像包括顺光和逆光(图1)。每隔5 d采集1次,每次采集红提葡萄图像后以采集日期命名,顺光和逆光图像分别为59张和20张,共采样79张图像。

图1 田间红提葡萄果穗图像示例

1.2 果穗成熟度判别方法

红提葡萄果穗的成熟度分类流程如图2所示。首先对葡萄果穗图像进行背景分割,对分割后的目标区域进行标注。圆形Hough变换的输入图像为边缘图像,因此需要对目标区域进行边缘提取后采用圆形Hough变换提取果粒。提取图像中葡萄果粒表面色调H值进行果粒成熟度等级划分,并计算不同成熟度等级果粒占果穗的百分比,最后实现葡萄果穗成熟度判别。本研究所有处理及算法均在SAMSUNG笔记本处理器Intel(R)Xeon(R) CPU E5-2620 @ 2.10GHz,16 GB内存,64位Win7操作系统下的Matlab 2018b运行。

图2 红提葡萄果穗成熟度判别流程图

1.3 葡萄果穗的背景分割

本研究采用KNN和Otsu 2种方法分别对葡萄果穗RGB图像进行背景分割,通过背景分割性能分析以评价背景分割的效果,并选择合适的分割方法。

1.3.1 背景分割方法

采用KNN算法时,需要采集样本图像中像素点的R、G、B值构成数据集并加以训练。本研究用于训练的数据集共2 200个已分类数据,如图3所示,样本像素包含目标像素(葡萄)和背景像素(绿叶、茎秆、天空、土地、广告牌等)。

注:R通道、G通道和B通道分别为RGB颜色空间的红、绿和蓝3个色度分量。

采用Otsu法进行背景分割时,选择归一化的红绿色差(R-G)/(R+G)作为分割特征[19],以减轻光线对R和G通道的影响,归一化后所得结果范围为[-1,1],需要经灰度矩阵变换,使两个通道颜色值范围在0~255之间。

1.3.2 背景分割性能评价

根据式(1)~(4)计算准确率(Accuracy,%)、查准率(Precision,%)、查全率(Recall,%)和1值(1-score,%)4个性能评价指标,采用准确率和1值进行背景分割性能评价。

式中为目标像素被准确判别为目标像素的数量;为背景像素被准确判别为背景像素的数量;为背景像素被判别为目标像素的数量;为目标像素被判别为背景像素的数量。

1.4 红提葡萄果穗目标区域标注

葡萄果穗图像背景分割后,对分割出的区域进行边界跟踪。如图4所示,并用每个边界的最小矩形框标注出分割后的葡萄果穗,以便于后续对每个果穗进行处理分析。

图4 红提葡萄果穗目标标注

1.5 葡萄果穗图像边缘提取

Hough变换处理对象为边缘图像,应先提取目标区域图像边缘。为提升边缘提取的效果,如图5所示,本研究首先将图像进行锐化,再对图像进行一阶导数得到一阶梯度图像,最后使用Log算子提取梯度图像的边缘用于圆形Hough变换。

图5 红提葡萄果穗目标区域图像边缘提取

1.6 圆形Hough变换提取葡萄果粒

在圆形Hough变换检测中,需要明确待检测圆(即葡萄果粒)半径范围。由于葡萄果粒的轮廓不是正圆形,采用外接葡萄果粒轮廓的最小矩形框长和宽的平均值表示果粒半径。本研究采用Photoshop软件对8幅图像中60粒葡萄果粒的半径进行测量统计,确定葡萄果粒半径范围为23~72像素。

圆形Hough变换依据如式(5)所示的圆的数学模型遍历图像,对目标区域进行圆检测,检测边缘图像中符合半径条件的圆,然后从检测出的圆中提取对应图像区域的像素,即可提取出葡萄果粒。

式中0、0为葡萄果粒圆心坐标;0为葡萄果粒轮廓半径,像素。

本研究应用Matlab调用imfindcircles函数进行圆形Hough变换,调整边缘阈值和灵敏度以期望在较快检测速度得到较高的果粒识别准确率。

1.7 葡萄果粒成熟度判断

HSV颜色空间的H、S和V分别代表图像的色调、饱和度和明度,色调H不受光照强度的影响,能更好反映图片中的颜色信息,因此本研究采用HSV颜色空间中葡萄果粒所有像素H值的均值判断葡萄果粒成熟度。依据葡萄果农对葡萄果粒成熟度的判断,本研究对100粒不同成熟度葡萄果粒像素H值均值统计后,将葡萄果粒成熟度分为G1、G2、G3、G4这4个等级,各等级H值均值范围见表1。图6所示为典型的4个等级红提葡萄果粒,其中,G1、G2等级果粒未成熟,G1类为绿色,均未变色,G2类由绿色渐变为红色;G3、G4等级果粒已成熟,G3类完全变红,但颜色尚浅,G4类为深红色。

表1 葡萄果粒成熟度等级的H值均值范围

注:G1、G2、G3、G4表示葡萄果粒成熟度等级。

1.8 葡萄果穗成熟度分类

葡萄转色至完全成熟约40 d[6],参考Pothen等[8]的研究,将红提葡萄果穗成熟度分为4个等级,其中,Ⅰ级表示葡萄果穗已成熟;Ⅱ级表示葡萄果穗即将成熟;Ⅲ级表示葡萄果穗已完全进入转色期;Ⅳ级表示葡萄果穗刚进入转色期,根据不同成熟度,建议采摘时间具体如表2所示。

表2 红提葡萄果穗成熟度等级

注:Ⅰ级、Ⅱ级、Ⅲ级、Ⅳ级表示葡萄果穗成熟度等级。

Note: Grade Ⅰ, grade Ⅱ, grade Ⅲ, and grade Ⅳ represent four maturity grades of grape clusters.

2 结果与分析

2.1 红提葡萄图像背景分割效果的对比分析

采用KNN算法对红提葡萄图像数据集分类时,分析距离计算方式及值对KNN算法分类准确率的影响。由图7可知,当选择马氏距离方式计算且=5时,分类准确率最高,可达78.96%。

将KNN算法(采用马氏距离且=5)对红提葡萄图像背景分割的结果与Otsu法分割结果进行对比,如图8所示。对逆光的葡萄果穗A,KNN法与Otsu法分割效果相近,但KNN准确率和1值仍略高于Otsu法(图9)。对顺光近红色的葡萄果穗B,Otsu法对颜色偏暗果粒无法判别,分割效果差,有较大红色区域(),因此在准确率和1值上都比KNN法要低,尤其是1值低了10.44%;对顺光近绿色的葡萄果穗C,Otsu分割图像中绿色区域()面积要比KNN法分割图像中的大得多,也就是说Otsu法分割后背景中仍然存在较大面积的蓝天、茎秆、葡萄叶等,因而KNN法背景分割的准确率和1值均明显高于Otsu法;KNN法背景分割平均准确率和1值分别为93.25%和89.93%,Otsu法背景分割平均准确率和1值分别为87.78%和79.44%,综上所述,KNN算法相比较Otsu法更适于红提葡萄背景图像分割。

图7 不同K值及距离计算方式对应的数据集分类准确率

注:白色区域(TP)为目标像素被准确判别为目标像素,黑色区域(TN)为背景像素被准确判别为背景像素,绿色区域(FP)为背景像素被判别为目标像素,红色区域(FN)为目标像素被判别为背景像素。

图9 红提葡萄果穗图像不同分割方法的分割性能比较

2.2 圆形Hough变换提取葡萄果粒

为了增强对同一果穗中颜色相近且紧密相接葡萄果粒的微弱边缘提取,需要对圆形Hough变换的边缘阈值进行调整。如图10a和图10c所示,当边缘阈值调整在0.1~0.15范围时,果粒识别可兼顾较高的识别率、准确率和较低的漏检率、错检率。边缘阈值过小错误识别的果粒越多,而边缘阈值较大时,会漏识别葡萄果粒。考虑到阈值越小,计算量越大,为减少运算时间,本研究Hough变换时的边缘阈值取0.15。

分割后的目标区域中果穗图像中存在少数果粒被茎秆等遮挡,使果粒的连续边缘被分割,为了能够检测轮廓信息有丢失的果粒边缘圆弧长度,本研究在圆形Hough变换最优的边缘阈值下调整灵敏度。如图10b和图10d所示,灵敏度低于0.942时,随着灵敏度提高,准确率增大,漏检率降低,错检率变化极小;但当灵敏度达到0.942以上时,识别率增大也带动了错检率出现大幅上升,这是因为检测到了许多非葡萄的圆形所导致的结果,与检测葡萄果粒的目的背道而驰。因此本研究将灵敏度设置为0.942,相应的葡萄果粒检测准确率可达96.56%,既保证能较准确检测图像中的果粒,又能减少错误识别。

注:识别率超出100%时,检测到的圆包含非葡萄的边缘;图中虚线指引处识别效果最佳;A点准确率较高达到96.56%,灵敏度为0.942,且错检率、漏检率最低。

根据本研究所确定的最佳边缘阈值和灵敏度值对果穗进行圆形Hough变换提取果粒,如图11所示,可以看出,因检测到背景中非葡萄圆形而误识别1粒果粒(图 11e绿色圆),有1粒果粒(图11f序号①)由于被遮挡边缘过短而未检测出来;有2粒背景分割不完整且被茎秆遮挡果粒(图 11f序号②、③)未提取出其边缘而无法识别。除此之外,其余果粒都实现准确识别,其中有3粒果粒即使有一半以上轮廓边缘被遮挡(图11e红色圆)也成功检测。

注:绿色圆表示错误识别为果粒图像的边缘;黄色和红色的圆为正确识别为果粒图像的边缘,其中红色圆代表果粒边缘有一半以上遮挡而成功识别;蓝色填充区域(①、②、③)为未识别的果粒。

2.3 红提葡萄果穗成熟度判断

本研究根据Pothen和等[8]葡萄果穗成熟度等级的分类方法,开发了如下所示的红提葡萄果穗成熟度判断算法,其中,h为提取出葡萄果粒像素的值(=1, 2, ... 表示该果粒像素数目),H为h的均值。根据本研究开发的算法对红提葡萄果穗成熟度进行分类,如图12所示为典型的4个成熟度等级葡萄果穗。

图12 不同成熟度等级的典型葡萄果穗

Fig. 12 Typical grape clusters with different maturity grades

采用本研究方法判断79穗葡萄的成熟度,并与葡萄栽培专家判断结果进行混淆矩阵分析,由图13结果可知,79穗葡萄中准确判断出72穗葡萄成熟度等级,其中Ⅳ级10穗,Ⅲ级16穗,Ⅱ级27穗,Ⅰ级26穗,准确度可达91.14%。由于同一穗葡萄果粒之间颜色极为接近时,葡萄果粒等级人眼难以区分,因此判断误差主要出现在Ⅱ级和Ⅲ级之间。

注:图中数字代表识别出的葡萄果穗数目;Ⅰ、Ⅱ、Ⅲ、Ⅳ表示葡萄果穗成熟度等级。

图14的4幅图像为同一果穗在15 d中颜色的变化情况,可以看出,果穗颜色接近,肉眼很难分辨其成熟度差异。采用本研究的方法对这一果穗4个日期的成熟度进行判断,8月26日的果穗成熟度为77.27%,Ⅱ级,即将成熟果穗,8~10 d后采摘;8月31日、9月5日和9月10日的果穗成熟度分别为81.82%(Ⅰ级,可摘)、83.33%(Ⅰ级,可摘)和88.89%(Ⅰ级,可摘)。由此可见,当整穗葡萄果粒颜色相近时,本研究的方法较之人眼判断更为准确。

注:括号中百分比表示葡萄果穗成熟度,%。图像a、b、c、d拍摄日期分别为8月26日、8月31日、9月5日和9月10日。

3 结 论

本研究采用图像法对田间红提葡萄果穗成熟度进行判别分类研究,主要结论如下:

1)在对葡萄果穗图像背景分割时,采用马氏距离且=5条件时,KNN法背景分割平均准确率和1值分别为93.25%和89.93%;Otsu法背景分割平均准确率和1值分别为87.78%和79.44%。KNN算法背景分割的准确率和调和均值F1均高于Otsu法,具有很好背景分割效果。

2)当边缘阈值和灵敏度分别取0.15和0.942时,圆形Hough变换法可以在较高运算速度下提取葡萄果穗中的果粒,准确率可达96.56%。

3)根据HSV空间中红提葡萄果粒所有像素H值的均值分布范围,可以将葡萄果粒分为4个成熟度等级。通过本研究开发的计算葡萄果穗成熟度算法,对红提葡萄果穗成熟度判断的准确度为91.14%,当整穗葡萄果粒颜色相近而人眼难以判断成熟度时,本研究方法也可以实现成熟度的准确判别。

[1] 王伟,崔楠. 新疆红提葡萄的储藏和保鲜探讨[J]. 农业与技术,2015,35(16):112-112. Wang Wei, Cui Nan. Discussion on storage and preservation of “Red Globe” grape in Xinjiang[J]. Agriculture and Technology, 2015, 35(16): 112-112. (in Chinese with English abstract)

[2] Piazzolla F, Pati S, Amodio M L, et al. Effect of harvest time on table grape quality during on-vine storage[J]. Journal of the Science of Food & Agriculture, 2015, 96(1): 131-139.

[3] 李灿婴. 套袋对红地球葡萄色泽发育及果实品质的影响[D]. 兰州:甘肃农业大学,2006. Li Canying. Effects of Bagging on Color and Quality in Fruit of Grapes (cv. Red Globe)[D]. Lanzhou: Gansu Agricultural University, 2006. (in Chinese with English abstract)

[4] 李海. 红提葡萄生产中存在的问题及对策[J]. 农业技术与装备,2017,(9):46-47. Li Hai. Problems and countermeasures in the production of red grape[J]. Agricultural Technology and Equipment, 2017, (9): 46-47. (in Chinese with English abstract)

[5] Wan Peng, Toudeshki A, Tan Hequn, et al. A methodology for fresh tomato maturity detection using computer vision[J]. Computers and Electronics in Agriculture, 2018, 146: 43-50.

[6] 曹雄军,石雪晖,金燕,等. 红宝石无核和红提葡萄果实着色与糖、酸含量的关系[J]. 中外葡萄与葡萄酒,2009,9(5):12-15. Cao Xiongjun, Shi Xuehui, Jin Yan, et al. Relationship between berry coloration and the contents of sugar and acid of Ruby Seedless and Red Globe[J]. Sino-Overseas Grapevine and Wine, 2009, 9(5): 12-15. (in Chinese with English abstract)

[7] Rodríguez-Pulido F J, Gómez-Robledo L, Melgosa M, et al. Ripeness estimation of grape berries and seeds by image analysis[J]. Computers & Electronics in Agriculture, 2012, 82(1): 128-133.

[8] Pothen Z, Nuske S. Automated assessment and mapping of grape quality through image-based color analysis[J]. IFAC- PapersOnLine, 2016, 49(16): 72-78.

[9] Pothen Z S, Nuske S. Texture-based fruit detection via images using the smooth patterns on the fruit[C]//IEEE International Conference on Robotics and Automation. IEEE, 2016: 5171-5176.

[10] Ye Huashan, Shang Guocan, Wang Lina, et al. A new method based on Hough transform for quick line and circle detection[C]//2015 8thInternational Conference on Biomedical Engineering and Informatics (BMEI). IEEE, 2015: 52-56.

[11] Murillo-Bracamontes E A, Martinez-Rosas M E, Miranda-Velasco M M, et al. Implementation of Hough transform for fruit image segmentation[J]. Procedia Engineering, 2012, 35: 230-239.

[12] Rahman A, Hellicar A. Identification of mature grape bunches using image processing and computational intelligence methods[C]//2014 IEEE Symposium on Computational Intelligence for Multimedia, Signal and Vision Processing (CIMSIVP). IEEE, 2014: 1-6.

[13] Diago M P, Tardaguila J, Aleixos N, et al. Assessment of cluster yield components by image analysis[J]. Journal of the Science of Food and Agriculture, 2015, 95(6): 1274-1282.

[14] 沈文斌. 基于边缘提取与分水岭分割相融合的柑橘检测方法研究[D]. 衡阳:南华大学,2018. Shen Wenbin. Research on Citrus Detection Method Based on Fusion of Edge Extraction and Watershed Segmentation[D]. Hengyang: University of South China, 2018. (in Chinese with English abstract)

[15] 周志宇,刘迎春,张建新. 基于自适应Canny算子的柑橘边缘检测[J]. 农业工程学报,2008,24(3):21-24. Zhou Zhiyu, Liu Yingchun, Zhang Jianxin, Orange edge detection based on adaptive Canny operator[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2008, 24(3): 21-24. (in Chinese with English abstract)

[16] Thendral R, Suhasini A, Senthil N. A comparative analysis of edge and color based segmentation for orange fruit recognition[C]//2014 International Conference on Communication and Signal Processing. IEEE, 2014: 463-466.

[17] Revathi P, Hemalatha M. Advance computing enrichment evaluation of cotton leaf spot disease detection using image edge detection[C]//2012 Third International Conference on Computing, Communication and Networking Technologies (ICCCNT'12). IEEE, 2012: 1-5.

[18] Pobar M, Ivasic-Kos M. Mask R-CNN and optical flow based method for detection and marking of handball actions[C]//2018 11thInternational Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI). IEEE, 2018: 1-6.

[19] Danielczuk M, Matl M, Gupta S, et al. Segmenting unknown 3D objects from real depth images using Mask R-CNN trained on synthetic data[C]//2019 International Conference on Robotics and Automation (ICRA). IEEE, 2019: 7283-7290.

[20] 李凯,张建华,冯全,等. 复杂背景与天气条件下的棉花叶片图像分割方法[J]. 中国农业大学学报,2018,23(2):88-98. Li Kai, Zhang Jianhua, Feng Quan, et al. Image segmentation method for cotton leaf under complex background and weather conditions[J]. Journal of China Agricultural University, 2018, 23(2): 88-98. (in Chinese with English abstract)

[21] 刘智杭,于鸣,任洪娥. 基于改进K均值聚类的葡萄果穗图像分割[J]. 江苏农业科学,2018,46(24):239-244.Liu Zhihang, Yu Ming, Ren Honge. Image segmentation of grape cluster based on improved K-means clustering[J]. Jiangsu Agricultural Sciences, 2018, 46(24): 239-244. (in Chinese with English abstract)

[22] Pandiyammal P, Gandhi D M P I. Infected fruit part detection using clustering[J]. International Journal of Advanced Research in Computer Science and Software Engineering, 2015, 5(3): 176-182.

[23] He Zhiliang, Xiong Juntao, Lin Rui, et al. A method of green litchi recognition in natural environment based on improved LDA classifier[J]. Computers and Electronics in Agriculture, 2017, 140: 159-167.

[24] Nuske S, Achar S, Bates T, et al. Yield estimation in vineyards by visual grape detection[C]//2011 IEEE/RSJ International Conference on Intelligent Robots and Systems. IEEE, 2011: 2352-2358.

[25] Linker R, Cohen O, Naor A. Determination of the number of green apples in RGB images recorded in orchards[J]. Computers and Electronics in Agriculture, 2012, 81(1): 45-57.

[26] 尹建军,毛罕平,王新忠,等. 不同生长状态下多目标番茄图像的自动分割方法[J]. 农业工程学报,2006,22(10):149-153. Yin Jianjun, Mao Hanping, Wang Xinzhong, et al. Automatic segmentation method for multi-tomato images under various growth conditions[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2006, 22(10): 149-153. (in Chinese with English abstract)

[27] Zhou Rong, Damerow L, Sun Yurui, et al. Using color features of cv. ‘Gala’ apple fruits in an orchard in image processing to predict yield[J]. Precision Agriculture, 2012, 13(5): 568-580.

[28] 司永胜,乔军,刘刚,等. 基于机器视觉的苹果识别和形状特征提取[J]. 农业机械学报,2009,40(8):161-165. Si Yongsheng, Qiao Jun, Liu Gang, et al. Recognition and shape features extraction of apples based on machine vision[J]. Transactions of the Chinese Society of Agricultural Machinery, 2009, 40(8): 161-165. (in Chinese with English abstract)

[29] 司永胜,乔军,刘刚,等. 苹果采摘机器人果实识别与定位方法[J]. 农业机械学报,2010,41(9):148-153. Si Yongsheng, Qiao Jun, Liu Gang, et al. Recognition and location of fruit for apple harvesting robot[J]. Transactions of the Chinese Society of Agricultural Machinery, 2010, 41(9): 148-153. (in Chinese with English abstract)

Maturity discrimination of “Red Globe” grape cluster in grapery by improved circle Hough transform

Zhou Wenjing1, Zha Zhihua1, Wu Jie1,2※

(1.,,832003,; 2.,,832003,)

There arecolor differences between different berries of a “Red Globe” cluster in the vineyard in the same period. This makes it inefficient and error-prone for visual maturity judgment of the grape cluster. As a result, inaccurate judgment often leads to grape harvesting too early or too late. Therefore, it is necessary to achieve accurate maturity discrimination of the grape cluster for increasing the quality grade and the commodity rate of the “Red Globe” grape. In this study, 79 images of the grape cluster in a grapery were acquired by the smartphone (HUAWEI Mate 10), including 59 images in natural light and 20 images in backlight. Firstly, the background of the grape cluster image was segmented using the K-Near Neighbor (KNN) algorithm and Otsu methods. For the KNN algorithm, 2 200 sets of R (Red), G (Green) and B (Blue) values were manuallycollected from the pixel of the image to be used as the data set. With the data set, different nearest numbers and the methods of distance calculation were tested to obtain a better background segmentation effect. For the Otsu method, the normalized color difference of (R-G) / (R+G) was applied as the background segmentation characteristic to reduce the influence of the lights on the R channel and G channel. For near red and green grape clusters under natural light and backlight, the background segmentation effect was compared using two algorithms. After labeling the images of grape clusters with the minimum bounding box, the Log operator was used to extract the edge of the first gradient imagefrom the object region. Then, the Circle Hough Transform (CHT) method was applied to extract grape berries. The radius range of circle in the Hough transform was determined by measuring numbers of pixels of 60 grape berry images. In addition, we adjusted the values of the edge thresholds and sensitivities in Hough transform to obtain a higher accuracy of berry extraction. Meanwhile, the maturity of the grape berry was classified into four levels of G1, G2, G3, and G4 according to the H value of the pixels from the “Red Globe” grape image in the HSV space. Furthermore, the algorithm was developed to calculate the proportion of berries with different maturity grades in a cluster and classify the maturity degree of grape clusters. Finally, the classification performance for the grape cluster maturity with our developed algorithm was evaluated by the confusion matrix.The results showed that the KNN algorithm using Mahala Nobisdistance obtained an accuracy of 93.25% and1-score of 89.93% for background segmentation when the nearest numberwas 5. While the accuracy and1-score of background segmentation by the Otsu method were 87.78% and 79.44%, respectively. In comparison, the KNN method had a better segmentation effect regardless of the natural light, backlight or the green grape that were very similar to the background. In this case, the background segmented by the KNN algorithm was chosen for CHT extracting circle from the non-structured environment. The radius range of 23-72 pixels was determined for CHT to extract grape berries and the accuracy of grape berry extraction was up to 96.56% at high computation speed when the edge threshold and sensitivity were 0.15 and 0.942, respectively. Consequently, with our developed algorithm adopted, the maturity discrimination accuracy of the grape cluster was up to 91.14% compared with judgments from viticulturists. Moreover, the validation results proved that our proposed approach could discriminate against the slight change of maturity degree during the shorter growth period of the grape cluster. Thus, our research could guide for grape growers to select an appropriate harvest period. Also, it is useful for the research and development of automatic grape picking equipment in the future.

image processing; identification; machine vision; Hough transform; maturity; cluster

周文静,查志华,吴 杰. 改进圆形Hough变换的田间红提葡萄果穗成熟度判别[J]. 农业工程学报,2020,36(9):205-213.doi:10.11975/j.issn.1002-6819.2020.09.023 http://www.tcsae.org

Zhou Wenjing, Zha Zhihua, Wu Jie. Maturity discrimination of “Red Globe” grape cluster in grapery by improved circle Hough transform[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(9): 205-213. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2020.09.023 http://www.tcsae.org

2019-11-17

2020-03-09

国家自然科学基金地区科学基金项目(31560476);石河子大学自主资助支持项目(ZZZC201746B)

周文静,主要从事农产品品质无损检测研究。Email:Viola_zhouzhou@163.com

吴 杰,博士,教授,主要从事农产品品质安全与检测研究。Email:wjshz@126.com

10.11975/j.issn.1002-6819.2020.09.023

S371;TP274+.3

A

1002-6819(2020)-09-0205-09

猜你喜欢
果粒成熟度果穗
“果粒橙”的快乐时光
基于骨架的玉米植株三维点云果穗分割与表型参数提取
脏脏珍珠奶茶的制作
产品制造成熟度在型号批生产风险管理中的应用
玉米新品系合17-7016的组配及表现
整机产品成熟度模型研究与建立
给定置信水平下信息系统体系成熟度的灰色聚类方法
葡萄干的加工工艺
刚好够吃6天的香蕉
果穗拉长保果剂在夏黑上的应用效果初探