107
Lecture 5. Morphological Lecture 5. Morphological Image Processing Image Processing

Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

Embed Size (px)

Citation preview

Page 1: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

Lecture 5. Morphological Image Lecture 5. Morphological Image ProcessingProcessing

Page 2: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 2

IntroductionIntroduction

► Morphology: a branch of biology that deals with the form and structure of animals and plants

► Morphological image processing is used to extract image components for representation and description of region shape, such as boundaries, skeletons, and the convex hull

Page 3: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 3

Preliminaries (1)Preliminaries (1)

► Reflection

► Translation

The reflection of a set , denoted , is defined as

{ | , for }

B B

B w w b b B

1 2The translation of a set by point ( , ), denoted ( ) ,

is defined as

( ) { | , for }

Z

Z

B z z z B

B c c b z b B

Page 4: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 4

Example: Reflection and TranslationExample: Reflection and Translation

Page 5: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 5

Preliminaries (2)Preliminaries (2)

► Structure elements (SE) Small sets or sub-images used to probe an image under

study for properties of interest

Page 6: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 6

Examples: Structuring Elements (1)Examples: Structuring Elements (1)

origin

Page 7: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 7

Examples: Structuring Elements (2)Examples: Structuring Elements (2)Accommodate the entire structuring elements when its origin is on the border of the original set A

Origin of B visits every element of A

At each location of the origin of B, if B is completely contained in A, then the location is a member of the new set, otherwise it is not a member of the new set.

Page 8: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 8

ErosionErosion

2With and as sets in , the erosion of by , denoted ,

defined

| ( )Z

A B Z A B A B

A B z B A

The set of all points such that , translated by , is contained by .z B z A

| ( ) cZA B z B A

Page 9: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 9

ExamplExample of e of

Erosion Erosion (1)(1)

Page 10: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 10

ExamplExample of e of

Erosion Erosion (2)(2)

Page 11: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 11

DilationDilation

2With and as sets in , the dilation of by ,

denoted , is defined as

A B= |z

A B Z A B

A B

z B A

The set of all displacements , the translated and

overlap by at least one element.

z B A

|z

A B z B A A

Page 12: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 12

Examples of Dilation (1)Examples of Dilation (1)

Page 13: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 13

Examples of Dilation (2)Examples of Dilation (2)

Page 14: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 14

DualityDuality

► Erosion and dilation are duals of each other with respect to set complementation and reflection

c c

c c

A B A B

and

A B A B

Page 15: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 15

DualityDuality

► Erosion and dilation are duals of each other with respect to set complementation and reflection

|

|

|

cc

Z

cc

Z

c

Z

c

A B z B A

z B A

z B A

A B

Page 16: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 16

DualityDuality

► Erosion and dilation are duals of each other with respect to set complementation and reflection

|

|

cc

Z

c

Z

c

A B z B A

z B A

A B

Page 17: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 17

Opening and ClosingOpening and Closing

► Opening generally smoothes the contour of an object, breaks narrow isthmuses, and eliminates thin protrusions

► Closing tends to smooth sections of contours but it generates fuses narrow breaks and long thin gulfs, eliminates small holes, and fills gaps in the contour

Page 18: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 18

Opening and ClosingOpening and Closing

The opening of set by structuring element ,

denoted , is defined as

A B

A B

A B A B B

The closing of set by structuring element ,

denoted , is defined as

A B

A B

A B A B B

Page 19: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 19

OpeningOpening

The opening of set by structuring element ,

denoted , is defined as

|Z Z

A B

A B

A B B B A

Page 20: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 20

Example: OpeningExample: Opening

Page 21: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 21

Example: ClosingExample: Closing

Page 22: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 22

Page 23: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 23

Duality of Opening and ClosingDuality of Opening and Closing

► Opening and closing are duals of each other with respect to set complementation and reflection

( )

c cA B A B

( )c cA B A B

Page 24: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 24

The Properties of Opening and ClosingThe Properties of Opening and Closing

