魏雪峰,劉 曉
(1.黃淮學(xué)院信息工程學(xué)院,駐馬店463000;2.武漢理工大學(xué)信息工程學(xué)院,武漢430070;3.鶴壁職業(yè)技術(shù)學(xué)院網(wǎng)絡(luò)中心,鶴壁458030)
基于2維最大熵最佳閾值算法的圖像分割研究
魏雪峰1,2,劉 曉3
(1.黃淮學(xué)院信息工程學(xué)院,駐馬店463000;2.武漢理工大學(xué)信息工程學(xué)院,武漢430070;3.鶴壁職業(yè)技術(shù)學(xué)院網(wǎng)絡(luò)中心,鶴壁458030)
為了提高圖像分割的質(zhì)量,采用2維最大熵最佳閾值方法,首先通過灰度區(qū)域確定該域像素的2維隨機(jī)向量,在準(zhǔn)則函數(shù)下求得到2維最大熵最佳閾值;接著通過遞推優(yōu)化對2維最大熵最佳閾值計(jì)算數(shù)據(jù)優(yōu)化處理,減少重復(fù)性數(shù)據(jù)計(jì)算量;最后通過分割圖像區(qū)域與原目標(biāo)空間位置的互信息量最大準(zhǔn)則,把誤分割誤差函數(shù)作為檢測分割標(biāo)準(zhǔn),給出了算法流程;并仿真出了不同算法的圖像分割結(jié)果。結(jié)果表明,該算法得到圖像分割的精度較高,沒有背景與噪聲的殘留,保留了圖像信息,執(zhí)行速度快、分割效果視覺好、誤分割誤差最小。這對提升圖像分割效率是有幫助的。
圖像處理;2維最大熵;最佳閾值;像素
圖像分割是根據(jù)圖像的性質(zhì)、處理的需要將圖像劃分成若干個互不相交的小區(qū)域的過程[1]。圖像分割是圖像分析、理解和描述的關(guān)鍵步驟,圖像處理中的目標(biāo)檢測、識別和跟蹤都取決于圖像分割的質(zhì)量[2]。
目前圖像分割方法分為:基于邊界方法和基于區(qū)域方法?;谶吔绶椒僭O(shè)圖像某個子區(qū)域在原來的圖像中一定會有邊緣存在,適合邊界明顯的圖像[3];基于區(qū)域方法假設(shè)圖像的子區(qū)域一定會有相同的性質(zhì),而不同區(qū)域的像素沒有共同的性質(zhì),適合圖像數(shù)據(jù)量少,且要求高效率[4]的情況。最為經(jīng)典的是基于灰度閾值的分割方法,將像素按灰度級進(jìn)行分類,根據(jù)灰度級的概率設(shè)置單個灰度閾值,從而實(shí)現(xiàn)圖像分割,但是若背景與目標(biāo)灰度重疊,則分割效果出現(xiàn)細(xì)節(jié)丟失現(xiàn)象[5];多閾值分割方法解決了單閾值問題,但是需要一個最佳門限組合[6]。
作者利用像素灰度的分布信息和其領(lǐng)域空間的2維最大熵,結(jié)合準(zhǔn)則函數(shù)確定最佳閾值分割圖像,通過遞推優(yōu)化計(jì)算減少數(shù)據(jù)的復(fù)雜性,提高了計(jì)算速度,使每次計(jì)算的時候不用從初值計(jì)算。實(shí)驗(yàn)仿真顯示,本文中的算法提高了圖像的分割精度,抗噪能力強(qiáng),同時誤分割誤差最小。
1.1 2維最大熵最佳閾值思想
2維最大熵方法同時考慮了像素灰度的分布信息和其領(lǐng)域空間相關(guān)信息,因而具有較強(qiáng)的抗干擾能力。在1幅灰度級數(shù)為l∈[0,255]的圖像中像素點(diǎn)數(shù)為N(m×n),設(shè)f(i,j)是灰度為i及區(qū)域灰度均值為j的像素點(diǎn)數(shù),2維隨機(jī)向量(i,j)服從聯(lián)合離散概率分布[7],p(i,j)是(i,j)的發(fā)生概率,2維熵為:
熵的判別函數(shù)定義為:
背景和目標(biāo)的熵分別為:
準(zhǔn)則函數(shù)為:
式中,
其中,μ0為背景閾值P0的像素點(diǎn)數(shù),μ1為目標(biāo)閾值P1的像素點(diǎn)數(shù)。使Φ(t)達(dá)到最大求得最佳閾值:(i*,j*)=argmax{Φ(i,j)}。
1.2 遞推優(yōu)化
在2維最大熵最佳閾值(two-dimensional maximum entropy optimal threshold,TDMEOT)計(jì)算p(i,j)時,每次需要計(jì)算P0,H0,P1,H1,對2維最大熵最佳閾值優(yōu)化為:
當(dāng)固定s時,t取0~255,Φ(i,j)不存在重復(fù)計(jì)算。固定t時,s推導(dǎo)為:
式中,Ps(t+I)的初始值為Ps0(t+I),Hs(t+I)的初始值為Hs0(t+I),t=t0,t0+1,…,255。這樣大大減少了計(jì)算的復(fù)雜性[10],提高了計(jì)算速度,每次計(jì)算的時候不用從初值計(jì)算。
1.3 圖像分割步驟
當(dāng)兩幅圖像在空間位置完全一致時,對應(yīng)灰度的互信息量最大,分割后的圖像假設(shè)是原圖像的一種特殊模態(tài)的圖像[11-12],即分割圖像的區(qū)域與原目標(biāo)的空間位置一致時,這時它們的互信息量達(dá)到最大,可得最佳的分割結(jié)果,互信息量最大則誤分割誤差(falsesegmentationerror,F(xiàn)SE)最小。
把誤分割誤差FSE作為分割的客觀評價標(biāo)準(zhǔn):
算法步驟如圖1所示。
Fig.1 Algorithmsteps
實(shí)驗(yàn)中采用的軟件為MATLAB7.0。圖2a為待分割圖像,大小為300cm×300cm,圖2b是添加了方差為20,零均值的高斯白噪聲。
Fig.2 Imagetobesegmenteda—imagesource b—addnoisetoimage
圖3a是添加噪聲后的2維最大熵最佳閾值分割圖,圖3b是添加噪聲后的最大熵單閾值分割圖,圖3c是添加噪聲后的最大熵雙閾值分割圖。
結(jié)果顯示:圖3a的2維最大熵最佳閾值分割圖效果最好,由點(diǎn)灰度和區(qū)域灰度信息建立2維最大熵,得到的分割較高精度的圖像,攝影師和攝像機(jī)目標(biāo)與背景分開,從噪聲圖像中分割出目標(biāo),攝影師和攝像機(jī)目標(biāo)分割邊緣較光滑。圖3b和圖3c算法得到的結(jié)果中有背景與噪聲的殘留,丟失了圖像信息,這是因?yàn)樵肼暩蓴_因素使最大熵單閾值和最大熵雙閾值分割不能反映出鄰域像素的空間相關(guān)信息。
Fig.3 Segmentationwithdifferentmethodsa—maximumentropymulti-thresholdingsegmentation b—maximumentropysinglethresholdsegmentation c—maximumentropydual-thresholdsegmentation
為了更好地說明分割視覺的有效性,采用2幅不同細(xì)節(jié)層次的圖像分別進(jìn)行實(shí)驗(yàn),如圖4所示,圖5~圖7為處理效果圖。
從圖5~圖7對比分割效果圖可以看出,對于不同細(xì)節(jié)層次的圖像,圖5的最大熵最佳閾值分割圖能夠把圖像的層次識別分割,而圖6和圖7的方法分割圖存在把不同的層次判為相同的平面進(jìn)行分割,導(dǎo)致了分割邊緣的不準(zhǔn)確。
Fig.4 Imagewithdifferentlevelofdetails
Fig.5 Maximum entropymulti-thresholding segmentation
Fig.6 Maximum entropy single threshold segmentation
Fig.7 Maximum entropy dual-threshold segmentation
采用蒙特卡羅方法對誤分割誤差以及處理時間對比分析,結(jié)果如表1所示。
Table 1 Processingmethod comparison
從表1中可以看出,2維最大熵最佳閾值分割方法的誤分割誤差最小,根據(jù)誤分割誤差的含義越小就代表失真越少,因此,2維最大熵最佳閾值分割方法能夠較好地保持圖像信息。在處理時間上,2維最大熵最佳閾值分割耗時比較少,這是由于本文中使用了遞推優(yōu)化運(yùn)算,減少了重復(fù)性數(shù)據(jù)處理。
采用像素灰度的分布信息和其領(lǐng)域空間的2維最大熵,結(jié)合準(zhǔn)則函數(shù)確定最佳閾值分割圖像,通過遞推優(yōu)化計(jì)算減少數(shù)據(jù)的復(fù)雜性,當(dāng)互信息量達(dá)到最大可得最佳的分割結(jié)果,實(shí)驗(yàn)仿真顯示,本文中的算法提高了圖像的分割精度,抗噪能力強(qiáng),同時誤分割誤差最小。
[1]LIU Y,ZHAO Y L.Quick approach ofmulti-threshold Otsumethod for image segmentation[J].Journal of Computer Applications,2011,31(12):3363-3365(in Chinese).
[2]CHEN L Ch.Fast thresholding for image segmentation based on 0~1 programming[J].Computer Engineering and Applications,2012,48(10):197-199(in Chinese).
[3]TAN Y M,HUAI J Zh,TANG Zh Sh.Edge-guided segmentation method for multiscale and high resolution remote sensing Image[J].Journal of Infrared and Millimeter Waves,2010,29(4):312-315(in Chinese).
[4]XU Sh H,LIU JP,HU M Y.Automatic building detection in color aerial images based on region segmentation[J].Journal of Liaoning Technical University(Natural Science Edition),2010,29(6):1058-1061(in Chinese).
[5]ZHANG Q H,LIGM,LIN B H,et al.Threshold image segmentation based on maximum entropy-variance model[J].Computer Technology and Development,2011,21(6):43-45(in Chinese).
[6]CHEN Sh Y,ZHANG Sh L.Detection of news captions based on gray-scale difference statistics and two-dimensional maximum entropy threshold[J].Application Research of Computers,2011,28(8):3195-3197(in Chinese).
[7]XU L T,XU X M.A calcification detection method based on twodimensional entropic thresholding[J].Computer Simulation,2010,27(9):255-257(in Chinese).
[8]GUO M Sh,LIU B H.2-Dmaximum entropymethod in image segmentation based on chaos genetic algorithm[J].Computer Technology and Development,2008,18(8):101-104(in Chinese).
[9]WU Y Q,WU JM,ZHAN B Ch.An effectivemethod of threshold selection for small object image[J].Acta Armamentarii,2011,32(4):469-475(in Chinese).
[10]ZHANG XM,ZHANG A L,ZHENG Y B,et al.Improved two-dimensionalmaximum entropy image thresholding and its fast recursive realization[J].Computer Science,2011,38(8):278-283(in Chinese).
[11]CHEN J,ZHU H.Amethod of image segmentation based onmutual information and threshold iteration[J].Journal ofWuhan U-niversity of Technology,2011,35(3):641-644(in Chinese).
[12]LU Zh L,LIR L,LIT,etal.Infrared image denosing based on total variation theory[J].Laser Technology,2012,36(2):194-197(in Chinese).
Research of image segmentation based on 2-D maximum entropy optimal threshold
WEIXue-feng1,2,LIU Xiao3
(1.College of Information,HuanghuaiUniversity,Zhumadian 463000,China;2.College of Information,Wuhan University of Technology,Wuhan 430070,China;3.Network Center,HebiOccupation Technology College,Hebi458030,China)
In order to improve the quality of image segmentation,two-dimensionalmaximum entropy optimal threshold(TDMEOT)method was used.Firstly,2-D random vector of the domain pixels was defined through the gray region and TDMEOT value was gotten by the criterion function.Secondly,calculation data of 2-D maximum entropy threshold were optimized through the recursive optimization and the repetitive data calculation was reduced.Finally,based on the maximum mutual information criterion between the segmentation image area and the target space position and choosing error segmentation function as the segmentation standard,the algorithm flow and the image segmentation results of different algorithms were given after experimental simulation.The results show that this method has higher precision of image segmentation and has no residual background noise,and retains the image information with fast speed,good segmentation visual and minimum segmentation error.The research is helpful to improve the efficiency of image segmentation.
image processing;2-D maximum entropy;optimal threshold;pixel
TN911.73
A
10.7510/jgjs.issn.1001-3806.2013.04.023
1001-3806(2013)04-0519-04
魏雪峰(1973-),男,碩士,副教授,研究方向?yàn)樾畔⑻幚怼?/p>
E-mail:hhwxf2013@foxmail.com
2012-10-15;
2012-12-03