中国农业科学 ›› 2020, Vol. 53 ›› Issue (12): 2360-2370.doi: 10.3864/j.issn.0578-1752.2020.12.005

• 耕作栽培·生理生化·农业信息技术 • 上一篇    下一篇

基于区域亮度自适应校正算法的脐橙表面缺陷检测

张明1,2,王腾2,李鹏2,邓烈2,郑永强2,易时来2,吕强2(),孙荣荣2()   

  1. 1 西南大学工程技术学院,重庆 400715;
    2 西南大学柑桔研究所/中国农业科学院柑桔研究所,重庆 400712
  • 收稿日期:2019-09-23 出版日期:2020-06-16 发布日期:2020-06-25
  • 通讯作者: 吕强,孙荣荣
  • 作者简介:张明,E-mail:pine_torch@126.com。
  • 基金资助:
    重庆市重点产业共性关键技术创新专项(cstc2015zdcy-ztzx80001);中央高校基本科研业务费项目(XDJK2017C017)

Surface Defect Detection of Navel Orange Based on Region Adaptive Brightness Correction Algorithm

ZHANG Ming1,2,WANG Teng2,LI Peng2,DENG Lie2,ZHENG YongQiang2,YI ShiLai2,LÜ Qiang2(),SUN RongRong2()   

  1. 1 College of Engineering and Technology, Southwest University, Chongqing 400715;
    2 Citrus Research Institute, Southwest University/Citrus Research Institute, Chinese Academy of Agricultural Sciences, Chongqing 400712
  • Received:2019-09-23 Online:2020-06-16 Published:2020-06-25
  • Contact: Qiang Lü,RongRong SUN

摘要:

【目的】针对类球型水果表面亮度分布不均现象,传统算法难以有效直接分割水果表面缺陷区域问题,提出一种基于区域亮度自适应校正的脐橙表面缺陷检测算法。【方法】选择区域经济价值较高的纽荷尔脐橙为研究对象,对其采集原始可见光RGB图像。试验中发现R-B融合分量图像灰度呈明显双峰分布,故根据直方图信息利用单阈值法(分割阈值T1=60)去除图像背景,获得R-B目标图像;基于本文提出的一种区域亮度自适应校正算法对脐橙表面缺陷进行检测,首先设定目标图像邻域窗口大小为w×w(邻域窗口大小w=13),通过对其窗口大小内较亮像素点的集合提取脐橙表面亮度信息,然后基于此表面亮度信息对去除背景的R-B目标图像进行均一化校正,经亮度校正后的图像发现其表面缺陷区域与正常组织区域灰度对比度大,宜采用单阈值法(分割阈值T=194)直接对亮度校正后的脐橙图像进行表面缺陷分割提取;最后对表面缺陷分割后的二值化图像进行面积滤波以去除杂散点及噪声。【结果】采用双峰法可在有效去除图像背景的同时完好保留目标脐橙表面信息;基于区域亮度自适应校正算法对溃疡病果、蓟马虫果、介壳虫果、虫伤果、黑星病果、风伤果、炭疽病果、裂伤果等8种常见脐橙表面缺陷果,共计356幅样本图像进行亮度校正,采用单阈值法对亮度校正后的图像进行表面缺陷分割,其分割率高,整体缺陷准确识别率达到了95.8%,平均处理每幅图像耗时0.29 s。与直方图均衡化算法、基于Retinex理论算法以及基于照度-反射理论算法得到的亮度校正图像相比,本文算法亮度校正效果最优且算法简单、缺陷识别率高、计算速度快,其运算速度分别减少了0.27、0.14和1.45 s,缺陷识别率提高了2.6%—8.2%。【结论】基于区域亮度自适应校正的脐橙表面缺陷检测算法有效解决了脐橙类水果表面亮度分布不均导致的表面缺陷难分割问题,为脐橙在线精确分级提供了技术支持,也为其他类球型水果表面缺陷快速检测提供了一种新方法。

关键词: 类球型水果, 脐橙, 亮度校正, 阈值分割, 缺陷检测

Abstract:

【Objective】 Because of uneven lightness distribution on navel orange surface due to its geometric shape of sphere to oval, it is difficult to segment directly the defect area from the orange image by single threshold method. In order to solve this problem, a novel detection method of the surface defects of navel orange based on the region brightness adaptive correction algorithm was proposed in this study. 【Method】 The Newhall navel orange with high economic value was selected as the research object, and its original image was collected using self-developed image acquisition system. During this experiment, it was found that the gray level of R-B fused component image had obvious bimodal distribution, and the color contrast between the background and the foreground of the original image was relatively large. Therefore, the background was removed using the mask generated by R-B fused component image and the single threshold method. The R-B target image was extracted with the background removed, which could effectively remove the background without damaging the navel orange surface. Then, the brightness information of the target image was calculated based on the region adaptive brightness correction algorithm proposed in this work, and the brightness information was estimated according to the set of brighter pixels in the neighborhood of the points on the target image. In this study, the neighborhood window size was set to w×w, and the value of w was set to 13 by experiment comparison. The pixels in the neighborhood were moved on the target image pixel by pixel, and a new matrix was generated. The new matrix was sorted in ascending order in the column, then the last row was removed to exclude the influence of white noise, and the last five rows were selected and the matrix was obtained by means of column operation. The matrix was inversely transformed and stored. Finally, the matrix image with the same size of the target image, that was, the surface brightness information of the target image was obtained. Based on the obtained luminance information, the R-B fused component image after background removal was corrected by luminance homogenization. After brightness correction, the gray contrast between the defect area and the normal tissue area of the image was relatively large. The single threshold method (segmentation threshold T=194) could be used to extract the surface defect directly from the brightness corrected navel orange image. Finally, the area filter was applied to the binary image after surface defect segmentation to remove the spurious points and noise. 【Result】 The bimodal method could effectively remove the background of the image and preserve the surface information of the target navel orange. All the sample images were also corrected and inspected by using other brightness correction algorithms, including histogram equalization algorithm, Retinex theory algorithm and illumination-reflection theory algorithm. The experimental results showed that the algorithm proposed in this study could correct both the middle and the edge of the normal region of the image, which were to be highlighted and the fluctuation range of the gray scale difference was small, while the defect regions still exhibited low gray level. The average processing time of each image was 0.29 seconds in proposed algorithm. Compared with the other three algorithms, the average processing time of each image could be reduced 0.27 s, 0.14 s, and 1.45 s by proposed algorithm. Finally, the algorithm proposed in this study combined with single threshold method, and it was used to detect the defects of 356 Newhall navel orange samples. Based on this algorithm, 8 kinds of common navel orange surface defects (e.g., canker, thrips, scale infestation, insect injury, blackspot, wind damage, anthracnose, dehiscent) were detected, and the defect recognition rate reached 95.8%. The correct defect recognition rate was improved by 2.6%-8.2% which compared with other three algorithms. 【Conclusion】 The proposed algorithm effectively solved the problem of defect segmentation caused by uneven brightness distribution on the surface of spherical fruits, provided technical support for online accurate classification of navel orange fruits, and provided a new idea for rapid detection of surface defects for other fruits.

Key words: spherical fruit, navel orange, brightness correction, threshold segmentation, defect detection