► Properties of Opening

► Properties of Closing

(a) is a subset (subimage) of

(b) if is a subset of , then is a subset of

(c) ( )

A B A

C D C B D B

A B B A B

(a) is subset (subimage) of

(b) If is a subset of , then is a subset of

(c) ( )

A A B

C D C B D B

A B B A B

Page 25: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 25

Page 26: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 26

The Hit-or-Miss The Hit-or-Miss TransformationTransformation

if denotes the set composed of

and its background,the match

(or set of matches) of in ,

denoted ,

* c

B

D

B A

A B

A B A D A W D

1 2

1

2

1 2

,

: object

: background

( )c

B B B

B

B

A B A B A B

Page 27: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 27

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (1)(1)

► Boundary Extraction The boundary of a set A, can be obtained by first

eroding A by B and then performing the set difference between A and its erosion.

( )A A A B

Page 28: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 28

Example 1Example 1

Page 29: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 29

Example 2Example 2

Page 30: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 30

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (2)(2)

► Hole Filling A hole may be defined as a background region

surrounded by a connected border of foreground pixels.

Let A denote a set whose elements are 8-connected boundaries, each boundary enclosing a background region (i.e., a hole). Given a point in each hole, the objective is to fill all the holes with 1s.

Page 31: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 31

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (2)(2)

► Hole Filling 1. Forming an array X0 of 0s (the same size as the

array containing A), except the locations in X0

corresponding to the given point in each hole, which we set to 1.

2. Xk = (Xk-1 + B) Ac k=1,2,3,…

Stop the iteration if Xk = Xk-1

Page 32: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 32

Example Example

Page 33: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 33

Page 34: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 34

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (3)(3)

► Extraction of Connected Components Central to many automated image analysis

applications.

Let A be a set containing one or more connected components, and form an array X0 (of the same size as the array containing A) whose elements are 0s, except at each location known to correspond to a point in each connected component in A, which is set to 1.

Page 35: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 35

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (3)(3)

► Extraction of Connected Components Central to many automated image analysis

applications.

1

-1

( )

: structuring element

until

k k

k k

X X B A

B

X X

Page 36: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 36

Page 37: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 37

Page 38: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 38

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (4)(4)

► Convex Hull A set A is said to be convex if the straight line

segment joining any two points in A lies entirely within A.

The convex hull H or of an arbitrary set S is the smallest convex set containing S.

Page 39: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 39

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (4)(4)

► Convex Hull

1

Let , 1, 2, 3, 4, represent the four structuring elements.

The procedure consists of implementing the equation:

( * )

1, 2,3, 4 and 1,

i

i ik k

B i

X X B A

i k

0

1

4

1

2,3,...

with .

When the procedure converges, or , let ,

the convex hull of A is

( )

i

i i i ik k k

i

i

X A

X X D X

C A D

Page 40: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 40

Page 41: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 41

Page 42: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 42

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (5)(5)

► Thinning The thinning of a set A by a structuring element B,

defined ( * )

( * )cA B A A B

A A B

Page 43: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 43

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (5)(5)

► A more useful expression for thinning A symmetrically is based on a sequence of structuring elements:

1 2 3

-1

, , ,...,

where is a rotated version of

n

i i

B B B B B

B B

1 2

The thinning of by a sequence of structuring element { }

{ } ((...(( ) )...) )n

A B

A B A B B B

Page 44: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 44

Page 45: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 45

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (6)(6)

► Thickening:

The thickening is defined by the expression

*A B A A B

1 2

The thickening of by a sequence of structuring element { }

{ } ((...(( ) )...) )n

A B

A B A B B B

In practice, the usual procedure is to thin the background of the set

and then complement the result.

Page 46: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 46

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (6)(6)

Page 47: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 47

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (7)(7)

► Skeletons A skeleton, ( ) of a set has the following properties

a. if is a point of ( ) and ( ) is the largest disk

centered at and contained in , one cannot find a

