基于改进Graph Cut算法的生猪图像分割方法

2017-09-15 07:43孙龙清邹远炳李亿杨中国农业大学信息与电气工程学院北京100083
农业工程学报 2017年16期
关键词:分水岭像素点像素

孙龙清,李 玥,邹远炳,李亿杨(中国农业大学信息与电气工程学院,北京 100083)

基于改进Graph Cut算法的生猪图像分割方法

孙龙清,李 玥,邹远炳,李亿杨
(中国农业大学信息与电气工程学院,北京 100083)

生猪图像分割为生猪行为特征提取、参数测量、图像分析、模式识别等提供易于理解和分析的图像表示,准确有效的生猪图像分割是生猪行为理解和分析的基础。针对传统Graph Cut算法分割精度差、分割效率低及不能准确分割特定目标的问题,该文结合交互分水岭算法,提出基于改进Graph Cut算法的生猪图像分割方法。采用交互分水岭算法对图像进行区域划分,划分的各个区域块看作超像素,用超像素替代传统加权图中的像素点,构造新的网络图替代传统加权图,重新构造能量函数以完成前景背景的有效分割。试验结果表明:该方法峰值信噪比平均范围为[30,40],结构相似度平均范围为[0.9,1],两种评价准则的结果与主观评价一致,图像分割质量、精度得到明显提升;平均耗时缩短到传统Graph Cut算法的33.7%,提高了分割效率;在复杂背景、噪声干扰、光照强度弱等条件下可以快速分割出特定目标生猪,具有较高鲁棒性。

图像处理;图像分割;算法;改进;Graph Cut算法;超像素;交互分水岭算法

0 引 言

养殖环境对生猪生长发育起至关重要的作用[1-2],有效准确地提取出圈舍中生猪目标,分析识别生猪行为特征与环境因素的关系,是精准控制养殖环境最有效途径之一[3-5]。图像分割正是基于计算机视觉技术分析生猪行为特征的重要环节,为生猪行为特征提取、图像分析、模式识别等提供易于分析和理解的图像表示,准确有效的生猪图像分割算法是生猪行为分析、理解和环境智能决策的基础。

图像分割多年来受到高度重视,国内外研究者对其进行了广泛研究[6-8],尤其在复杂背景、复杂环境下,对基于交互式图像分割进行了更深入的理论研究和实践探索。Graph Cut算法是其中比较成功的基于组合最优交互式图像分割算法之一[9-11],利用最大流/最小割算法查找最优路径[12-14],完成目标图像分割。为了获得更好的分割效果,Freedman等[15]在Graph Cut中加入先验信息;Rother等[16]在Graph Cut基础上提出了Grab Cut算法,利用图像纹理(颜色)信息和边界(反差)信息,用少量用户交互操作即可得到比较好的分割结果;Nie等[17]提出一种新的查找最优路径算法,提高了Graph Cut目标提取质量。为了提高Graph Cut算法速度,Ren等提出超像素[18-20]概念;Li等[21]提出Lazy Snapping算法,在分割前对图像进行预处理,利用K-means算法将图像分成小块,将各小块作为加权图中的节点,减少了计算复杂程度;Shi等[22]提出了归一化方法(Ncut),该算法利用轮廓特征和纹理特征构建全局最小化代价函数,能生成规则超像素,缺点是图像边界保持不完整、计算量较大,处理大图像时速度慢;Comaniciu提出均值漂移(mean shift)算法[23],是一种非参数基于密度梯度上升方向的迭代算法,能生成形状规则的超像素,由于不断重复计算像素,使得运算速度较慢;Vincent等[24]提出了分水岭(watershed)方法,该方法速度快,不能控制超像素个数、大小和紧凑度;高理文等[25-26]提出标记分水岭算法(markerbased watershed),可有效控制超像素数量,指定分割区域,降低图节点数量、提高算法速度,有效地克服边缘过分割。

