Chapter 9: Morphological Image Processing Digital Image Processing.

58

Click here to load reader

Transcript of Chapter 9: Morphological Image Processing Digital Image Processing.

Page 1: Chapter 9: Morphological Image Processing Digital Image Processing.

Chapter 9: Morphological Image Processing

Digital Image Processing

Page 2: Chapter 9: Morphological Image Processing Digital Image Processing.

2

Mathematic Morphology used to extract image components that are

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

Page 3: Chapter 9: Morphological Image Processing Digital Image Processing.

3

Mathematic Morphology

mathematical framework used for: pre-processing

noise filtering, shape simplification, ... enhancing object structure

skeletonization, convex hull... Segmentation

watershed,… quantitative description

area, perimeter, ...

Page 4: Chapter 9: Morphological Image Processing Digital Image Processing.

4

Z2 and Z3

set in mathematic morphology represent objects in an image binary image (0 = white, 1 = black) : the

element of the set is the coordinates (x,y) of pixel belong to the object Z2

gray-scaled image : the element of the set is the coordinates (x,y) of pixel belong to the object and the gray levels Z3

Page 5: Chapter 9: Morphological Image Processing Digital Image Processing.

5

Basic Set Theory

Page 6: Chapter 9: Morphological Image Processing Digital Image Processing.

6

