Digital Image Processing Lecture 14 Morphology Prof Charlene

  • Slides: 25
Download presentation
Digital Image Processing Lecture 14: Morphology Prof. Charlene Tsai

Digital Image Processing Lecture 14: Morphology Prof. Charlene Tsai

What is morphology? n Back to lecture 1 … Erosion Dilation 2

What is morphology? n Back to lecture 1 … Erosion Dilation 2

Preliminaries – Set Theory n n Let A be a set in Z 2.

Preliminaries – Set Theory n n Let A be a set in Z 2. If a=(a 1, a 2) is an element of A, then we write (if not, ) If A contains no element, it is called null or empty set If every element of a set A is also an element of another set B, then A is said to be a subset of B, denoted as More definitions: 3

Preliminaries – Set Theory (more) n Two more definitions particularly important to morphology: q

Preliminaries – Set Theory (more) n Two more definitions particularly important to morphology: q q Reflection of set B, denoted , is Translation of set A by point z=(z 1, z 2), denoted (A)Z, is 4

Dilation & Erosion n n Most primitive operations in morphology. All other operations are

Dilation & Erosion n n Most primitive operations in morphology. All other operations are built from a combination of these two. 5

Dilation n Dilation of A by B, denoted as n Intuition: for every point

Dilation n Dilation of A by B, denoted as n Intuition: for every point , we translate A by those coordinates. We then take the union of all these translation. From the definition, we see that dilation is commutative, B is referred to as a structuring element or as a kernel. n n , is defined 6

Example 1 2 3 4 5 1 -1 0 1 2 -1 3 0

Example 1 2 3 4 5 1 -1 0 1 2 -1 3 0 4 1 5 B 6 7 A A(0, 0) is itself 7

A(1, 1) & A(-1, 1) 1 2 3 4 5 1 2 1 1

A(1, 1) & A(-1, 1) 1 2 3 4 5 1 2 1 1 2 2 3 3 4 4 5 5 6 6 7 7 A(1, 1) 3 4 5 A(-1, 1) 8

A(1, -1) & A(-1, -1) 1 2 3 4 5 1 2 1 1

A(1, -1) & A(-1, -1) 1 2 3 4 5 1 2 1 1 2 2 3 3 4 4 5 5 6 6 7 7 A(1, -1) 3 4 5 A(-1, -1) 9

Result 1 2 3 4 5 6 7 10

Result 1 2 3 4 5 6 7 10

Some Remarks n n Dilation has the effect of increasing the size of an

Some Remarks n n Dilation has the effect of increasing the size of an object. However, it is not necessarily true that the original object A will lie within its dilation. q Try out B={(7, 3), (6, 2), (6, 4), (8, 2), (8, 4)} 11

Application n An simple application is bridging gaps. q Max length of break is

Application n An simple application is bridging gaps. q Max length of break is 2 pixels 12

Erosion n Erosion of A by B is Intuition: all point w=(x, y) for

Erosion n Erosion of A by B is Intuition: all point w=(x, y) for which Bw is in A. Consider A and B below: B A 13

Moving B around 14

Moving B around 14

Application n One simple application is eliminating irrelevant detail from a binary image. 15

Application n One simple application is eliminating irrelevant detail from a binary image. 15

Opening and Closing n n n Some combination of dilation and erosion Opening: breaking

Opening and Closing n n n Some combination of dilation and erosion Opening: breaking narrow isthmuses, and eliminating protrusions. Closing: fusing narrow breaks and long thin gulfs. 16

Geometric Interpretation: Opening of A by B is obtained by taking the union of

Geometric Interpretation: Opening of A by B is obtained by taking the union of all translates of B that fit into A 17

Geometric Interpretation: Closing if all translation Bw that contain x have nonempty intersections with

Geometric Interpretation: Closing if all translation Bw that contain x have nonempty intersections with A 18

Another Illustration Erosion Opening Dilation Closing 19

Another Illustration Erosion Opening Dilation Closing 19

Properties of Opening & Closing n Opening: q q q n is a subset

Properties of Opening & Closing n Opening: q q q n is a subset (subimage) of A If C is a subset of D, then is a subset of (idempotence, meaning opening cannot be done multiple times) Closing: q q q A is a subset (subimage) of If C is a subset of D, then is a subset of (same as opening) 20

Application: Noise Removal n n n Similar in concept to the spatial filtering Let’s

Application: Noise Removal n n n Similar in concept to the spatial filtering Let’s take a look at the fingerprint image corrupted by noise. What morphological operations can be done to remove the black and white dots? B A 21

Application: Noise Removal 22

Application: Noise Removal 22

Hit-or-Miss Transformation n A powerful method for finding objects of a specific shape in

Hit-or-Miss Transformation n A powerful method for finding objects of a specific shape in an image. Only need erosion. Now consider set A below, and we want to find subset X using structuring element B, the same as X 23

Hit-or-Miss Transformation: Example Step 1 Step 2 Final 24

Hit-or-Miss Transformation: Example Step 1 Step 2 Final 24

Summary n Morphological operations: q q n Dilation Erosion Opening (erosion then dilation) Closing

Summary n Morphological operations: q q n Dilation Erosion Opening (erosion then dilation) Closing (dilation then erosion) Morphological algorithm q Hit-or-Miss transform 25