由于传统Graph Cut算法分割精度差、分割效率低及不能准确分割特定目标,针对Graph Cut算法局限性和生猪图像自身特点,本文结合交互标记分水岭算法,提出基于改进Graph Cut算法的生猪图像分割方法。人工交互划定分块区域,以超像素代替原始图像中像素点,重新构建网络图[27],实现特定目标生猪图像快速准确的分割。

1 材料和方法

1.1 图像采集

试验所用图像于2016年在山东临沂金锣牧业有限公司第十七种猪养殖场采集,共采集有效图像150张进行试验。该养殖场存栏种猪约5 000头,养殖场信息化程度较高。

1.2 算法原理

由于受到生猪养殖环境的影响,采集到的生猪图像具有低对比度、噪声干扰强等特点。结合交互分水岭算法,本文提出基于改进Graph Cut算法的生猪图像分割方法,以期可以在复杂背景[28-29]下快速准确地分割出特定目标。

1.2.1 分水岭算法

分水岭算法[30]具有简洁、复杂度低、运行速度快、提取物体边缘轮廓线封闭、能准确确定目标物体等特点。主要算法步骤如下:

1)构建梯度图像

式中⊕表示形态学膨胀,Θ表示形态学腐蚀,(,)fij为待分割图像,(,)gij为形态学梯度图像,(,)bij表示圆盘状结构元素,圆盘形结构元素半径较小,满足旋转不变性,可消除梯度对边缘方向的依赖,不会造成图像特征值的畸变。

2)对图像中所有像素点进行梯度阈值比较,记录各像素点标记值和坐标。

式中n为当前梯度阈值,T[n]为g(i,j)<n像素集合。

3)标记图像分水岭

式中R为区域块个数,Mk为各局部梯度极小值的像素位置。C(Mk)是与Mk对应的分水岭所围绕区域中像素坐标集合。求出属于某一阈值时的所有区域,计算公式为

式中 C[n]表示在梯度阈值为n时图像中所有满足梯度值小于n的像素集合,即C[n]为Cn(Mk)的总和。

1.2.2 Graph Cut模型及改进

1)Graph Cut模型

第一步:构造图G的顶点集V,可表示为

式中P为原始图像中的像素点集合,P构成了图的中间节点,即普通像素点;S为人工标注的前景(Foreground)像素集合,构成了图的源点;T为人工标注的背景(Background)像素集合,构成了图的汇点。

第二步:构造图G的边集E

E是连接节点的边集,包含N-连接和T-连接2类,顶点集V中普通像素之间的边为N-连接 ;T-连接为顶点集V中的普通像素分别与源点和汇点的连接,每个像素均有2个这样的连接,分别记为{p, S},{p, T},p∈P, p为普通像素点。边集E为

第三步:为相应的边E赋权W,边对应的权值分配规则如表1所示。

表1 图像中相邻边对应的权值Table 1 Weight of the adjacent edges in pictures

式中Ip,Iq分别表示像素点p,q的灰度值,δ表示像素点p,q亮度差的一个阈值,dist(p,q)为像素点p,q间的欧式距离,(i,j)为像素点p的坐标,(h,k)为像素点q的坐标,sump为像素p为某一灰度级时的像素个数,sumfrg为前景像素个数,sumbkg为背景像素个数。

建立网络图G=(V,E,W),计算图像中所有像素属于前景或背景的概率,正确归入前景或背景,即找到最小割。图像分割为L时,能量函数为

式中L={l1, l2, ··,lv},li的值为0(背景)或者1(前景),E(L)是损失函数,也叫能量函数,目标就是优化Graph Cut算法的能量函数使其值达到最小,即为最小割。R(L)为区域项,B(L)为边界项,α为非负系数,是区域项和边界项之间的重要因子,起到调节作用。若图像对比度较低,即像素点属于前景或背景差异小,则需乘以一个比较大的α放大这种差别,使能量越小;反之,若图像对比度较高,需乘以一个比较小的α缩小这种差别,使能量越小。

2)Graph Cut模型的改进

