王小鹏,姚丽娟,文昊天,赵君君
形态学多尺度重建结合凹点匹配分割枸杞图像
王小鹏,姚丽娟,文昊天,赵君君
(兰州交通大学电子与信息工程学院,兰州 730070)
针对枸杞分级过程中因图像噪声、光照不均匀和粘连等造成枸杞难以准确分割的问题,提出了一种基于形态学多尺度开闭重建结合凹点匹配的分割方法。首先提取原始图像的红色分量去除枸杞光照阴影噪声,利用形态学多尺度混合开闭重建对红色分量图像进行重建,平滑枸杞内部而保留轮廓边缘信息;然后采用8邻域跟踪算法提取粘连枸杞轮廓边缘;最后运用圆形模板检测粘连枸杞的轮廓凹点,以凹点间最短欧氏距离为匹配条件连接凹点对,并对匹配错误的凹点对进行修正,实现粘连枸杞分割。试验结果表明,该文方法分割准确率较高,而过分割率较低,相比标记控制的分水岭和直接凹点匹配分割等方法,对粘连枸杞分割效果较好,分割准确率可达到96%。该研究可为枸杞分割技术提供理论支撑。
图像分割;图像采集;农作物;多尺度开闭重建;边缘提取;凹点匹配
传统枸杞分级主要采用人工挑拣判别枸杞大小、颜色及表面缺陷,这种方式费时费力,等级难以保证,机器视觉技术[1-4]能够提升枸杞分级效率,其中枸杞图像分割是关键步骤之一,分割的准确率直接关系到后续的识别和统计精度。通常枸杞经晾晒烘干后采集的图像存在枸杞颗粒噪声、光照不均匀、颗粒间有粘连和重叠等现象,造成其分割困难。针对这类颗粒图像,学者们提出了各种各样的分割方法[5-8],Nee等[9]提出了形态学算子结合分水岭的分割方法;Quan等[10]采用数学形态学算子和维纳滤波净化背景并结合边缘检测实现玉米粒的分割;王桂芹等[11]提出利用FCM算法和标记分水岭算法相结合对粘连岩石颗粒进行分割;李文勇等[12]提出了利用形状因子对图像中的每个区域进行粘连判定的方法。对于粘连颗粒图像的分割,凹点匹配[13-16]可以检测出相互粘连的部分,Song等[17]提出了基于凹点和改进的分水岭算法分割粘连血细胞;谢忠红等[18]提出了一种基于凹点搜索的快速定位和检测重叠果实目标的方法;曾庆兵等[19]采用凹点分割方法分离重叠葡萄果实;刘伟华等[20]提出了基于凹点搜索的重叠粉体颗粒的自动分离算法,根据凹点和颗粒个数的对应关系确定颗粒的重叠程度,对不同重叠程度的颗粒采用不用的匹配规则来匹配凹点进而分离颗粒;Bai等[21]提出了基于凹点和椭圆拟合分离粘连血细胞的方法,借助粘连血细胞间的凹点将各个血细胞的轮廓分为具有相似性特征的轮廓段,采用了最小二乘法对各轮廓段进行椭圆拟合实现粘连血细胞的分离。此类方法能够较准确地实现复杂粘连颗粒目标的分割,但凹点匹配条件相对较复杂,且选取不当容易造成错分割。
为了在图像噪声、光照不均匀和粘连等因素干扰环境下,提高枸杞的分割准确率,提出了一种形态学多尺度重建结合凹点匹配相结合的枸杞图像分割方法,该方法通过形态学多尺度混合开闭重建滤除颗粒噪声,平滑枸杞内部因光照阴影等,利用最大类间方差法[22]对重建图像进行二值化提取枸杞区域,通过形态学填充[23]消除枸杞内部孔洞,利用形态学面积开[24]运算筛选出单个非粘连颗粒;然后采用8邻域跟踪算法[25]提取剩余粘连枸杞的单像素轮廓边缘;最后采用圆形模板检测轮廓凹点并利用改进的凹点匹配规则匹配凹点,实现粘连枸杞的分割,最终分割结果为单个非粘连和粘连枸杞分割结果的合并。
枸杞颗粒在晾晒烘干过程中受环境和颗粒缩水等因素影响,使得(charge coupled device, CCD)相机获取的颗粒噪声较大,细节较多,造成过凹点检测从而产生过分割。通常非规则细节和噪声成分比目标小,因此细节和噪声与图像目标信息具有可分离性。形态学尺度空间[26]能够有效地保留感兴趣的轮廓边缘而消除细节,避免边缘轮廓模糊和定位偏移。为此采用形态学多尺度开闭重建[27]对枸杞进行预处理,去除噪声和细节干扰。
形态学多尺度混合开闭重建运算定义为多尺度开闭和闭开运算的平均,即
经形态学多尺度混合开闭重建后,颗粒噪声和枸杞内部非规则细节被平滑消除,同时保持了区域轮廓的完整性。利用最大类间方差法将重建图像二值化,并对二值图像求补后做填充运算消除因光线和背景导致的内部孔洞。图1a~图1d给出了粘连枸杞图像的预处理过程结果,可以看出,二值化后提取出了全部枸杞,但存在粘连枸杞,为此,需要进一步对这部分粘连枸杞进行分离,以完全分割出枸杞。
由于粘连枸杞部分的分割不涉及单个颗粒,因此首先通过形态学面积开运算筛选出单个枸杞颗粒区域,然后对剩余的粘连颗粒作进一步分割。由于相互粘连的枸杞具有椭球体状特点,在粘连接触的轮廓边缘处存在凹点,而准确地实现凹点匹配是粘连枸杞分割的关键。本文首先采用8邻域跟踪算法提取粘连枸杞颗粒,然后采用圆形模板检测单像素轮廓边缘凹点,最后利用最短欧氏距离匹配凹点对,并对匹配错误凹点对运用改进的凹点匹配修正规则进行修正,实现粘连枸杞分割。
枸杞颗粒因相互粘连在轮廓边缘处产生的凹点可用于分割粘连枸杞,而单像素轮廓边缘有利于凹点检测。因此,本文采用8邻域跟踪算法提取粘连枸杞的单像素轮廓边缘,算法准则是从粘连颗粒二值图像左上角开始逐点扫描,当遇到边缘点时开始跟踪,直至跟踪的后续点回到起始点。如果为非闭合线,则跟踪一侧后需从起点开始朝相反方向跟踪到另一尾点,一条线跟踪完毕后,接着扫描下一个未跟踪点,直至图像内所有的边缘都跟踪完毕。
轮廓边缘跟踪如图2,图2a为图2b轮廓跟踪的8个方向编号及偏移量,黑点表示轮廓边界点,跟踪起始点为最右下方黑点,跟踪初始方向为左上方45°。跟踪开始后,起始点沿初始跟踪方向检测是否该方向有黑点(检测距离为1个像素),图中该方向有轮廓边界点,保存起始点,将检测到的点作为新起始点,在原来检测方向基础上,逆时针旋转90°作为新的跟踪方向,非黑点的则沿顺时针旋转45°,沿新跟踪方向继续检测,直到找到黑点,然后将跟踪方向逆时针旋转90°作为新的跟踪方向。重复上述方法,不断改变跟踪方向,直到找到新的轮廓边界点,找到新轮廓边界点后,保存旧轮廓边界点,把新轮廓边界点作为新的起始点,这样重复至最先开始的检测点为止,具体实现步骤如下。
Step1:获取二值图像高和宽;
Step2:初始化内存缓冲区;
Step3:跟踪轮廓边缘点,将内存缓冲区中检测到的轮廓边缘点的相应位置0;
Step4:根据上述跟踪准则,重复Step 3,直至回到起始点;
Step5:将内存缓冲区内容复制到原二值图像中。
图2 轮廓边缘跟踪示意图
提取粘连枸杞的轮廓边缘后,为了实现凹点匹配分割,首先需要进行检测轮廓边缘凹点。目前凹点检测方法有很多种[28-30],文中采用圆形模板检测二值化粘连枸杞颗粒轮廓的凹点。首先定义半径为,圆点在轮廓边缘上逐点移动的圆,为圆点个数,由此可得凹点C为
其中|A|表示圆形模板位于颗粒内部的弧长。检测准则为
图3为圆形模板检测凹点示意图,其中1,2,…,6为待检测凹点,|1|, |2|, …, |6|为圆形模板位于枸杞内部的弧段,当圆心在枸杞轮廓边缘上逐点移动时,依据检测准则判别圆心是否为凹点,并对凹点进行标记。
注:Ai表示圆形模板位于颗粒内部的弧段,Ci为待检测凹点,i=1,2,…,6。
由于检测到的粘连枸杞轮廓边缘凹点是成对出现的,而正确匹配凹点能够实现粘连枸杞的正确分割,因此对上述已检测到的所有凹点进行匹配可实现粘连枸杞分割。首先根据各凹点之间的最短欧氏距离匹配凹点对,然后对已匹配的凹点对进行修正处理以消除错误匹配。若检测到的粘连凹点为C(i=1,2,…,),对应坐标为(x,y),则任意2凹点C与C之间的欧氏距离d为
已匹配凹点修正规则为:以已匹配凹点连线中点为起始检测点,分别从垂直于连线的两侧方向逐点扫描,当一侧先检测到边缘点,而另一侧未检测到边缘点时,则判定该匹配对为错误匹配;当两侧按某一固定像素数均未检测到边缘点时,则判定该匹配对为正确匹配。对于错误匹配的凹点对,按照凹点间次最短欧氏距离重新进行匹配,再进行修正。
具体凹点匹配步骤如下
Step1:对各凹点按照相互之间欧氏距离大小,由小到大进行排序;
Step2:选取第一个凹点,计算并匹配连接与其距离最小的凹点;
Step3:根据上述已匹配凹点修正规则对Step2中已匹配的凹点进行修正;
Step4:对匹配错误的凹点,计算并连接与其次最小距离的凹点,按照已匹配凹点的修正规则,重复执行Step3,直至所有凹点匹配完毕。
图4为凹点匹配示意图,其中~为待匹配凹点,线段表示凹点和的正确匹配结果,线段为凹点和的错误匹配结果。匹配开始时,首先从凹点开始扫描待匹配凹点,根据最短距离匹配规则匹配连接凹点和凹点;然后再根据已匹配凹点修正规则,从线段的两侧方向(虚线箭头方向)逐像素扫描,扫描至设定阈值个像素时,未检测到边界点,判定线段为正确匹配结果,同理修正凹点和的匹配结果时,在线段两侧方向扫描至第5个像素点时,左侧检测到边界点,而右侧没有检测到边界点,因此判定线段为错误匹配结果;最后重新计算与凹点或者距离最小的凹点,重复进行匹配修正。
注:A~F为待匹配凹点。
为验证分割方法性能,仿真选取两幅粘连枸杞图像,在CPU2.3G内存2G的计算机上利用Matlab2012从分割区域准确率和过分割等方面进行了验证分析,并与标记控制分水岭分割以及直接凹点匹配方法等作了对比。实验中尺度=11,圆形模板半径取15像素,匹配修正扫描像素阈值取15像素。
图5给出了粘连枸杞分割过程的结果图像,经过多尺度混合开闭重建后(图5a),噪声和枸杞内部细节得到了消除和平滑,同时目标轮廓没有出现偏移,通过边缘提取后的枸杞颗粒(图5b)存在粘连,但均被提取出来,未出现遗漏,经过凹点检测(图5c)和凹点匹配分割(图5d)后,粘连枸杞得到分离。
相比标记控制分水岭分割(图5e),本文方法过分割明显减少,完整分割出了全部单个枸杞。图5f对原始图像未进行形态学多尺度开闭重建,而直接采用凹点匹配的分割结果,可以看出,在没有消除颗粒噪声的情况下,单个非粘连颗粒未能剔除,并且由于噪声影响,致使检测凹点过多,而凹点匹配过程中又因为颗粒内部存在孔洞噪声,造成无法正确匹配连接凹点对,从而出现了欠分割和过分割。
图5 图像I不同方法分割结果
Fig.5 Different methods segmentation results of image I
图6为第2幅粘连枸杞分割结果,图6a为原始粘连枸杞图像,大小为370×545像素;图6b为本文方法分割结果,大部分枸杞单体被正确分割出来,个别如方框内凹点1、2未被匹配而出现欠分割,其原因是此种情况下的枸杞颗粒边缘重叠部分恰好覆盖了另一待匹配凹点;图6c~d为标准分水岭及标记控制分水岭分割结果,由于粘连的枸杞颗粒较多,颗粒光照不均匀,内部细节和噪声较多,因此过分割现象较严重;图6e为直接采用凹点匹配的分割结果,存在欠分割和过分割。图6f为采用分水岭和凹点检测相结合方法[30]的分割结果,大部分枸杞颗粒被分割出来。
图7 尺度n、半径R和阈值T对分割结果的影响
为了定量分析粘连枸杞分割的准确率,统计实际枸杞颗粒数和分割后的区域数,采用过分割率和准确率以及方法运算时间度量分割的性能。过分割率定义为
其中为分割区域数,为人工勾画颗粒数,N为分割区域与人工勾画颗粒重叠数。
准确率定义为
越大,越小,表示分割准确率越高,越接近实际的颗粒个数。
表1和表2分别为本文方法和其他几种不同分割方法对图5和图6枸杞图像分割准确率等性能指标的对比,其中表示运算时间。可以看出,相比其他方法,本文方法对粘连枸杞颗粒的分割准确率较高,可达到96%,而过分割率较低不大于2%。运算时间高于其他方法,但如果将算法经过优化移植到DSP处理器,将会满足实时性要求。
表1 不同分割方法对比(图5)
注:M, Nr, Q, P和S分别表示分割区域数,区域重叠数,过分割率,准确率和运算时间。
Note: M, Nr, Q, P and S respectively denote segmentation region number, region overlap number,over-segmentation rate, accuracy rate and time consuming.
表2 不同分割方法对比(图6)
提出了一种基于形态学多尺度重建结合凹点匹配的枸杞图像分割方法,通过多尺度开闭重建运算滤除目标颗粒内部细节和噪声,利用最大类间方差法提取重建图像二值化提取杞区域,通过形态学面积开筛选分割出非粘连颗粒,减少后续凹点匹配的计算量;运用8邻域跟踪算法提取粘连枸杞的轮廓边缘,由于枸杞颗粒的椭球体状特点,使得相互粘连时边缘处产生凹点,采用圆形模板可以准确地实现边缘凹点的检测,另一方面枸杞颗粒的长宽比明显,对最小欧氏距离匹配错误的凹点对,根据其连接线中点到边界点的像素距离不对等的特点进行修正匹配,实现了粘连枸杞的准确分割,相比标记分水岭、单独的凹点匹配和分水岭结合凹点匹配等方法,分割准确率较高,最高可达到96%,而过分割率较低,最低不大于2%。另外,分割过程中尽可能地保持了目标颗粒的轮廓边缘信息,保证了后续颗粒分级的准确性。
[1] 王履程,谭筠梅,王小鹏,等. 基于机器视觉的枸杞分级方法[J]. 计算机工程与应用,2013,49(24):16-18.
Wang Lücheng, Tan Junmei, Wang Xiaopeng, et al. Wolfberry classification method based on machine vision[J]. Computer Engineering and Applications, 2013, 49(24): 16-18. (in Chinese with English abstract)
[2] 李青,彭彦昆. 基于机器视觉的猪胴体背膘厚度在线检测技术[J]. 农业工程学报,2015,31(9):256-261.
Li Qing, Peng Yankun. Pork back fat thickness on-line detection methods using machine vision[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2015, 31(9): 256-261. (in Chinese with English abstract)
[3] 陈红,夏青,左婷,等. 破损花菇机器视觉检测技术[J]. 农业机械学报,2014,45(11):60-67.
Chen Hong Xia Qing Zuo Ting, et al. Application of machine vision in detection of broken shiitake[J]. Transactions of the Chinese Society for Agricultural Machinery, 2014, 45(11): 60-67. (in Chinese with English abstract)
[4] 彭江南,谢宗铭,杨丽明,等. 基于Seed Identification软件的棉籽机器视觉快速精选[J]. 农业工程学报,2013,29(23):147-152.
Peng Jiangnan, Xie Zongming, Yang Liming, et al. Quickly selection for cotton seed based on seed identification software[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2013, 29(23): 147-152. (in Chinese with English abstract)
[5] 熊俊涛,邹湘军,刘念彭,等. 基于机器视觉的荔枝果实采摘时品质检测技术[J]. 农业机械学报,2014,45(7):54-60.
Xiong Juntao, Zou Xiangjun, Liu Nianpeng, et al. Fruit quality detection based on machine vision technology when picking litchi[J]. Transactions of the Chinese Society for Agricultural Machinery, 2014, 45(7): 54-60. (in Chinese with English abstract)
[6] 卢军,付雪媛,苗晨琳. 基于颜色和纹理特征的柑橘自动分级[J]. 华中农业大学报,2012,31(6):783-786.
Lu Jun, Fu Xueyuan, Miao Chenlin, et al. Citrus automatic grading by using color and texture features[J]. Journal of Huazhong Agricultural University, 2012, 31(6): 783-786. (in Chinese with English abstract)
[7] 李希,王天江,周鹏. 一种改进的粘连颗粒图像分割算法[J]. 湖南大学学报:自然科学版,2012,39(12):84-88.
Li Xi, Wang Tianjiang, Zhou Peng. An improved segmenting algorithm for touched particle image[J]. Journal Hunan University: Natural Sciences, 2012, 39(12): 84-88. (in Chinese with English abstract)
[8] 杨华东,简淼夫. 基于灰度形态重构的颗粒图像分割方法[J]. 南京工业大学学报:自然科学版,2005,27(3):98-102.
Yang Huadong, Jian Miaofu. The segmentation algorithm of particle image based on grayscale morphological reconstruction[J]. Journal of Nanjing University of Technology, 2005, 27(3): 98-102. (in Chinese with English abstract)
[9] Nee Lim Huey, Mashor Mohd Yusoff, Hassan Rosline. White blood cell segmentation for acute leukemia bone marrow images [J]. Journal of Medical Imaging & Health Informatics, 2012, 2(3): 357-361..
[10] Quan L, Jiang E. Automatic segmentation method of touching corn kernels in digital image based on improved watershed algorithm[C]// International Conference on New Technology of Agricultural Engineering, Zibo, China, 2011, 5(27/28/29): 34-37.
[11] 王桂芹,王正勇,罗代升.基于FCM和标记分水岭的粘连岩石颗粒图像分割[J]. 四川大学学报:自然科学版,2012,49(2):356-360.
Wang Guiqin, Wang Zhengyong, Luo Daisheng. Image segmentation of overlapping rock particles based on FCM and labeling watershed[J]. Journal of Sichuan University: Natural Science Edition, 2012, 49(2): 356-360. (in Chinese with English abstract)
[12] 李文勇,李明,钱建平,等. 基于形状因子和分割点定位的粘连害虫图像分割方法[J]. 农业工程学报,2015,31(5):175-180.
Li Wenyong, Li Ming, Qian Jianping, et al. Segmentation method for touching pest images based on shape factor and separation points location[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2015, 31(5): 175-180. (in Chinese with English abstract)
[13] 韦冬冬,赵豫红. 基于凹点匹配的重叠图像分割算法[J]. 计算机与应用化学,2010,27(1):99-102.
Wei Dongdong, Zhao Yuhong. An image segment algorithm for overlapped particles based on concave points matching [J]. Computers and Applied Chemistry, 2010, 27(1): 99-102. (in Chinese with English abstract)
[14] Yao Yuan, Wu Wei, Yang Tianle, et al. Head rice rate measurement based on concave point matching[J]. Scientific Reports, 2017, 7: 41353.
[15] Hobson D M, Carter R M, Yan Y. Rule based concave curvature segmentation for touching rice grains in binary digital images[C]//Instrumentation and Measurement Technology Conference, Singapore, Singapore, 2009(5): 1685-1689.
[16] Wei Lian, Lei Zhang. Point matching in the presence of outliers in both point sets: A concave optimization approach[J]. Simulation Modelling Practice & Theory, 2014, 41(1): 87-103.
[17] Song Hong, Zhao Qingjie, Liu Yinghong.Splitting touching cells based on concave-point and improved watershed algorithms [J]. Frontiers of Computer Science, 2014, 8(1): 156-162.
[18] 谢忠红,姬长英,郭小清,等. 基于凹点搜索的重叠果实定位检测算法研究[J]. 农业机械学报,2011,42(12):191-196.
Xie Zhonghong, Ji Changying, Guo Xiaoqing, et al. Detection and location algorithm for overlapped fruits based on concave spots searching[J]. Transactions of the Chinese Society for Agricultural Machinery, 2011, 42(12): 191-196. (in Chinese with English abstract)
[19] 曾庆兵,刘成良,苗玉彬,等. 基于形态学图像处理的重叠葡萄果径无损测量[J]. 农业工程学报,2009,25(9):356-360.
Zeng Qingbing, Liu Chengliang, Miao Yubin, et al. Non-destructive measurement of diameter of overlapping grape fruit based on morphological image processing[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2009, 25(9): 356-360. (in Chinese with English abstract)
[20] 刘伟华,隋青美. 基于凹点搜索的重叠粉体颗粒的自动分离算法[J]. 电子测量与仪器学报,2010,24(12):1095-1100.
Liu Weihua, Sui Qingmei. Automatic segmentation of overlapping powder particle based on searching concavity points[J]. Journal of Electronic Measurement and Instrument, 2010, 24(12): 1095-1100. (in Chinese with English abstract)
[21] Bai X, Sun C, Zhou F, Splitting touching cells based on concave points and ellipse fitting[J]. Pattern Recognition, 2009, 42(11): 2434-2446.
[22] 李擎,唐欢,迟健男,等. 基于改进最大类间方差法的手势分割方法研究[J]. 自动化学报,2017,43(4):528-537.
Li Qing, Tang Huan, Chi Jiannan, et al. Gesture segmentation with Improved maximum between-cluster variance Algorithm[J]. Acta Automatic Sinica, 2017, 43(4): 528-537. (in Chinese with English abstract)
[23] Kumar R, Pal M, Gulati T. Estimating corroded area of metallic surfaces using edge detection & hole filling[J]. International Journal of Engineering Trends and Technology, 2014, 11(11): 529-536.
[24] Gao H, Tham J Y, Xue P, et al. Complexity analysis of morphological area openings and closings with set union[J]. IET Image Processing, 2008, 2(4): 231-238.
[25] RafaelC.Gonzalez著,阮秋琦,等译. 数字图像处理(第三版)[M]. 北京:电子工业出版社,2017.
[26] Bosworth J H, Acton S T. Morphological scale-space in image processing[J]. Digital Signal Processing, 2003, 13(2): 338-367.
[27] 王小鹏,郝重阳,樊养余. 基于形态学尺度空间和梯度修正的分水岭分割[J]. 电子与信息学报,2006,28(3):485-489.
Wang Xiaopeng, Hao Chongyang, Fan Yangyu, Watershed segmentation technology based on morphological scale-space and Gradient modification[J]. Journal of Electronics & Information, 2006, 28(3): 485-489. (in Chinese with English abstract)
[28] Yan L, Park C W, Lee S R, et al. New separation algorithm for touching grain kernels based on contour segments and ellipse fitting[J]. Frontiers of Information Technology & Electronic Engineering, 2011, 12(1): 54-61.
[29] 李宏辉,郝颖,吴清潇,等. 基于凹点方向线的粘连药品图像分割方法[J]. 计算机应用研究,2013,30(9):2852-2854.
Li Honghui, Hao Ying, Wu Qingxiao, et al. Based on concave point direction line adhesion drug image segmentation method[J]. Application Research of Computers, 2013, 30(9): 2852-2854. (in Chinese with English abstract)
[30] Zhong Q, Zhou P, Yao Q,et al. A novel segmentation algorithm for clustered slender-particles[J]. Computers & Electronics in Agriculture, 2009, 69(2): 118-127.
Wolfberry image segmentation based on morphological multi-scale reconstruction and concave points matching
Wang Xiaopeng, Yao Lijuan, Wen Haotian, Zhao Junjun
(,730070,)
The traditional Chinese wolfberry classification usually adopts manual grading in terms of the wolfberry characteristics of size, color, surface defects, and so on. It is a time-consuming and inefficient work. Fortunately, machine vision provides an efficient and fast way to improve the classification efficiency and accuracy. During the process of wolfberry classification by machine vision, the first and important task is to segment wolfberry particles from the image, and then classify them into different grades according to their characteristics. However, the accuracy of wolfberry image segmentation process is often hindered by a number of constraints including noise, inhomogeneous intensity, complex adherent and overlapped particles, which easily cause the decline of segmentation accuracy, and subsequently affect the wolfberry classification effect. For the purpose to improve the accuracy and efficiency of wolfberry image segmentation, a method for efficient segmentation of adherent wolfberries based on morphological multi-scale reconstruction and concave points matching is hereby proposed. Firstly, the red component of the original color image is extracted to partially remove the shadow noise around or inside the wolfberries, and then the red component image is reconstructed by morphological multi-scale mixture opening-closing reconstruction to further smoothen the interior of wolfberries while preserving the contour edge information. Since such reconstruction operation can effectively retain the interesting contour edge of wolfberry particles and eliminate the irregular details, the influence of wolfberries edge contours blur and location offset on the subsequent classification will be greatly reduced. The binary regions of wolfberries are extracted from the reconstructed image by the method of maximum between-cluster variance, and the holes in the interior of wolfberries are filled by morphological filling operator. In the filled binary image, there are 2 kinds of wolfberries. One kind consists of single non-adherent wolfberries particles, and can be extracted by morphological area opening operation without further processing. The other kind mainly contains adherent or overlapped wolfberries particles, and needs to further segment, so 8-neighborhood tracking algorithm is used to extract the edge of single pixel contours of the adherent wolfberries. Taking into account that the shape of wolfberry is ellipsoid, the concave points usually locate in the edges where they are touched or overlapped with each other. Therefore the circular template is used to detect these edge concave points. For the incorrect concave point’s pairs matched by the shortest Euclidean distance as fitting condition, they can be modified according to the unequal pixel distance between the middle point of the connecting line and the boundary point since the length-to-width ratio of the wolfberry is obvious. When all the concave points’ pairs of the adherent wolfberries are confirmed, adherent wolfberries are clearly segmented. The final segmentation results are the combination of single non-adherent and adherent or overlapped wolfberries. The simulation results show that this method can achieve more accurate segmentation results and lower over-segmentation rate compared with the methods of mark-controlled watershed, direct concave points matching, and watershed combined with concave point segmentation, and is especially suitable for the segmentation of adherent wolfberries. The highest accurate segmentation rate is 96% while over-segmentation rate less than 2%.
image segmentation; image acquisition; crops; multi-scale opening and closing reconstruction; edge extraction; concave points matching
10.11975/j.issn.1002-6819.2018.02.029
TP391.41
A
1002-6819(2018)-02-0212-07
2017-09-26
2017-12-31
国家自然科学基金资助项目(61761027,61261029)
王小鹏,教授,博士生导师,主要从事图像处理与分析。 Email:wangxp1969@sina.com
王小鹏,姚丽娟,文昊天,赵君君. 形态学多尺度重建结合凹点匹配分割枸杞图像[J]. 农业工程学报,2018,34(2):212-218. doi:10.11975/j.issn.1002-6819.2018.02.029 http://www.tcsae.org
Wang Xiaopeng, Yao Lijuan, Wen Haotian, Zhao Junjun. Wolfberry image segmentation based on morphological multi-scale reconstruction and concave points matching[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(2): 212-218. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2018.02.029 http://www.tcsae.org