Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image...

39
Chapter 9: Morphological Image Processing Digital Image Processing

Transcript of Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image...

Page 1: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Chapter 9: Morphological Image Processing

Digital Image Processing

Page 2: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

2

Mathematic Morphology n  used to extract image components that are

useful in the representation and description of region shape, such as n  boundaries extraction n  skeletons n  convex hull n  morphological filtering n  thinning n  pruning

Page 3: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

3

Basic Set Theory

Page 4: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

4

Reflection and Translation

} ,|{ˆ Bfor bbwwB ∈−∈=

} ,|{)( Afor azaccA z ∈+∈=

Page 5: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

5

Example

Page 6: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Structuring element (SE)

6

§  small set to probe the image under study §  for each SE, define origo §  shape and size must be adapted to geometric properties for the objects

Page 7: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Basic morphological operations n  Erosion

n  Dilation n  combine to

n  Opening object n  Closening background

7

keep general shape but smooth with respect to

Page 8: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Erosion n  Does the structuring element fit the set?

erosion of a set A by structuring element B: all z in A such that B is in A when origin of B=z

shrink the object

8

}{ Az|(B)BA z ⊆=−

Page 9: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Erosion

9

Page 10: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Erosion

10

Page 11: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

11

Erosion

}{ Az|(B)BA z ⊆=−

Page 12: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Dilation n  Does the structuring element hit the set?

n  dilation of a set A by structuring element B: all z in A such that B hits A when origin of B=z

n  grow the object 12

}ˆ{ ΦA)Bz|(BA z ≠∩=⊕

Page 13: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Dilation

13

Page 14: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Dilation

14

Page 15: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

15

Dilation

}ˆ{ ΦA)Bz|(BA z ≠∩=⊕

B = structuring element

Page 16: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

16

Dilation : Bridging gaps

Page 17: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

useful n  erosion

n  removal of structures of certain shape and size, given by SE

n  Dilation n  filling of holes of certain shape and size,

given by SE

17

Page 18: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Combining erosion and dilation

n  WANTED: n  remove structures / fill holes n  without affecting remaining parts

n  SOLUTION: n  combine erosion and dilation n  (using same SE)

18

Page 19: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

19

Erosion : eliminating irrelevant detail

structuring element B = 13x13 pixels of gray level 1

Page 20: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Opening erosion followed by dilation, denoted ∘

n  eliminates protrusions n  breaks necks n  smoothes contour

20

BBABA ⊕−= )(

Page 21: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Opening

21

Page 22: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Opening

22

Page 23: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

23

Opening

BBABA ⊕−= )(})(|){( ABBBA zz ⊆∪=

Page 24: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Closing dilation followed by erosion, denoted • n  smooth contour n  fuse narrow breaks and long thin gulfs n  eliminate small holes n  fill gaps in the contour

24

BBABA −⊕=• )(

Page 25: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Closing

25

Page 26: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Closing

26

Page 27: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

27

Closing

BBABA −⊕=• )(

Page 28: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

28

Properties

Opening (i)  A°B is a subset (subimage) of A (ii)  If C is a subset of D, then C °B is a subset of D °B (iii)  (A °B) °B = A °B

Closing (i)  A is a subset (subimage) of A•B (ii)  If C is a subset of D, then C •B is a subset of D •B (iii)  (A •B) •B = A •B

Note: repeated openings/closings has no effect!

Page 29: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Duality n  Opening and closing are dual with respect

to complementation and reflection

29

)ˆ()( BABA cc =•

Page 30: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

30

Page 31: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

31

Page 32: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Useful: open & close

32

Page 33: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Application: filtering

33

Page 34: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

Hit-or-Miss Transformation ⊛ (HMT)

n  find location of one shape among a set of shapes ”template matching

n  composite SE: object part (B1) and background part (B2)

n  does B1 fits the object while, simultaneously, B2 misses the object, i.e., fits the background?

34

Page 35: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

35

Hit-or-Miss Transformation

)]([)( XWAXABA c −−∩−=∗

Page 36: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

36

Boundary Extraction

)()( BAAA −−=β

Page 37: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

37

Example

Page 38: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

38

Region Filling ,...3,2,1 )( 1 =∩⊕= − kABXX c

kk

Page 39: Digital Image Processing Chapter 9: Morphological Image ...pkalra/csl783/Morphological.pdf · Image Processing Digital Image Processing. 2 Mathematic Morphology! used to extract image

39

Example