由于传统Graph Cut算法将图像中所有像素点按能量函数进行计算和标注,计算量较大,算法分割效率低。为了提高算法的实用性,本文基于交互分水岭算法,将图像进行区域划分,指定前景与背景,将各个区域块看作超像素,超像素灰度均值作为顶点,相邻顶点建立边,构造新的网络图替代传统加权图G=(V,E,W),采用最大流/最小割算法进行分割,重新构造能量函数以完成前景背景的有效分割。

第一步:计算区域项

式中Pp(lp)表示区域属性,标签lp的值为0(背景)或者1(前景)。当顶点p分配为其最大标签时,希望Pp(lp)能量项权值最小,一般取概率的负对数值,计算公式为

式中,pq表示相邻顶点,lp为顶点p的标记值,lq为顶点q的标记值, σ表示调节因子,若像素间标记值相同,则σ=0,否则σ=1。

1.2.3 算法实现

本文采用拉普拉斯算子对图像进行预处理[31],得到降噪且边缘增强的图像[32-33],使预处理后的生猪图像更便于分割;对预处理之后图像进行交互标记分水岭分割,得到区域分块图像;对区域分块图像进行前景背景的分割,提取出感兴趣目标区域。算法总体框架图如图1所示。

图1 算法总体框架图Fig.1 Framework diagram of algorithm

2 试验与结果

2.1 试验设备

图像分辨率采用800×600像素。程序处理所用计算机配置为Intel(R) Core(TM) i7-6700 CPU @ 3.40 GHz,4 GB内存,Windows 7操作系统,在VS2010编程环境下调用Open CV函数库测试分割算法。

2.2 各分割算法试验

对试验所采集的150张图像分别采用传统Graph Cut算法、Grab Cut算法、交互标记分水岭分割算法以及本文方法进行分割,分割得到的结果图像作为后面对比分析的依据。图2给出的是其中1张图像,分别采用不同分割方法分割的结果。

通过分析分割结果图(图2),传统Graph Cut算法分割结果具有较大误分割,边缘敏感度较差,生猪边缘与地面边界不明显,分割效果不好;Grab Cut算法由于使用所有像素来迭代估计高斯混合模型参数,算法整体分割效果较传统Graph Cut好,存在对边缘识别不准确问题;交互标记分水岭算法可以区分出感兴趣目标区域,分割出彩色分块图像,但容易出现错分割,分割误差较大;本文方法较交互标记分水岭算法可以更准确分割出目标生猪,目标与背景有明显的分界,与标准参考图像(图2f)相比最为相近,实现了图像的有效分割,说明本文提出的方法具有较高准确性和可靠性。

图2 不同图像分割方法的分割效果Fig.2 Segmentation effect of different image segmentation methods

2.3 分割效果评价

为了更加准确评价算法的有效性和准确性,本文从主观和客观2个方面,对各算法进行评价。

2.3.1 标准参考图像的获取

为了比较分析不同分割方法的评价指标,需要获取标准分割图作为分割效果的评价参考图像,在试验采集的图像中,选择所采集的150张图像,基于Photoshop分割出标准目标生猪图像。其中3张典型代表性生猪标准参考图像如图3所示。

图3 标准参考图像Fig.3 Standard reference image

2.3.2 主观评价

主观评价方法是让观察者根据一些事先规定的评价尺度,进行人工主观判断并获得平均意见分(mean opinion score, MOS)。为了验证本文分割方法的有效性,由20名非图像处理专业测试者统一在一个特定的环境中参加测试,评分采用5分制失真测度DSIS(double stimulusimpairment scale),DSIS相对尺度如表2所示。

表2 DSIS的5分制评价尺度Table 2 5-point evaluation scale of double stimulus impairment scale

计算每张图像获得的MOS作为最终测试结果

式中K′为测试者数量,kU为测试图像主观评价分数。