larger disk containing ( )

z

z

S A A

z S A D

z A

D and included in .

The disk ( ) is called a maximum disk.

b. The disk ( ) touches the boundary of at two or

more different places.

z

z

A

D

D A

Page 48: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 48

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (7)(7)

Page 49: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 49

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (7)(7)

0

The skeleton of A can be expressed in terms of

erosion and openings.

( ) ( )

with max{ | };

( ) ( ) ( )

where is a structuring element, and

K

kk

k

S A S A

K k A kB

S A A kB A kB B

B

( ) ((..(( ) ) ...) )

successive erosions of A.

A kB A B B B

k

Page 50: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 50

Page 51: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 51

Page 52: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 52

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (7)(7)

0

A can be reconstructed from the subsets by using

( ( ) )

where ( ) denotes successive dilations of A.

( ( ) ) ((...(( ( ) ) )... )

K

kk

k

k k

A S A kB

S A kB k

S A kB S A B B B

Page 53: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 53

Page 54: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 54

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (8)(8)

► Pruning a. Thinning and skeletonizing tend to leave parasitic components

b. Pruning methods are essential complement to thinning and

skeletonizing procedures

Page 55: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 55

PruningPruning: :

ExamplExamplee

1 { }X A B

Page 56: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 56

PruningPruning: :

ExamplExamplee

8

2 11* k

kX X B

Page 57: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 57

PruningPruning: :

ExamplExamplee

3 2

: 3 3 structuring element

X X H A

H

Page 58: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 58

PruningPruning: :

ExamplExamplee

4 1 3X X X

Page 59: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 59

PruningPruning: :

ExamplExamplee

Page 60: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 60

Some Basic Morphological Algorithms Some Basic Morphological Algorithms (9)(9)

► Morphological Reconstruction It involves two images and a structuring element

a. One image contains the starting points for the

transformation (The image is called marker)

b. Another image (mask) constrains the transformation

c. The structuring element is used to define connectivity

Page 61: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 61

Morphological Reconstruction: Geodesic Morphological Reconstruction: Geodesic DilationDilation

(1)

(1)

Let denote the marker image and the mask image,

. The geodesic dilation of size 1 of the marker image

with respect to the mask, denoted by ( ), is defined as

( ) G

G

G

F G

F G

D F

D F F B

( )

( ) (1) ( 1)

(0)

The geodesic dilation of size of the marker image

with respect to , denoted by ( ), is defined as

( ) ( ) ( )

with ( ) .

nG

n nG G G

G

n F

G D F

D F D F D F

D F F

Page 62: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 62

Page 63: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 63

Morphological Reconstruction: Geodesic Morphological Reconstruction: Geodesic ErosionErosion

(1)

(1)

Let denote the marker image and the mask image.

The geodesic erosion of size 1 of the marker image with

respect to the mask, denoted by ( ), is defined as

( ) G

G

G

F G

E F

E F F B

( )

( ) (1) ( 1)

(0)

The geodesic erosion of size of the marker image

with respect to , denoted by ( ), is defined as

( ) ( ) ( )

with ( ) .

nG

n nG G G

G

n F

G E F

E F E F E F

E F F

Page 64: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 64

Page 65: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 65

Morphological Reconstruction by Morphological Reconstruction by DilationDilation

Morphological reconstruction by dialtion of a mask image

from a marker image , denoted ( ), is defined as

the geodesic dilation of with respect to , iterated until

stability is achieved; that

DGG F R F

F G

( )

( ) ( 1)

is,

( ) ( )

with such that ( ) ( ).

D kG G

k kG G

R F D F

k D F D F

Page 66: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 66

Page 67: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 67

Morphological Reconstruction by ErosionMorphological Reconstruction by Erosion

Morphological reconstruction by erosion of a mask image

from a marker image , denoted ( ), is defined as

the geodesic erosion of with respect to , iterated until

stability is achieved; that i

EGG F R F

F G

( )

( ) ( 1)

s,

( ) ( )

with such that ( ) ( ).

E kG G

k kG G

R F E F

k E F E F

Page 68: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 68

Opening by ReconstructionOpening by Reconstruction

( )

The opening by reconstruction of size of an image is

defined as the reconstruction by dilation of from the

erosion of size of ; that is

( )

where

n DR F

n F

F

n F

O F R F nB

F nB

indicates erosions of by .n F B

Page 69: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 69

Page 70: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 70

Filling HolesFilling Holes

Let ( , ) denote a binary image and suppose that we

form a marker image that is 0 everywhere, except at

the image border, where it is set to 1- ; that is

1 ( , ) if ( , ) is on the bor ( , )

I x y

F

I

I x y x yF x y

der of

0 otherwise

then

( )c

cD

I

I

H R F

Page 71: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 71

SE : 3 3 1s.

Page 72: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 72

( )c

cD

IH R F

Page 73: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 73

Border ClearingBorder Clearing

It can be used to screen images so that only complete objects

remain for further processing; it can be used as a singal that

partial objects are present in the field of view.

The original image is used as the mask and the following

marker image:

( , ) if ( , ) is on the border of ( , )

0 otherwise

I x y x y IF x y

X I R

( )DI F

Page 74: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 74

Page 75: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 75

Summary (1)Summary (1)

Page 76: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 76

Summary (2)Summary (2)

Page 77: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 77

Page 78: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 78

Page 79: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 79

Gray-Scale MorphologyGray-Scale Morphology

( , ) : gray-scale image

( , ): structuring element

f x y

b x y

Page 80: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 80

Gray-Scale Morphology: Erosion and Gray-Scale Morphology: Erosion and Dilation by Flat StructuringDilation by Flat Structuring

( , )

( , )

( , ) min ( , )

( , ) max ( , )

s t b

s t b

f b x y f x s y t

f b x y f x s y t

Page 81: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 81

Page 82: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 82

Gray-Scale Morphology: Erosion and Gray-Scale Morphology: Erosion and Dilation by Nonflat StructuringDilation by Nonflat Structuring

( , )

( , )

( , ) min ( , ) ( , )

( , ) max ( , ) ( , )

N Ns t b

N Ns t b

f b x y f x s y t b s t

f b x y f x s y t b s t

Page 83: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 83

Duality: Erosion and DilationDuality: Erosion and Dilation

( , ) ( , )

where ( , ) and ( , )

c c

c

c c

f b x y f b x y

f f x y b b x y

f b f b

( )c cf b f b

Page 84: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 84

Opening and ClosingOpening and Closing

f b f b b

f b f b b

c c

c c

f b f b f b

f b f b f b

Page 85: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 85

Page 86: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 86

Properties of Gray-scale OpeningProperties of Gray-scale Opening

1 2 1 2

( )

( ) if , then

( )

where denotes is a subset of and also

( , ) ( , ).

a f b f

b f f f b f b

c f b b f b

e r e r

e x y r x y

Page 87: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 87

Properties of Gray-scale ClosingProperties of Gray-scale Closing

1 2 1 2

( )

( ) if , then

( )

a f f b

b f f f b f b

c f b b f b

Page 88: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 88

Page 89: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 89

Morphological SmoothingMorphological Smoothing

► Opening suppresses bright details smaller than the specified SE, and closing suppresses dark details.

► Opening and closing are used often in combination

as morphological filters for image smoothing and noise removal.

Page 90: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 90

Morphological SmoothingMorphological Smoothing

Page 91: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 91

Morphological GradientMorphological Gradient

► Dilation and erosion can be used in combination with image subtraction to obtain the morphological gradient of an image, denoted by g,

► The edges are enhanced and the contribution of the homogeneous areas are suppressed, thus producing a “derivative-like” (gradient) effect.

( ) ( )g f b f b

Page 92: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 92

Morphological GradientMorphological Gradient

Page 93: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 93

Top-hat and Bottom-hat Top-hat and Bottom-hat TransformationsTransformations

► The top-hat transformation of a grayscale image f is defined as f minus its opening:

► The bottom-hat transformation of a grayscale image f is defined as its closing minus f:

( ) ( )hatT f f f b

( ) ( )hatB f f b f

Page 94: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 94

Top-hat and Bottom-hat Top-hat and Bottom-hat TransformationsTransformations

► One of the principal applications of these transformations is in removing objects from an image by using structuring element in the opening or closing operation

Page 95: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 95

Example of Using Top-hat Transformation in Example of Using Top-hat Transformation in SegmentationSegmentation

Page 96: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 96

GranulometryGranulometry

► Granulometry deals with determining the size of distribution of particles in an image

► Opening operations of a particular size should have the most effect on regions of the input image that contain particles of similar size

► For each opening, the sum (surface area) of the pixel values in the opening is computed

Page 97: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 97

ExampleExample

Page 98: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 98

Page 99: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 99

Textual SegmentationTextual Segmentation

► Segmentation: the process of subdividing an image into regions.

Page 100: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 100

Textual SegmentationTextual Segmentation

Page 101: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 101

Gray-Scale Morphological Gray-Scale Morphological Reconstruction (1)Reconstruction (1)

► Let f and g denote the marker and mask image with the same size, respectively and f ≤ g.

The geodesic dilation of size 1 of f with respect to g is defined as

The geodesic dilation of size n of f with respect to g is defined as

(1) ( )

where denotes the point-wise minimum operator.

gD f f g g

( ) (1) ( 1) (0)( ) ( ) with ( )n ng g g gD f D D f D f f

Page 102: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 102

Gray-Scale Morphological Gray-Scale Morphological Reconstruction (2)Reconstruction (2)

► The geodesic erosion of size 1 of f with respect to g is defined as

The geodesic erosion of size n of f with respect to g

is defined as

(1) ( )

where denotes the point-wise maximum operator.

gE f f g g

( ) (1) ( 1) (0)( ) ( ) with ( )n ng g g gE f E E f E f f

Page 103: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 103

Gray-Scale Morphological Gray-Scale Morphological Reconstruction (3)Reconstruction (3)

► The morphological reconstruction by dilation of a gray-scale mask image g by a gray-scale marker image f, is defined as the geodesic dilation of f with respect to g, iterated until stability is reached, that is,

The morphological reconstruction by erosion of g by f is defined as

( )

( ) ( 1)

( )

with k such that

D kg g

k kg g

R f D f

D f D f

( )

( ) ( 1)

( )

with k such that

E kg g

k kg g

R f E f

E f E f

Page 104: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 104

Gray-Scale Morphological Gray-Scale Morphological Reconstruction (4)Reconstruction (4)

► The opening by reconstruction of size n of an image f is defined as the reconstruction by dilation of f from the erosion of size n of f; that is,

The closing by reconstruction of size n of an image f is defined as the reconstruction by erosion of f from the dilation of size n of f; that is,

( ) ( )n DR fO f R f nb

( ) ( )n ER fC f R f nb

Page 105: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 105

Page 106: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 106

Steps in the ExampleSteps in the Example

1. Opening by reconstruction of the original image using a horizontal line of size 1x71 pixels in the erosion operation

2. Subtract the opening by reconstruction from original image

3. Opening by reconstruction of the f’ using a vertical line of size 11x1 pixels

4. Dilate f1 with a line SE of size 1x21, get f2.

( ) ( )n DR fO f R f nb

( )' ( )nRf f O f

( )1 ( ') ' 'n DR ff O f R f nb

Page 107: Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals

04/19/23 107

Steps in the ExampleSteps in the Example

5. Calculate the minimum between the dilated image f2 and and f’, get f3.

6. By using f3 as a marker and the dilated image f2 as the mask,

( )2 2

( ) ( 1)2 2

( 3) 3

with k such that 3 3

D kf f

k kf f

R f D f

D f D f