xử lý hình thái học và ứng dụng

  • Published on
    06-Jul-2015

  • View
    163

  • Download
    9

Embed Size (px)

DESCRIPTION

x l nh

Transcript

<ul><li> 1. X L HNH THI HC TRN NH V NG DNG ThS. H c Lnh Khoa Cng ngh Thng tin i hc ng TM TT Hin nay, cc k thut x l nh s trn my tnh ang c rt nhiu nh nghin cu quan tm v pht trin, trong c x l hnh thi hc trn nh. Bi v x l hnh thi hc trn nh cung cp cho chng ta nhng m t nh lng v cu trc v hnh dng hnh hc ca cc i tng trong nh da trn nhng l thuyt trong ton hc nh l thuyt tp hp, hnh hc tp, xc sut, .v.v. v n ang c ng dng rng ri trong nhiu ng dng nh pht hin bin, phn on i tng, gim nhiu, tm xng nh .v.v. Trong cc ng dng th gic my tnh, x l hnh thi hc c th c s dng nhn dng i tng, nng cao cht lng nh, phn on nh v kim tra khuyt im trn nh. Cc php ton x l hnh thi hc c thc hin ch yu trn nh nh phn v nh xm. Trong bi bo ny ti gii thiu cc php ton x l hnh thi hc trn nh nh phn v nh xm, mt s ng dng ca x l hnh thi hc ang c ng dng rng ri hin nay. ABSTRACT In curentlly, image processing techniques on the computer is being tremenduosly and development by a lot of research, and among them, mathematical morphological have been continously receiving attention. It is because methermatical morphology provides quantitative description of geometric structure and shape of objects in image based on mathermatical theories such as set theory, topology, probability, etc and has been applied widely too many applications such as edge detection, object segmentation, noise suppression, skeleton and so on [6][7]. In industrial vision applications, mathermatical morphology can be use to implement object reconization, image enhancement, segmentation, and defect inspection[1]. Morphological operations processing carried out mainly on binary and gray images. In this paper, I introduction the mathematical operations processing on binary images and gray images and some applications of morphological processing are widely used nowadays. Keywords: Image processing, Mathematical morphology, Morphological image analysis, Binary Morphological, Grayscale morphology, image processing and recognization.13</li></ul> <p> 2. 1. Gii thiu Cc k thut x l nh s trn my tnh ang c rt nhiu nh nghin cu quan tm v pht trin. S pht trin ca hnh thi hc l s kit hp gia l thuyt, ng dng, phng php v cc thut ton [1]. Trong , cc phng php mi c a ra nhm gii quyt nhng vn trong thc t, l thuyt kim chng tnh chnh xc ca cc phng php, v pht trin cc thit b phn cng chuyn dng hoc cc thut ton hiu qu thc thi trn my tnh. S kt hp ny c th hin ti hnh 1. Kim tra v kim sot cht lng Nhn dng ch vit v ti liu Khoa hc vt liu Khoa hc a cht Khoa hc cuc sng CC NG DNGHng i quy th Kin trc lung v song song Thut ton cho cc bi ton v tch hp mch in t.CC THUT TONX L HNH THI HCCC PHNG PHP &amp; L THUYT Lc nh Phn on v phn lp nh o lng nh Nhn dng mu Phn tch kt cuHnh 1. S pht trin ca x l hnh thi c c trng bi s kt hp kit hp gia l thuyt, ng dng, phng php v cc thut tonTrong cc ng dng th gic my tnh, x l hnh thi hc c th c s dng nhn dng i tng, nng cao cht lng nh, phn on nh v kim tra khuyt im trn nh [2]. Cc php ton x l hnh thi hc c thc hin ch yu trn nh nh phn v nh xm. 14 3. nh nh phn hay cn c gi l nh en trng tng ng vi hai gi tr 0 (mu trng) v 1 (mu en). nh xm l nh m ti mi im nh c gi tr cng sng nm trong khong [0, 255]. 2. Cc thut ton x l hnh thi hc Phn ln cc php ton hnh thi hc c nh ngha t hai php ton c bn l php ton co nh (Erosion) v gin nh (Dilation). Yu t quan trng trong cc php ton ny l la chn mt phn t cu trc c hnh dng ph hp. a. Phn t cu trc i vi nh nh phn, phn t cu trc l mt nh c kch thc nh gm c hai gi tr 0 v 1, cc gi tr bng 0 c b qua trong qu trnh tnh ton, gi H(i, j) l phn t cu trc ca nh nh phn v c th hin nh sau [4]:H(i, j) 0,1 Mt s hnh dng ca phn t cu trc thng c s dng trn nh nh phn: dng ng theo chiu ngang v dc, hnh vung, hnh ellipse,...[3].Hnh 2. Mt s hnh dng ca phn t cu trc phng.i vi nh xm, phn t cu trc l khng phng, tc l cc phn t cu trc s dng cc gi tr 0 v 1 xc nh phm vi ca phn t cu trc trong mt phng x v mt phng y v thm gi tr cao xc nh chiu th ba.Cu trc phn t khng phng gm c hai phn [5]: Phn th nht: Mt mng hai chiu gm c cc gi tr 0 v 1, trong gi tr bng 1 xc nh hng xm ca phn t cu trc.Hnh 3. Mt mt n xc nh hng xm ca phn t cu trc khng phng.Phn th hai: Mt mng hai chiu c kch thc bng vi kch thc ca mng hai chiu phn th nht nhng cha cc gi tr thc ca phn t cu trc. 15 4. Hnh 4. Ma trn gi tr thc tng ng vi hng xm trong phn t cu trc khng phng.b. Php co nh Erosion Xt tp hp A v tp hp B (Phn t cu trc), php co nh nh phn ca tp hp A bi phn t cu trc B c k hiu A B v vit di dng cng thc nh sau: A B = z | ( B) Z A Php co nh nh phn ca tp hp A bi phn t cu trc B l tp hp cc im z (z nm tm im ca phn t cu trc B) sao cho Bz l tp con ca A.Hnh 5. V d v php ton co nh nh phn vi phn t cu trc phng.Php ton co nh ca nh xm I vi cu trc phn t khng phng H ti v tr (x, y) ca nh I c xc nh nh sau[1][2][4][5][6]:: (IH)(x, y) = min(I(x+i, y+j) - H(i, j) | (i, j) DH)Hnh 6. V d v php ton co nh trn nh xm vi phn t cu trc khng phng.Trong , DH l khng gian nh ca phn t cu trc khng phng H. c. Php gin nh Dialtion Gi A l nh gc, B l mt phn t cu trc. Php gin nh phn ca nh A vi phn t cu trc B c k hiu A B v chng ta c th biu din php ton co nh di dng php ton t hp nh sau: 16 5. A B z | B A z A Php gin nh nh phn ca tp A bi phn t cu trc B l tp hp ca cc im z (z l tm ca phn t cu trc B trn tp A) sao cho phn x ca Bz giao vi tp A ti t nht mt im.Hnh 7. V d v php gin nh phn trn nh vi phn t cu trc phng.Php ton gin nh ca nh xm I vi cu trc phn t khng phng H ti v tr (x, y) ca nh I c xc nh nh sau [1][2][4][5][6]: (IH)(x, y) = max(I(x+i, y+j)+H(i, j) | (i, j) DH)Hnh 8. Php ton gin nh trn nh xm vi phn t cu trc khng phng.Trong , DH l khng gian nh ca phn t cu trc khng phng H. d. Php m nh Openning Gi A l hnh nh gc v B l phn t cu trc, () l k hiu ca php m nh gia tp hp A v phn t cu trc B, php m nh c xc nh bi cng thc: AB = (AB)Be. Php ng nh Closing Vi tp hp A l nh gc, B l phn t cu trc. l k hiu php ng nh. Khi php ng nh ca tp hp A bi phn t cu trc B, k hiu l ( A B) , xc nh bi:( A B ) = ( A B)B17 6. Hnh 11 di y l mt v d minh ha cc php ton x l hnh hc trn nh. Trong , p dng cc php ton x l nh nh phn vi phn t cu trc c hnh dng hnh 9; vi nh xm s dng cu trc phn t khng phng c hnh dng hng xm v gi tr nh hnh10., Hnh 9. Phn t cu trc phngHnh 10 . Hnh dng hng xm v ma trn gi tr tng ng ca phn t cu trc khng phngHnh 11. Kt qu ca mt s php bin i trn nh nh phn v nh xm3. Cc ng dng 3.1. Trch lc bin nh Boundary extraction trch lc bin ca nh nh phn A, chng ta thc hin hai bc sau: u tin, thc hin php n mn/php co nh vi phn t cu trc B Sau , thc hin kh nn ca nh A bng cch ly nh gc A tr cho nh thc hin bc 1. Nh vy, chng ta c th trch lc bin ca nh A, k hiu l Ap vi mt phn t cu trc B bng cng thc sau [5][8]: Ap = A (A B)18 7. Yu t quan trng trong vic trch lc bin ca nh nh phn l a ra c phn t cu trc khng phng hp l.(a)(b)(c)(d)Hnh 12. Trch lc bin ca i tng: (a) nh gc, (b) hnh dng ca phn t cu trc, (c) nh sau khi thc hin php co nh vi phn t cu trc, (d) nh kt qu theo cng thc trch lc bin.3.2. T y vng Region fill nh nh phn thng l kt qu ca cc php thc hin phn ngng hoc phn on nh xm hoc nh mu u vo. Nhng php bin i ny rt him khi hon ho do nhng nhn t bn ngoi m trong qu trnh ly mu nh chng ta khng kim sot c nh cng sng hay chi xut hin trong nh v n c th li nhng l hng sau khi thc hin ly ngng hoc phn on nh. S dng cc php x l hnh thi hc lp y cc l hng thc s rt hiu qu. Cho mt nh nh phn A gm c: cc im nh l bin ca i tng c gn nhn bng 1 v cc im nh khng phi l bin c gn nhn bng 0. t B l cu trc phn t v x0 l mt im nh bt k nm trong l hng c bao bc bi bin ca i tng (im xut pht). Vic lm y i tng c thc hin bng cch lp i lp li biu thc sau y [2][4][5][8]: x0 = 1; Do = ( 1 ) , vi k = 1,2,3,.... Until xk = xk-1.Kt qu vng i tng c lp y cui cng chng ta c c l H = A 19 8. (a)(b)Hnh 13. Kt qu ca vic thc hin lp y vng nh: (a) nh nh phn vi cc l hng, (b) nh sau khi c lp y.3.3. Trch lc cc thnh phn lin thng Extracting connected components Tp hp tt c cc im nh kt ni ti mt im nh no gi l cc thnh phn kt ni ca im nh [5]. Mt nhm cc gi tr im nh c kt ni vi nhau phn bit vi cc nhm im nh khc thng qua vic gn nhn khc nhau cho cc nhm. Cc nhn ny l cc s nguyn, trong nn c gi tr bng 0, cc vng nh/nhm cc im nh lin thng vi nhau c gn nhn t 1 tr i.Hnh 14. Hnh dng 4 hng xm (N4) v 8 hng xm (N8)Thut ton gn nhn cc thnh phn lin thng vi s hng xm l 8 (N8) thc hin nh sau: -Qut nh u vo tun t theo hng t trn xung cho n khi gp mt im p bt k (p=1, nu l nh nh phn) trong nh.-Kim tra cc hng xm p. Da trn nhng thng tin , vic nh nhn s c thc hin nh sau:-Nu tt c 4 hng xm ca p u bng 0, th gn mt nhn mi cho p, ngc li-Nu ch mt hng xm ca p c gi tr bng 1, gn nhn cho p, ngc li-Nu c nhiu hn mt hng xm ca p c gi tr bng 1, gn mt nhn trong cc nhn cho p v ghi ch thch tng t.Sau khi hon tt qu trnh qut, cc cp nhn tng ng c sp xp vo cc nhm tng ng v mi nhm s ch c mt nhn duy nht c gn.20 9. (a)(b)Hnh 15. Kt qu ca thc hin trch lc thnh phn lin thng trong nhLm mng i tng trong nh Thinning3.4. lm mng i tng trong nh A vi phn t cu trc B c xc nh nh sau [2][5][8]:Trong B = (B1, B2), B1 v B2 khng c g khc nhau, B2 chnh l phn t B1 c thay i v tr cc gi tr 1 (s v tr c gi tr bng 1 khng i).(a)(b)(c)(d)Hnh 16. Kt qu lm mng i tng: (a)Hnh 17. Kt qu lm mng i tng: (c)nh gc, (b) nh kt qu lm mng.nh gc, (d) nh kt qu lm mng.Lm dy i tng trong nh Thickening3.5.Lm dy i tng tng t nh php gin nh, nhng n khng st nhp/gp cc i tng khng kt ni vi nhau. N c s dng lm to cc i tng b lm v c th biu din qua cng thc sau [2][8]:Qu trnh lm dy i tng c biu din nh sau:(a)(b)Hnh 18. Kt qu lm dy i tng: (a) nh gc, (b) nh kt qu lm dy.3.6.(c)(d)Hnh 19. Kt qu lm dy i tng: (a) nh gc, (b) nh kt qu lm dy.Tm xng i tng trong nh Skeletons21 10. Thut ton tm xng ca i tng tng t nh php lm mng i tng, nhng n cho chng ta bit nhiu thng tin ca mt i tng, n nhn mnh mt s c tnh ca hnh nh: cong, ng vin tng ng vi tnh cht hnh hc ca b xng [2]. Nu A l nh nh phn v B l phn t cu trc (thng c kch thc 3x3). Php tm xng ca i tng trong nh A, k hiu l S(A) c xc nh nh sau [1][2][8]:Trong ,Vi k l s ln p dng php lm mng i tng A v K ln ln lm mng cui cng trc khi A suy bin thnh tp rng.(a)(b)Hnh 20. nh (a) l nh gc, nh (b) l nh kt qu s dng php bin i tm xng ca i tng trong nh gc.3.7.Ct ta i tng trong nh pruningXng ca mt mu i tng sau khi thc hin lm mng thng xut hin nhng nhnh nhiu ngn trong nh, v vy xng nh cn phi c lm sch trc khi a vo khu x l tip theo trong m hnh x l nh tng qut. Qu trnh lm sch ny gi l ct ta nh. cc bc ct ta nh c thc hin qua cc bc sau [8]: B1: Thc hin lm mng i tng.B2: Khi phc li nh gc sau khi loi b cc im cui.B3: Thc hin gin cc im cui.22 11. B4: Kt qu ca vic ct ta nh A c thc hin thng qua ly hp ca X1 vi X3.Trong , {B}= {B1, B2, B3,... B8} l phn t cu trc c hnh dng nh sau (cc gi tr mang du x trong phn t cu trc l phn t chng ta khng quan tm):V H l phn t cu trc c kch thc 3x3 vi gi tr bng 1.(a)(b)(c)Hnh 21. Kt qu ca php ct ta nh: (a) nh gc, (b) nh gc sau khi thc hin tm xng nh, (c) kt qu sau khi thc hin ct ta nh xng i tng4. Kt lun Trong lnh vc x l v phn tch nh, mt trong nhng cng vic quan trng l trch lc c nhng c trng ca i tng, m t hnh dng v nhn dng mu. Mt trong nhng nhim v thng cp n khi nim hnh hc ca i tng, v d nh kch thc, hnh dng v hng ca i tng trong nh [2]. X l hnh thi hc c hnh thnh t l thuyt tp hp, hnh hc v hnh hc topo, ... phn tch cc cu trc hnh hc trong nh. Trong bi bo ny, ti gii thiu nhng thut ton c s trong x l hnh thi hc, v gii thiu nhng thut ton v ng dng ph bin hin nay ca x l hnh thi hc trn nh nh phn v nh xm. Mt trong nhng vn quan trng trong cc thut ton x l hnh thi hc l tm v s dng cu trc phn t ph hp c c kt qu tt nht. Hu ht cc thut ton x l hnh thi hc u da trn nhng thut ton c bn nh php co nh, gin nh, ng nh v m nh.23 12. Hin nay, x l hnh thi hc ang c nghin cu su v pht trin, mt trong nhng thnh cng gn y c hiu qu trong x l hnh thi hc l s dng logic m v l thuyt tp m trong cc php ton hnh thi hc. Logic m v l thuyt m cung cp nhiu gii php cho cc thut ton ca x l hnh thi hc [6][7]. TI LIU THAM KHO 1. Pierre Soille (2002), Morphological image analysis: principles and application 2nd, Springer. 2. Frank Y. Shih (2010), Image processing and Pattern recognition: Fundamentals and Techniques, Wiley. 3. Rafael C. Gonzalez, Richard E. Woods, Steven L. Eddins (2008), Digital Image Processing using Matlab, Gatesmark. 4. Wilhelm Burger, Mark J. Burge (2009), Principles of igital Image Processing: Fundamental Techniques, Sprigner. 5. Chris Solomon, Toby Breckon (2011), Fundamentals of Digital Image Processing:Practical Approach with Examples in Matlab, Wiley. 6. Yee Yee Htun1, Khaing Khaing Aye (2008), Fuzzy Mathematical Morphology approach in Image Processing, World Academy of Science, Engineering and Technology 18. 7. Satish Pawar and V. K. Banga, Morphology Approach in Image Processing, (ICICS'2012) Jan. 7-8, 2012 Dubai. 8. Rafael C. Gonzalez and Richard E. Woods (2008), Digital image processing 2nd, Prentice Hall.24</p>