测试者分别对采用传统Graph Cut算法、Grab Cut算法、交互标记分水岭分割算法、本文分割方法各得到的150张结果图以及150张标准图进行主观评价,评价统计结果如图4a。从图4a中可以看出:传统Graph Cut算法和Grab Cut算法平均意见分范围为[1,3],主观性较差,不能有效地分割出目标生猪图像;交互标记分水岭算法平均意见分为4左右,可以较准确对图像进行区域分块;而本文算法平均意见分最高,即主观评价分数与标准参考图像平均分数相近,说明本文方法分割效果好,基本看不出图像质量变坏。

图4 不同分割方法的分割效果评价对比Fig.4 Evaluation comparison of segmentation effect of different methods

2.3.3 客观评价

图像分割效果主观评价容易受到人的视觉、心理状态等多方面影响。本文采用峰值信噪比(peak signal to noise ratio,PSNR)[34]和结构相似性(structural similarity, SSIM)[35]对算法分割性能进行评价。

1)峰值信噪比:基于对应像素点间的误差,即基于误差敏感的图像质量评价。计算公式为

式中R(i,j)为标准参考图在(i,j)处的灰度值,T(i,j)为分割效果图在(i,j)处的灰度值,M·Q是图像的大小,A为图像的总灰度级数。

图4b给出了对150张图像用不同分割算法所得的峰值信噪比,以分析不同分割算法在分割给定图像时的性能。峰值信噪比(PSNR)反映了噪声是否得到有效抑制,取值范围为[0,100],值越大,表示图像失真越少,图像质量越好。从图4b中可以看出:本文分割方法峰值信噪比平均范围为[30,40],为对比分析分割算法中峰值信噪比最大,说明本文方法分割效果更为准确。

2)结构相似度:反映了分割图像与标准参考图像之间的相似度,取值范围为[0,1]。值越大,说明分割效果图像与标准参考图像的相似度越高,分割精度越高,分割效果越好;值为1,表明分割效果图像与标准参考图像完全相同,该指标能够度量图像结构上的失真,具有一定的通用性。计算公式为

式中μS和μH分别表示分割效果图像S和标准参考图像H的灰度均值,是图像结构信息亮度的度量;σS和σH分别表示S和H的标准差,是图像结构信息对比度的度量;σSH为S和H的协方差,是图像结构信息结构属性的度量;Z为像素总数量;C1和C2为常数,通常C1= (KX)2,C=(KX)2,K1=0.01,K2=0.03,X=255。

1

22

图4c给出了对150张图像用不同分割算法所得的结构相似度,以分析不同分割方法在分割给定图像时的性能。从图4c中可以看出:本文分割方法的结构相似度平均范围为[0.9,1],相比本文其他分割算法,本文算法分割精度最高,说明分割图像质量高。

2.4 算法性能分析

2.4.1 标记程度对图像分割效果的影响

标记程度是指标记线的复杂程度,本文采用在生猪图像感兴趣区域通过鼠标画线的标记方式,计算标记线的像素点数占图像总像素点数的百分比进行标记程度的度量。试验采用在同一张图像感兴趣区域上画出10种不同的标记线,标记线像素数所占图像总像素数的百分比越大,说明标记程度越复杂。对不同标记程度的分割效果图进行客观评价,如图5所示。

从图5中可以看出:1)随着图像标记程度的增加,即图像区域标记线越复杂,本文分割算法的峰值信噪比越高、结构相似度越接近于1,如图5a,说明该方法分割后图像质量越好;2)对感兴趣区域进行人工标记,得到不同画线程度的分割效果图,如图5b,图5c,说明在感兴趣目标区域中尽可能画出复杂标记线,图像分割效果越好。

2.4.2 算法速度分析

为对比分析不同分割算法的分割效率,对所采集的150张生猪图像中随机抽取30张,分为3组,每组10张图像进行试验,4种不同分割算法每组平均执行时间如表3所示。

