Segmentation of Navel Orange Surface Defects Based on Mask and Brightness Correction Algorithm
ZHANG Ming1,2, LI Peng2, DENG Lie2, HE ShaoLan2, YI ShiLai2, ZHENG YongQiang2, XIE RangJin2, MA YanYan2, Lü Qiang,21 College of Engineering and Technology, Southwest University, Chongqing 400716 2 Citrus Research Institute, Southwest University/Chinese Academy of Agricultural Sciences, Chongqing 400712
Abstract 【Objective】 The purpose of this study was to effectively solve the problem that some defects of fruit images with defective peels were mistakenly divided into backgrounds when removing background, and it was difficult to effectively segment and extract fruit surface defects.【Method】 Taking Newhall navel orange as the research object, this paper proposed to remove the background based on HSI color space model method to construct the mask template with I component image, and to select a single threshold (T=75) by bimodal method according to its gray histogram information and filled the holes to obtain a mask template. At last, the mask template and I component image were obtained by dot multiplication to obtain I component image from which the background was removed. A multi-scale Gaussian function image brightness correction algorithm was proposed to correct the brightness of I component image after removing the background. By constructing a multi-scale Gaussian function filter, I component image with the background removed and the constructed multi-scale Gaussian function filter were convoluted to obtain the surface illumination component image of I component image after the background was removed. Finally, the I component image after removing the background and the obtained illumination component image were subjected to dot division operation to obtain a luminance correction image of the I component image after the background was removed. At last, the surface defects of navel orange were extracted by a single global threshold method.【Result】 The background was removed based on the HSI color space model method, and the surface information of the navel orange could be preserved while the background was effectively removed, which was beneficial to subsequent operations. The image brightness correction algorithm based on multi-scale Gaussian function was used to extract the defects of the six common navel orange defects, and then the single-threshold method was used to extract the defects. Therefore the surface defects of navel oranges with different gray levels were successfully segmented at one time, and the segmentation rate was up to 100%, the lowest was 88.5%, and the total was 92.7%. Through experimental analysis, it was found that the cause of partial mis-segmentation or leakage segmentation was mainly due to the fact that some defects were lighter in color, and the difference in gray level from normal region was smaller, resulting in leakage segmentation. There were still some defects due to the small defect area, which was mistaken for noise removal during image morphology processing. At the same time, the false positive rate of normal fruit was also found to be 10.8%. It was found that the fold of a part of the normal fruit epidermal tissue area was located in the edge area of the image, which was mistaken for the defect of the edge area, resulting in misjudgment.【Conclusion】 The experimental results showed that image removal based on HSI color space model and image brightness unevenness correction algorithm based on multi-scale Gaussian function had achieved good results for background image segmentation of Newhall navel orange image and I component image surface brightness correction after background removal. It provided technical support for the precise grading of navel oranges and also provided a new idea for the rapid detection of other fruit surface defects. Keywords:navel orange;surface defect;segmentation;remove background;brightness correction;single threshold
PDF (3450KB)元数据多维度评价相关文章导出EndNote|Ris|Bibtex收藏本文 本文引用格式 张明, 李鹏, 邓烈, 何绍兰, 易时来, 郑永强, 谢让金, 马岩岩, 吕强. 基于掩模及亮度校正算法的脐橙表面缺陷分割[J]. 中国农业科学, 2019, 52(2): 327-338 doi:10.3864/j.issn.0578-1752.2019.02.011 ZHANG Ming, LI Peng, DENG Lie, HE ShaoLan, YI ShiLai, ZHENG YongQiang, XIE RangJin, MA YanYan, Lü Qiang. Segmentation of Navel Orange Surface Defects Based on Mask and Brightness Correction Algorithm[J]. Scientia Acricultura Sinica, 2019, 52(2): 327-338 doi:10.3864/j.issn.0578-1752.2019.02.011
Table 2 表2 表2基于多尺度高斯函数图像亮度校正算法的单阈值缺陷分割结果 Table 2Single threshold defect segmentation result based on multi-scale Gaussian function image brightness correction algorithm
VIJAYAREKHAK . Segmentation techniques applied to citrus fruit images for external defect identification , 2012,4(24):5313-5319. [本文引用: 1]
ZHANG BH, HUANG WQ, LIANGG, LI JB, ZHAO CJ, LIU CL, HUANG DF . Computer vision detection of defective apples using automatic lightness correction and weighted RVM classifier , 2015,146:143-151. DOI:10.1016/j.jfoodeng.2014.08.024URL [本文引用: 1]
IQBAL SM, GOPALA, SANKARANARAYANAN PE, NAIR AB . Classification of selected citrus fruits based on color using machine vision system , 2016,19(2):272-288. DOI:10.1080/10942912.2015.1020439URL [本文引用: 1]
RONGD . Study on rapid detection of navel orange surface defect based on machine vision and embedded system application [D]. , 2017. ( in Chinese) [本文引用: 1]
BAI XB, SONG EL, LI RJ, XU JT . Fast and accurate segmentation method for surface defects of citrus Journal of Shenyang Agricultural University, 2018,49(2):242-249. (in Chinese) [本文引用: 1]
ZHOU SQ, YING YB . Color models and their applications in color inspection and farm produce grading Journal of Zhejiang University, 2003,29(6):684-688. (in Chinese) [本文引用: 1]
THROOP JA, ANESHANSLEY DJ, UPCHURCH BL, ANGERB . Apple orientation on two conveyors: Performance and predictability based on fruit shape characteristics , 2001,44(1):99-109. DOI:10.13031/2013.2294URL [本文引用: 1]
LIJ, RAOX, WANGF, WUW, YINGY . Automatic detection of common surface defects on oranges using combined lighting transform and image ratio methods , 2013,82(4):59-69. [本文引用: 1]
LI JB, RAO XQ, YING YB . Correction algorithm of illumination nonuniformity on fruit surface and defects extraction using single threshold value Transactions of the Chinese Society of Agricultural Machinery, 2011,42(8):159-163. (in Chinese) [本文引用: 1]
TAOY, WENZ . An adaptive spherical image transform for high-speed fruit defect detection , 1999,42(1):241-246. DOI:10.13031/2013.13201URL [本文引用: 1]
FENGB, WANG MH . Study on identifying measurement about default of fruit in computer vision Journal of China Agricultural University, 2002,7(4):73-76. (in Chinese) [本文引用: 2]
付峰, 应义斌 . 球体图像灰度变换模型及其在柑桔图像校正中的应用 , 2004,20(4):117-120. Magsci [本文引用: 1] 由于水果形状不规则,在利用机器视觉和图像处理技术进行水果品质检测和自动分级过程中,会产生图像失真现象。针对这一问题,通过分析在6个位置采集的3种不同尺寸、19种不同表面颜色的标准试验球体的图像,研究了球体的大小、表面颜色和图像采集位置等因素对球体图像灰度失真的影响,并分别建立了位于摄像视区中心的球体图像的灰度校正模型和偏离摄像视区中心的球体图像的灰度校正模型,模型的相关系数R<sup>2</sup>分别为0.796和0.842。最后,采用该模型在MATLAB软件平台上构建了柑桔图像的灰度校正算法。试验结果 FUF, YING YB . Gray level transform model of ball image and its application in citrus image correction Transactions of the Chinese Society of Agricultural Engineering, 2004,20(4):117-120. (in Chinese) Magsci [本文引用: 1] 由于水果形状不规则,在利用机器视觉和图像处理技术进行水果品质检测和自动分级过程中,会产生图像失真现象。针对这一问题,通过分析在6个位置采集的3种不同尺寸、19种不同表面颜色的标准试验球体的图像,研究了球体的大小、表面颜色和图像采集位置等因素对球体图像灰度失真的影响,并分别建立了位于摄像视区中心的球体图像的灰度校正模型和偏离摄像视区中心的球体图像的灰度校正模型,模型的相关系数R<sup>2</sup>分别为0.796和0.842。最后,采用该模型在MATLAB软件平台上构建了柑桔图像的灰度校正算法。试验结果
LóPEZ-GARCíAF, ANDREU-GARCíAG, BLASCOJ, ALEIXOSN, VALIENTE JM . Automatic detection of skin defects in citrus fruits using a multivariate image analysis approach , 2010,71(2):189-197. [本文引用: 1]
BLASCOJ, ALEIXOSN , GóMEZ J, MOLTó. Citrus sorting by identification of the most common defects using multispectral computer vision , 2007,83(3):384-393. DOI:10.1016/j.jfoodeng.2007.03.027URL [本文引用: 1]
ZHANG HL, GAO JF, HEY . Nondestructive detection of citrus defection using hyper-spectra imaging technology Transactions of the Chinese Society of Agricultural Machinery, 2013,44(9):177-181. (in Chinese) [本文引用: 1]
ZHANG BH, LI JB, FAN SX, HUANG WQ, ZHANGC, WANG QY, XIAO GD . Principles and application of hyperspectral imaging technique in quality and safety inspection of fruits and vegetables Spectroscopy and Spectral Analysis, 2014,34(10):2743-2751. (in Chinese) DOI:10.3964/j.issn.1000-0593(2014)10-2743-09Magsci [本文引用: 1]
LI JB . Study on rapid detection methods of defects on navel orange surface [D]. , 2012. ( in Chinese) [本文引用: 3]
李江波, 饶秀勤, 应义斌, 马本学, 郭俊先 . 基于掩模及边缘灰度补偿算法的脐橙背景及表面缺陷分割 , 2009,25(12):133-137. Magsci [本文引用: 3] 缺陷检测一直是利用计算机视觉技术进行水果自动分级的难点。为了解决带有缺陷的水果在图像分割时部分缺陷容易被误分割为背景这一问题,以脐橙为研究对象,首先提取B分量,利用B分量构建掩模图像,然后对R分量图像进行掩模,从而在不损伤缺陷的情况下实现了水果与背景100%分割。考虑到水果呈球状,检测时边缘灰度较低,在缺陷分割时容易出现误分割,提出快速水果图像边缘灰度补偿算法,利用此算法,对6种常见脐橙缺陷,共计220幅图像,设定分割阈值为165,使不同灰度等级的缺陷一次性分割成功,分割率最高为100%,最低为79.5%。试验结果表明由于单阈值的使用,提高了缺陷分割效率。 LI JB, RAO XQ, YING YB, MA BX, GUO JX . Background and external defects segmentation of navel orange based on mask and edge gray value compensation algorithm Transactions of the Chinese Society of Agricultural Engineering, 2009,25(12):133-137. (in Chinese) Magsci [本文引用: 3] 缺陷检测一直是利用计算机视觉技术进行水果自动分级的难点。为了解决带有缺陷的水果在图像分割时部分缺陷容易被误分割为背景这一问题,以脐橙为研究对象,首先提取B分量,利用B分量构建掩模图像,然后对R分量图像进行掩模,从而在不损伤缺陷的情况下实现了水果与背景100%分割。考虑到水果呈球状,检测时边缘灰度较低,在缺陷分割时容易出现误分割,提出快速水果图像边缘灰度补偿算法,利用此算法,对6种常见脐橙缺陷,共计220幅图像,设定分割阈值为165,使不同灰度等级的缺陷一次性分割成功,分割率最高为100%,最低为79.5%。试验结果表明由于单阈值的使用,提高了缺陷分割效率。
李江波, 饶秀勤, 应义斌 . 基于照度-反射模型的脐橙表面缺陷检测 , 2011,27(7):338-342. Magsci [本文引用: 2] 水果表面缺陷是影响水果价格最主要的因素之一,目前大部分研究基于静态图像采用较复杂的算法分割水果表面缺陷。该文介绍了一种基于在线水果图像的表面亮度均一化校正及单阈值缺陷分割方法。首先,通过RGB颜色空间转换获取HIS空间图像的色调(H)分量,基于H分量建立掩模对RGB图像的R分量执行掩模去背景;然后,基于照度-反射模型,利用低通滤波获取R分量图像的亮度分量,利用此亮度分量对去背景后的R分量图像进行亮度校正;最后,利用一个简单的阈值对亮度校正后的图像进行缺陷分割。利用此算法,对416幅图像的检测结果表明总体检测正确率超过99%。该方法简单、有效,在在线水果缺陷检测中具有较大的应用潜力。 LI JB, RAO XQ, YING YB . Detection of navel surface defects based on illumination-reflectance model Transactions of the Chinese Society of Agricultural Engineering, 2011,27(7):338-342. (in Chinese) Magsci [本文引用: 2] 水果表面缺陷是影响水果价格最主要的因素之一,目前大部分研究基于静态图像采用较复杂的算法分割水果表面缺陷。该文介绍了一种基于在线水果图像的表面亮度均一化校正及单阈值缺陷分割方法。首先,通过RGB颜色空间转换获取HIS空间图像的色调(H)分量,基于H分量建立掩模对RGB图像的R分量执行掩模去背景;然后,基于照度-反射模型,利用低通滤波获取R分量图像的亮度分量,利用此亮度分量对去背景后的R分量图像进行亮度校正;最后,利用一个简单的阈值对亮度校正后的图像进行缺陷分割。利用此算法,对416幅图像的检测结果表明总体检测正确率超过99%。该方法简单、有效,在在线水果缺陷检测中具有较大的应用潜力。
LIU ZC, WANG DW, LIUY, LIU XJ . Adaptive adjustment algorithm for non-uniform illumination images based on 2D gamma function Transaction of Beijing Institute of Technology, 2016,36(2):191-196. (in Chinese) [本文引用: 2]
WANG DW, WANGJ, XU ZJ, LIUY . Adaptive correction algorithm for non-uniform illumination images Journal of Systems Engineering and Electronics, 2017,39(6):1383-1390. (in Chinese) [本文引用: 2]
YING YB . Study on background segment and edge detection of fruit image using machine vision Journal of Zhejiang University, 2000,26(1):35-38. (in Chinese) [本文引用: 2]
XIAO JS, PENGH, ZHANG YQ, TU CP, LI QQ . Fast image enhancement based on color space fusion , 2016,41(1):22-31. [本文引用: 1]
JIANG BJ, ZHONG MX . Improved histogram equalization algorithm in the image enhancement Laser and Infrared, 2014,44(6):702-706. (in Chinese) [本文引用: 1]
LAND EH . An alternative technique for the computation of the designator in the Retinex theory of color vision , 1986,83(10):3078-3080. DOI:10.1073/pnas.83.10.3078URL [本文引用: 1]
LI FW, JIN WQ, CHEN WL, CAOY, WANGX, WANG LX . Global color image enhancement algorithm based on Retinex model Transaction of Beijing Institute of Technology, 2010,30(8):947-951. (in Chinese) [本文引用: 1]
ZHAO YM, WANG LX, JIN WQ, LUOY, SARITPORNV . A color transfer method for colorization of grayscale image based on region histogram statistics Transaction of Beijing Institute of Technology, 2012,32(3):322-326. (in Chinese) [本文引用: 1]
ZHAO JW, LIU JH, CHEN QS, SARITPORNV . Detecting subtle bruises on fruits with hyperspectral imaging Transactions of the Chinese Society of Agricultural Machinery, 2008,39(1):106-109. (in Chinese) [本文引用: 1]