Chapter 10 Mathematical Morphology Provides mathematical tools for

  • Slides: 44
Download presentation
Chapter 10: Mathematical Morphology Provides mathematical tools for shape analysis in both binary and

Chapter 10: Mathematical Morphology Provides mathematical tools for shape analysis in both binary and grayscale images. They are suitable to be implemented by hardware. ◎ Basic Operations ○ Reflection -- Reflects a set of pixels w. r. t. the origin 。 Example: 10 -1

○ Translation w: a displacement (a vector) 。 Example: w = (2, 2) ○

○ Translation w: a displacement (a vector) 。 Example: w = (2, 2) ○ Dilation : dilation of A by B B : a structuring element 10 -2

。 Example: can be obtained by replacing every x in A with a B

。 Example: can be obtained by replacing every x in A with a B 10 -3

。Example 10 -4

。Example 10 -4

。 。 Dilation has the effect of increasing the size of an shape 。

。 。 Dilation has the effect of increasing the size of an shape 。 The origin of B may not be in B and it may be that 10 -5

○ Erosion Steps: (i) Move B over A, (ii) Find all the places where

○ Erosion Steps: (i) Move B over A, (ii) Find all the places where B fits (iii) Mark the origin of B when fitting 。 Example: 10 -6

。The origin of B may not be in B and 。Erosion thins an shape

。The origin of B may not be in B and 。Erosion thins an shape 10 -7

○ Proof: From the definition of erosion, Its complement: If 。 Duality , then

○ Proof: From the definition of erosion, Its complement: If 。 Duality , then (Assigment) 10 -8

◎ Boundary Detection Let B: symmetric about its origin The boundary of A (i)

◎ Boundary Detection Let B: symmetric about its origin The boundary of A (i) Internal boundary: -- pixels in A (ii) External boundary: -- pixels outside A (iii) Gradient boundary: -- a combination of internal and external boundary pixels 10 -9

。 Example: external boundary Internal boundary gradient boundary 10 -10

。 Example: external boundary Internal boundary gradient boundary 10 -10

。 Example: Internal boundary External boundary Gradient boundary 10 -11

。 Example: Internal boundary External boundary Gradient boundary 10 -11

○ Opening 。 Example: 1) 2 ) 10 -12

○ Opening 。 Example: 1) 2 ) 10 -12

。 Properties: (i) (ii) Idempotence: (iii) (iv) Opening tends to (a) smooth image, (b)

。 Properties: (i) (ii) Idempotence: (iii) (iv) Opening tends to (a) smooth image, (b) break narrow joins (c) remove thin protrusions 10 -13

○ Closing 。 Example: 10 -14

○ Closing 。 Example: 10 -14

。 Properties: (i) (ii) Idempotence: (iii) (iv) Closing tends to (a) smooth image, (b)

。 Properties: (i) (ii) Idempotence: (iii) (iv) Closing tends to (a) smooth image, (b) fuse narrow breaks (c) thin gulfs, (d) remove small holes 10 -15

○ Relationship between opening and closing Show Proof: (Assign. ) 10 -16

○ Relationship between opening and closing Show Proof: (Assign. ) 10 -16

◎ Removal of impulse (salt and pepper) noise Square Cross A B=Square B=Cross (1)

◎ Removal of impulse (salt and pepper) noise Square Cross A B=Square B=Cross (1) removes single black and white pixels but enlarges holes (2) fills holes by dilating twice but enlarge the objects (3) reduces the size by an erosion 10 -17

○ Hit-or-Miss Transform -- Finds shape B in A Example: (i) (ii) (hit) (miss)

○ Hit-or-Miss Transform -- Finds shape B in A Example: (i) (ii) (hit) (miss) 10 -18

◎ Region filling A: a boundary, p : a point within A 10 -19

◎ Region filling A: a boundary, p : a point within A 10 -19

Example: 10 -20

Example: 10 -20

Example: 10 -21

Example: 10 -21

◎ Connected components Let A : a collection of components C : a component

◎ Connected components Let A : a collection of components C : a component of A p : a point in C B : a structuring element Using to find 4 -connected components to find 8 -connected components Region filling 10 -22

Example: 3× 3 Structuring element 11 × 11 Structuring element 10 -23

Example: 3× 3 Structuring element 11 × 11 Structuring element 10 -23

◎ Skeletonization (thinning) Applications: OCR , fingerprint recognition, map digitization. 10 -24

◎ Skeletonization (thinning) Applications: OCR , fingerprint recognition, map digitization. 10 -24

Optical Character Recognition (OCR) Fingerprint Recognition 10 -25

Optical Character Recognition (OCR) Fingerprint Recognition 10 -25

○ Lantuejoul’s method 10 -26

○ Lantuejoul’s method 10 -26

Structuring element Final result 10 -27

Structuring element Final result 10 -27

Example: 10 -28

Example: 10 -28

◎ Grayscale Morphology ○ Binary erosion: (i) Move B over A, (ii) Find all

◎ Grayscale Morphology ○ Binary erosion: (i) Move B over A, (ii) Find all the places where B fits (iii) Mark the origin of B when fitting 10 -29

For each p of A (i) Find its neighborhood to the domain of B

For each p of A (i) Find its neighborhood to the domain of B (ii) p = min{ } according 10 -30

。 Example: The value of A(1+s, 1+t) – B(s, t) Minimum = 5 10

。 Example: The value of A(1+s, 1+t) – B(s, t) Minimum = 5 10 -31

Final result: 10 -32

Final result: 10 -32

。 Summary for the process of grayscale erosion: For each pixel p of A,

。 Summary for the process of grayscale erosion: For each pixel p of A, (i) Lie the origin of B over p (ii) Find according to domain (iii) p = min{ } of B 10 -33

。 Example: 5 × 5 square structuring element * Erosion decreases light areas in

。 Example: 5 × 5 square structuring element * Erosion decreases light areas in an image 10 -34

○ Binary dilation For each p of A (i) Find its neighborhood to the

○ Binary dilation For each p of A (i) Find its neighborhood to the domain of B (ii) p = max{ } according 10 -35

。 Example: 10 -36

。 Example: 10 -36

Final result: 10 -37

Final result: 10 -37

。 Summary for the process of grayscale dilation: For each pixel p of A,

。 Summary for the process of grayscale dilation: For each pixel p of A, (i) Lie the origin of B over p (ii) Find according to domain (iii) p = max{ } of B 10 -38

。 Example: 5 × 5 square structuring element * Dilation increases light areas in

。 Example: 5 × 5 square structuring element * Dilation increases light areas in an image 10 -39

◎ Relationship between grayscale erosion and dilation Let X, Y: matrices, e. g. ,

◎ Relationship between grayscale erosion and dilation Let X, Y: matrices, e. g. , 10 -40

10 -41

10 -41

○ Edge Detection 3 × 3 square 5 × 5 square 10 -42

○ Edge Detection 3 × 3 square 5 × 5 square 10 -42

◎ Opening = erosion + dilation Closing = dilation + erosion 。 Example: 5

◎ Opening = erosion + dilation Closing = dilation + erosion 。 Example: 5 × 5 square structuring element Opening Closing 10 -43

○ Noise Removal 10 -44

○ Noise Removal 10 -44