表3数据结果表明本文算法稳定有效,计算不同分割算法平均程序运行时间分别为:Graph Cut算法11 246.30 ms、Grab Cut算法14 254.52 ms、交互分水岭算法127.50 ms、本文方法3 793.92 ms。本文方法添加了预处理和交互分水岭等算法,基于超像素的分割减少了像素计算量,相比于传统Graph Cut算法节约了时间资源,平均耗时缩短到传统Graph Cut算法的33.7%,效率得到很大提高;Grab Cut算法是对Graph Cut算法的改进,采用矩形框简化了用户交互方式,必须通过迭代分割确定高斯混合模型参数的方式进行补偿,迭代过程增加了时间消耗,降低了算法效率;交互分水岭算法分割快速,但易出现错分割或过分割;本文分割方法结合两者优势,基于交互分水岭进行区域分块,结合改进的Graph Cut算法进行图像前景和背景的分割,操作简单,有效分割特定目标,较传统Graph Cut算法提高了分割准确度和分割效率。

表3 不同图像分割方法的平均分割时间Table 3 Average segmentation time of different image segmentation methods

2.4.3 算法鲁棒性分析

为比较分析不同算法的鲁棒性,测试不同算法在复杂背景(如粪便、阴影)、噪声干扰、光照(如夜晚)等条件下分割指定编号的目标生猪。分割效果图如图6所示。

图6 复杂背景和光照下不同图像分割方法的分割效果Fig.6 Segmentation effect of different image segmentation methods under complex background and illumination

由图6可以看出:在复杂背景(阴影)和光照(夜晚)下分别分割编号为5(如图6a)和编号为1,2(如图6b)的生猪目标,由于目标与背景颜色相近,而且传统Graph Cut算法对光照等噪音比较敏感,不能提取特定目标生猪,影响分割效果;交互标记分水岭算法可以分割指定目标生猪,但分割结果不完整,不能达到有效的分割;本文分割方法能够准确分割出特定目标,效果比较稳定,分割结果较为完整,可以实现人工选择特定分割目标,提高了分割算法的鲁棒性,满足生猪日常监控的实时性需求。

3 结 论

本文基于交互分水岭算法,提出改进Graph Cut算法的生猪图像分割方法。主要结论如下:

1)从试验数据可以看出,本文分割方法的峰值信噪比平均范围为[30,40],结构相似度平均范围为[0.9,1],2种客观评价准则与主观评价一致,较传统Graph Cut算法图像质量、精度提升明显;

2)本文方法在复杂背景(如阴影)、光照强度弱(如夜晚)等影响下能够准确分割特定目标生猪,表明本文提出的方法具有较高的鲁棒性;

3)本文提出基于改进Graph Cut算法的生猪图像分割方法,分割效率方面,较传统Graph Cut算法节约了时间资源,平均耗时缩短到Graph Cut算法的33.7%,提高了分割效率。

本文图像分割算法具有精度高、鲁棒性强、运行效率快的特点,为后期生猪行为智能分析、理解和环境智能决策等工作奠定了基础。

[1] Figueiredo G F, Dawson M D, Benson E R, et al. Advancement in whole house machine vision based poultry behavior analysis[C]//American Society of Agricultural and Biological Engineers Annual International Meeting 2004, ASABE 2004, Ottawa, Canada, 2004: 1-4.

[2] Shao B, Xin H W. A real-time computer vision assessment and control of thermal comfort for group-housed pigs[J]. Computers & Electronics in Agriculture, 2008, 62(1): 15-21.