Reflection and Translation

} ,|{ˆ Bfor bbwwB

} ,|{)( Afor azaccA z

Page 7: Chapter 9: Morphological Image Processing Digital Image Processing.

7

Logic Operations

Page 8: Chapter 9: Morphological Image Processing Digital Image Processing.

8

Example

Page 9: Chapter 9: Morphological Image Processing Digital Image Processing.

Structuring element (SE)

9

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

Page 10: Chapter 9: Morphological Image Processing Digital Image Processing.

Basic idea in parallel for each pixel in binary

image: check if SE is ”satisfied” output pixel is set to 0 or 1 depending on

used operation

10

Page 11: Chapter 9: Morphological Image Processing Digital Image Processing.

How to describe SE many different ways! information needed:

position of origo for SE positions of elements belonging to SE

11

Page 12: Chapter 9: Morphological Image Processing Digital Image Processing.

Basic morphological operations

Erosion

Dilation

combine to Opening object Closening background

12

keep general shape but smooth with respect to

Page 13: Chapter 9: Morphological Image Processing Digital Image Processing.

Erosion 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

13

}{ Az|(B)BA z

Page 14: Chapter 9: Morphological Image Processing Digital Image Processing.

Erosion

14

Page 15: Chapter 9: Morphological Image Processing Digital Image Processing.

Erosion

15

Page 16: Chapter 9: Morphological Image Processing Digital Image Processing.

16

Erosion

}{ Az|(B)BA z

Page 17: Chapter 9: Morphological Image Processing Digital Image Processing.

Dilation Does the structuring element hit the

set? dilation of a set A by structuring

element B: all z in A such that B hits A when origin of B=z

grow the object17

}ˆ{ ΦA)Bz|(BA z

Page 18: Chapter 9: Morphological Image Processing Digital Image Processing.

Dilation

18

Page 19: Chapter 9: Morphological Image Processing Digital Image Processing.

Dilation

19

Page 20: Chapter 9: Morphological Image Processing Digital Image Processing.

20

Dilation

}ˆ{ ΦA)Bz|(BA z

B = structuring element

Page 21: Chapter 9: Morphological Image Processing Digital Image Processing.

21

Dilation : Bridging gaps

Page 22: Chapter 9: Morphological Image Processing Digital Image Processing.

useful erosion

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

Dilation filling of holes of certain shape and size,

given by SE

22

Page 23: Chapter 9: Morphological Image Processing Digital Image Processing.

Combining erosion and dilation

WANTED: remove structures / fill holes without affecting remaining parts

SOLUTION: combine erosion and dilation (using same SE)

23

Page 24: Chapter 9: Morphological Image Processing Digital Image Processing.

24

Erosion : eliminating irrelevant detail

structuring element B = 13x13 pixels of gray level 1

Page 25: Chapter 9: Morphological Image Processing Digital Image Processing.

Opening

erosion followed by dilation, denoted ∘

eliminates protrusions breaks necks smoothes contour

25

BBABA )(

Page 26: Chapter 9: Morphological Image Processing Digital Image Processing.

Opening

26

Page 27: Chapter 9: Morphological Image Processing Digital Image Processing.

Opening

27

Page 28: Chapter 9: Morphological Image Processing Digital Image Processing.

28

Opening

BBABA )(})(|){( ABBBA zz

Page 29: Chapter 9: Morphological Image Processing Digital Image Processing.

Closing

dilation followed by erosion, denoted •

smooth contour fuse narrow breaks and long thin gulfs eliminate small holes fill gaps in the contour

29

BBABA )(

Page 30: Chapter 9: Morphological Image Processing Digital Image Processing.

Closing

30

Page 31: Chapter 9: Morphological Image Processing Digital Image Processing.

Closing

31

Page 32: Chapter 9: Morphological Image Processing Digital Image Processing.

32

Closing

BBABA )(

Page 33: Chapter 9: Morphological Image Processing Digital Image Processing.

33

Properties

Opening(i) AB 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 AB(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 34: Chapter 9: Morphological Image Processing Digital Image Processing.

Duality

Opening and closing are dual with respect to complementation and reflection

34

)ˆ()( BABA cc

Page 35: Chapter 9: Morphological Image Processing Digital Image Processing.

35

Page 36: Chapter 9: Morphological Image Processing Digital Image Processing.

36

Page 37: Chapter 9: Morphological Image Processing Digital Image Processing.

Useful: open & close

37

Page 38: Chapter 9: Morphological Image Processing Digital Image Processing.

Application: filtering

38

Page 39: Chapter 9: Morphological Image Processing Digital Image Processing.

Hit-or-Miss Transformation ⊛ (HMT)

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

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

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

39

Page 40: Chapter 9: Morphological Image Processing Digital Image Processing.

40

Hit-or-Miss Transformation

)]([)( XWAXABA c

Page 41: Chapter 9: Morphological Image Processing Digital Image Processing.

41

Boundary Extraction

)()( BAAA

Page 42: Chapter 9: Morphological Image Processing Digital Image Processing.

42

Example

Page 43: Chapter 9: Morphological Image Processing Digital Image Processing.

43

Region Filling,...3,2,1 )( 1 kABXX c

kk

Page 44: Chapter 9: Morphological Image Processing Digital Image Processing.

44

Example

Page 45: Chapter 9: Morphological Image Processing Digital Image Processing.

45

Extraction of connected components

Page 46: Chapter 9: Morphological Image Processing Digital Image Processing.

46

Example

Page 47: Chapter 9: Morphological Image Processing Digital Image Processing.

Convex hull A set A is is

said to be convex if the straight line segment joining any two points in A lies entirely within A.

i

iDAC

4

1)(

,...3,2,1 and 4,3,2,1 )( kiABXX iik

ik

47

Page 48: Chapter 9: Morphological Image Processing Digital Image Processing.

48

Page 49: Chapter 9: Morphological Image Processing Digital Image Processing.

49

Thinning

cBAA

BAABA

)(

)(

Page 50: Chapter 9: Morphological Image Processing Digital Image Processing.

50

Thickening

)( BAABA

Page 51: Chapter 9: Morphological Image Processing Digital Image Processing.

51

SkeletonsK

kk ASAS

0

)()(

BkBAkBAASk )()()(

})(|max{ kBAkK

))((0

kBASA k

K

k

Page 52: Chapter 9: Morphological Image Processing Digital Image Processing.

52

Page 53: Chapter 9: Morphological Image Processing Digital Image Processing.

53

Pruning

}{1 BAX

AHXX )( 23

314 XXX

H = 3x3 structuring element of 1’s

)( 1

8

12

k

kBXX

Page 54: Chapter 9: Morphological Image Processing Digital Image Processing.

54

Page 55: Chapter 9: Morphological Image Processing Digital Image Processing.

55

Page 56: Chapter 9: Morphological Image Processing Digital Image Processing.

56

Page 57: Chapter 9: Morphological Image Processing Digital Image Processing.

57

Page 58: Chapter 9: Morphological Image Processing Digital Image Processing.

58

5 basic structuring elements