1 of 60

Chapter 9: Morphological Image Processing

Digital Image Processing

2 of 60

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

2

3 of 60

Mathematic Morphology

mathematical framework used for:

  • pre-processing
    • noise filtering, shape simplification, ...
  • enhancing object structure
    • skeletonization, convex hull...
  • Segmentation
    • watershed,…
  • quantitative description
    • area, perimeter, ...

3

4 of 60

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

4

5 of 60

Basic Set Theory

5

6 of 60

Reflection and Translation

6

7 of 60

Logic Operations

7

8 of 60

Example

8

9 of 60

Structuring element (SE)

9

  • 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

10 of 60

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

11 of 60

How to describe SE

  • many different ways!
  • information needed:
    • position of origo for SE
    • positions of elements belonging to SE

11

12 of 60

Basic morphological operations

  • Erosion

  • Dilation

  • combine to
    • Opening object
    • Closening background

12

keep general shape but smooth with respect to

13 of 60

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

14 of 60

14

Erosion

15 of 60

Erosion

15

16 of 60

Erosion

16

17 of 60

Erosion

17

18 of 60

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 object

18

19 of 60

Dilation

19

20 of 60

Dilation

20

21 of 60

Dilation

21

22 of 60

Dilation

22

B = structuring element

23 of 60

Dilation : Bridging gaps

23

24 of 60

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

24

25 of 60

Combining erosion and dilation

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

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

25

26 of 60

Erosion : eliminating irrelevant detail

26

structuring element B = 13x13 pixels of gray level 1

27 of 60

Opening

erosion followed by dilation, denoted ∘

  • eliminates protrusions
  • breaks necks
  • smoothes contour

27

28 of 60

Opening

28

29 of 60

Opening

29

30 of 60

Opening

30

31 of 60

Closing

dilation followed by erosion, denoted •

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

31

32 of 60

Closing

32

33 of 60

Closing

33

34 of 60

Closing

34

35 of 60

Properties

35

Opening

  1. A°B is a subset (subimage) of A
  2. If C is a subset of D, then C °B is a subset of D °B
  3. (A °B) °B = A °B

Closing

  1. A is a subset (subimage) of A∙B
  2. If C is a subset of D, then C ∙B is a subset of D ∙B
  3. (A ∙B) ∙B = A ∙B

Note: repeated openings/closings has no effect!

36 of 60

Duality

  • Opening and closing are dual with respect to complementation and reflection

36

37 of 60

37

38 of 60

38

39 of 60

Useful: open & close

39

40 of 60

Application: filtering

40

41 of 60

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?

41

42 of 60

Hit-or-Miss Transformation

42

43 of 60

Boundary Extraction

43

44 of 60

Example

44

45 of 60

Region Filling

45

46 of 60

Example

46

47 of 60

Extraction of connected components

47

48 of 60

Example

48

49 of 60

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.

49

50 of 60

50

51 of 60

Thinning

51

52 of 60

Thickening

52

53 of 60

Skeletons

53

54 of 60

54

55 of 60

Pruning

55

H = 3x3 structuring element of 1’s

56 of 60

56

57 of 60

57

58 of 60

58

59 of 60

59

60 of 60

5 basic structuring elements

60