[3] 朱伟兴,浦雪峰,李新城,等. 基于行为监测的疑似病猪自动化识别系统[J]. 农业工程学报,2010,26(1):188-192. Zhu Weixing, Pu Xuefeng, Li Xincheng, et al. Automatic identification system of pigs with suspected case based on behavior monitoring[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2010, 26 (1): 188-192. (in Chinese with English abstract)

[4] 尹令,刘财兴,洪添胜,等. 基于无线传感器网络的奶牛行为特征监测系统设计[J]. 农业工程学报,2010,26(3): 203-208. Yin Ling, Liu Caixing, Hong Tiansheng, et al. Design of system for monitoring dairy cattle's behavioral features based on wireless sensor networks[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2010, 26(3): 203-208. (in Chinese with English abstract)

[5] 刘波,朱伟兴,霍冠英. 生猪轮廓红外与光学图像的融合算法[J]. 农业工程学报,2013,29(17):113-120. Liu Bo, Zhu Weixing, Huo Guanying. An image fusion algorithm of infrared thermal and optical images for pig contour[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2013,

[6] 赵凯旋,何东健. 基于卷积神经网络的奶牛个体身份识别29(17): 113-120. (in Chinese with English abstract)方法[J]. 农业工程学报,2015,31(5):181-187. Zhao Kaixuan, He Dongjian. Recognition of individual dairy cattle based on convolutional neural networks[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2015, 31(5): 181-187. (in Chinese with English abstract)

[7] 艾海舟,兴军亮. 计算机视觉: 算法与应用[M]. 北京: 清华大学出版社,2012: 206-235.

[8] Tokmakov P, Alahari K, Schmid C. Learning semantic segmentation with Weakly-Annotated videos[M]. Berlin: Springer International Publishing, 2016.

[9] 郭传鑫,李振波,乔曦,等. 基于融合显著图与GrabCut算法的水下海参图像分割[J]. 农业机械学报,2015,46 (增刊1):147-152. Guo Chuanxin, Li Zhenbo, Qiao Xi, et al. Image segmentation of underwater sea cucumber using GrabCut with saliency map[J]. Transactions of the Chinese Society for Agricultural Machinery, 2015, 46(Supp.1): 147-152. (in Chinese with English abstract)

[10] He H, Mckinnon D, Warren M, et al. Graphcut-based interactive segmentation using colour and depth cues[C]// Australasian Conference on Robotics and Automation, Acra. Australian Robotics & Automation Association (ARAA), 2010. [11] Vicente S, Kolmogorov V, Rother C. Graph cut based image segmentation with connectivity priors[C]//Computer Vision and Pattern Recognition, CVPR 2008. Anchorage: IEEE Conference on. IEEE, 2008: 1-8.

[12] Boykov Y Y, Jolly M P. Interactive graph cuts for optimal boundary & region segmentation of objects in N-D images[C]// Computer Vision. ICCV. Proceedings. Vancouver: Eighth IEEE International Conference on. IEEE, 2001: 105-112.

[13] Zhou X, Zhang J, Kulis B. Power-law graph cuts[J]. Computer Science, 2014: 1144-1152.

[14] Kwatra V, Essa I, Turk G, et al. Graphcut textures: Image and video texture synthesis using graph cuts[C]// Computer Graphics and Interactive Techniques, ACM SIGGRAPH, 2003, San Diego, California, USA,2003: 277-286.

[15] Freedman D, Zhang T. Interactive graph cut based segmentation with shape priors[C]// Proceedings of the 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, San Diego, CA, USA 2005: 755-762.

[16] Rother C, Kolmogorov V, Blake A. "GrabCut": Interactive foreground extraction using iterated graph cuts[J]. Acm Transactions on Graphics, 2004, 23(3): 309-314.

[17] Nie J L, Wang Y F. Improved algorithm of graphcut[J]. Computer Engineering & Design, 2009, 30(13): 3225-3227. [18] Ren X F,Malik J. Learning a classification model for segmentation[C]//Proc of the 9th IEEE International Conference on Computer Vision. Washington DC: IEEE

[19] 伯彭波,袁野,王宽全. 基于超像素的多主体图像交互分Computer Society, 2003: 10-17.割[J]. 中国图像图形学报,2015,20(6):764-771. Bo Pengbo, Yuan Ye, Wang Kuanquan. Interactive multiphase image segmentation based on superpixels[J]. Journal of Image and Graphics, 2015, 20(6): 764-771. (in Chinese with English abstract)

[20] Yang S, Zhu Y P, Wu X Y. An interactive segmentation method based on superpixel[C].Matec Web of Conferences. Xiamen: 2015:01027.

[21] Li Y, Sun J, Tang C K, et al. Lazy snapping[J]. Acm Transactions on Graphics, 2004, 23(3): 303-308.

[22] Shi J, Malik J. Normalized cuts and image segmentation[J]. IEEE Transactions on Pattern Analysis & Machine Intelligence, 2000, 22(8): 888-905.

[23] Comaniciu D, Meer P. Mean shift: A robust approach toward feature space analysis[J]. IEEE Transactions on Pattern Analysis & Machine Intelligence, 2002, 24(5): 603-619.

[24] Vincent L, Soille P. Watersheds in digital spaces: An efficient algorithm based on immersion simulations[J]. IEEE Transactions on Pattern Analysis & Machine Intelligence, 1991, 13(6): 583-598.

[25] 高理文,林小桦,罗晓牧. 结合简单交互和标记分水岭的复杂背景叶片图像分割方法[J]. 计算机应用与软件,2016,33(8):211-215. Gao Liwen, Lin Xiaohua, Luo Xiaomu. Segmentation method for leaf image under complex background combining simple man-machine interaction and marker based watershedsegmentation[J]. Computer Applications and Software, 2016, 33(8): 211-215. (in Chinese with English abstract)

[26] Rong J, Pan Y L. Accuracy improvement of graph-cut image segmentation by using watershed[J]. Advanced Materials Research, 2011, 341-342: 546-549.

[27] Yu D, Tang J T, Xu D H. Iteractive object extraction based on max-flow[J]. Computer Engineering & Applications, 2007, 43(5): 246-248.

[28] Hong H Y, Guo X Y, Zhang X H. An improved segmentation algorithm of color image in complex background based on graph cuts[C]// IEEE International Conference on Computer Science and Automation Engineering. IEEE, 2011: 642-645.

[29] 袁媛,李淼,陈晟,等. 复杂背景黄瓜叶部病害图像分割方法[J]. 农业机械学报,2013,44(10):233-237. Yuan Yuan, Li Miao, Chen Sheng, et al. Segmentation of cucumber leaf disease images with complex background[J]. Transactions of the Chinese Society for Agricultural Machinery, 2013, 44(10): 233-237. (in Chinese with English abstract)

[30] 沈晶,杨学志. 一种新的边缘保持分水岭的图像分割算法[J]. 图学学报,2009,30(5):80-88. Shen Jing, Yang Xuezhi. A novel segmentation algorithm based on edge-preserving watershed[J]. Journal of Graphics, 2009, 30(5): 80-88. (in Chinese with English abstract)

[31] 张娜. 图像增强技术的研究[J]. 计算机仿真,2007,24(1):192-195. Zhang Na. Research on image enhancement technology[J]. Computer Simulation, 2007, 24(1): 192-195. (in Chinese with English abstract)

[32] 平丽. 图像平滑处理方法的比较研究[J]. 信息技术,2010(1):65-67. Ping Li. Comparison of image smoothing processing methods[J]. Information Technology, 2010(1): 65-67. (in Chinese with English abstract)

[33] 秦志远,吴冰,王艳,等. 图像平滑算法比较研究及改进策略[J]. 测绘科学技术学报,2005,22(2):103-106. Qin Zhiyuan, Wu Bing, Wang Yan, et al. The comparison study on image smoothing algorithms & improve strategy[J]. Journal of Geomatics Science and Technology, 2005, 22(2): 103-106. (in Chinese with English abstract)

[34] 华宁. 图像质量客观评估研究[D]. 武汉:湖北大学, 2012. Hua Ning. Research on Image Objective Quality[D]. Wuhan: Hubei University, 2012. (in Chinese with English abstract)

[35] 王志明. 无参考图像质量评价综述[J]. 自动化学报,2015,41(6):1062-1079. Wang Zhiming. Review of no-reference image quality assessment[J]. Acta Automatica Sinica, 2015, 41(6): 1062-1079. (in Chinese with English abstract)

Pig image segmentation method based on improved Graph Cut algorithm

Sun Longqing, Li Yue, Zou Yuanbing, Li Yiyang
(1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China)

The breeding environment plays an important role in healthy growth and development of the pigs, and it is also a guarantee of the excellent traits. The growth of pig is the integrated result of their own traits and external environmental factors. For different environments, pigs will show different behaviors. It is found that the appropriate growth environment can be reflected by their degree of dispersion in the pens. When the environment is suitable, the pig group will lie down together. When the temperature is low, they will huddle together; and when the environmental temperature is high, the pigs will scatter around. Image segmentation is the important link to analyze pig behavior status based on computer vision technology, and pig image segmentation is an image representation that provides easy-to-understand and analysis for the behavior feature extraction, parameter measurement, image analysis, pattern recognition of individual pig. The accurate and effective image segmentation algorithm is for pig behavioral intelligent analysis, understanding and environmental intelligent decision. The traditional Graph Cut algorithm uses the energy function to compute all the pixels in the image, it takes a lot of time. It has the low segmentation efficiency and it cannot accurately segment specific pig. Aiming at the limitation of traditional Graph Cut algorithm and the characteristic of image itself, on the basis of the interactive watershed algorithm, in this paper, we proposed an interactive image segmentation method based on improved Graph Cut algorithm aiming at better use of interaction information provided by the user and effectively control of the number of super pixels. To some extent, the algorithm could also avoid the problems of over segmentation or under segmentation. The image was divided into regions based on the interactive watershed algorithm, and the foreground and background were specified. Each region block was regarded as the super pixel, the gray scale of super pixel was used as the vertex. Establish edges between adjacent vertices and the new network map was constructed instead of the traditional weighted graph. In order to reconstruct the energy function to complete the effective segmentation of the foreground and background, the maximum flow, and minimization cut algorithm were used to cut the image. Results of experiments showed that the method can effectively segment pig target, it had high segmentation quality and high efficiency. In this paper, the peak signal to noise ratio (PSNR) and structural similarity (SSIM) were used as objective evaluation standard. The range of the PSNR was [30, 40] and the range of the SSIM was [0.9, 1] in this method, which was the most accurate segmentation algorithm in the shown segmentation algorithm. It indicated that two evaluation criterions were consistent with the subjective evaluation, and the stability and the reliability of this method were improved. The average time consumed in this algorithm was only 33.7% of in the traditional Graph Cut algorithm. It greatly improved the efficiency of segmentation, and it had highly robust for the segmentation of specific target pigs. The results of this paper can provide technical support for subsequent target identification, detection, tracking and monitoring, evaluation of external environments, such as alarms.

image processing; image segmentation; algorithms; improvement; Graph Cut algorithm; super pixels; interactive watershed algorithm

10.11975/j.issn.1002-6819.2017.16.026

TP391.41

A

1002-6819(2017)-16-0196-07

孙龙清,李 玥,邹远炳,李亿杨. 基于改进Graph Cut算法的生猪图像分割方法[J]. 农业工程学报,2017,33(16):196-202.

10.11975/j.issn.1002-6819.2017.16.026 http://www.tcsae.org

Sun Longqing, Li Yue, Zou Yuanbing, Li Yiyang. Pig image segmentation method based on improved Graph Cut algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(16): 196-202. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2017.16.026 http://www.tcsae.org

2017-03-28

2017-06-30

国家高技术研究发展计划(863计划)资助项目(2013AA102306)

孙龙清,副教授,主要从事农业信息化及农业物联网技术研究,北京 中国农业大学信息与电气工程学院,100083。Email:sunlq@cau.edu.cn

猜你喜欢
分水岭像素点像素
像素前线之“幻影”2000
基于局部相似性的特征匹配筛选算法
选 择
“像素”仙人掌
基于5×5邻域像素点相关性的划痕修复算法
基于canvas的前端数据加密
ÉVOLUTIONDIGAE Style de vie tactile
人生有哪些分水岭
基于逐像素点深度卷积网络分割模型的上皮和间质组织分割
高像素不是全部