Chapter 9 Morphological Image Processing การทำงานกับรูปภาพด้วยวิธีมอร์โฟโลจิคัล.

Post on 18-Jan-2016

234 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

Transcript

Chapter 9

Morphological Image Processingการทำ�างานก�บรปภาพด้�วยว�ธี�มอร�โฟโลจิ�คั�ล

Digital Image Processing by K.Ratchadaporn

2

Meaning of “Morphology”

Commonly a branch of biology that deals with the form and structure of animals and plants.

“mathematical morphology” as a tool for extracting image components that representation and description of region shape, such as boundaries, skeletons, and the convex hull.

Digital Image Processing by K.Ratchadaporn

3

Mathematical morphology

The language of mathematical morphology is set theory.

Sets in mathematical morphology represent objects in an image.

Example: the set of all back pixels in a binary image is a complete morphological description of the image. Each element of set is a tuple(2D vector) whose coordinates are the (x,y) coordinates of a black pixel in the image.

Digital Image Processing by K.Ratchadaporn

4

Example

Binary Image Set A is set of

black pixelsA = {(3,1),(4,1),(2,2),(5,2),(2,3),(5,3),(1,4),(2,4),(3,4),(4,4),(5,4),(6,4),(1,5),(6,5),(1,6),(6,6)}

0

0

7

7

Digital Image Processing by K.Ratchadaporn

5

Basic Concepts of Set Theory

Definition of Elements What Subset is Union Operation Intersection Operation Mutually exclusive Property Complement Operation Difference Operation

Digital Image Processing by K.Ratchadaporn

6

Definition of Elements

Let A be a set in Z2. If a = (a1,a2) is an element of A, then we write

Similarly, if a isn’t an element of A we write

An arbitrary set in Zn has elements n-tuples as (z1,z2,. . .,zn)

The set with no elements is called the null or empty set

Aa

Aa

bydenote

Digital Image Processing by K.Ratchadaporn

7

What subset is

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

BA Example:

X={(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)} andY={(1,2),(2,1),(2,2),(2,3),(3,2)}

So, XY

Digital Image Processing by K.Ratchadaporn

8

Union Operation

The union of two sets A and B denoted by

Set C is the set of all elements belonging to either A, B, or both

BAC

Digital Image Processing by K.Ratchadaporn

9

Intersection Operation

The intersection of two sets A and B denoted by

Set D is the set of all elements belonging to both A and B

BAC

Digital Image Processing by K.Ratchadaporn

10

Mutually Exclusive Property

BA

Two sets A and B is disjoint or mutually exclusive if they have no common elements

A B

Digital Image Processing by K.Ratchadaporn

11

Complement & Difference

The complement of a set A is the set of elements not contained in A:

Difference of two sets A and B, denoted A-B, is defined as

This is the set of elements that belong to A, but not to B.

AwwAc |

cBABwAwwBA ,|

Digital Image Processing by K.Ratchadaporn

12

Summary

BA BA

cA BA

Digital Image Processing by K.Ratchadaporn

13

Addition definition

Two additional definition that are used extensively in morphology The reflection of set B is defined as

The translation of set A by point z=(z1,z2) is defined as

BbforbwwB ,|ˆ

AaforzaccA z ,|)(

Digital Image Processing by K.Ratchadaporn

14

Reflection

B

Digital Image Processing by K.Ratchadaporn

15

Translation

zA)(

z1

z2

Digital Image Processing by K.Ratchadaporn

16

Logic Operations & Binary Images

The principal logic operations used in image processing are AND, OR, and NOT(Complement)

Logic operations are preformed on a pixel by pixel basis between corresponding pixels of two or more images(except NOT)

Digital Image Processing by K.Ratchadaporn

17

Logic Operations & Binary Images

AND

OR

Digital Image Processing by K.Ratchadaporn

18

Logic Operations & Binary Images

NAND

XOR

Digital Image Processing by K.Ratchadaporn

19

Fundamental morphological processing

Two Operation are fundamental to morphological processing: Dilation Erosion

Many of the morphological algorithms are based on these two primitive operations

Digital Image Processing by K.Ratchadaporn

20

Dilation

Let A and B as set in Z2,

The dilation of A by B is defined as

Then it is the set of all displacements, zSuch that B and A overlap by at least one element

Note : Set B is commonly referred to as the “structuring element”

})ˆ(|{ ABzBA z

}])ˆ[(|{ AABzBA z

Digital Image Processing by K.Ratchadaporn

21

Example : Dilation

2

y

2

y

2x

2x

d

d

x

y

Digital Image Processing by K.Ratchadaporn

22

Example : Dilation

Digital Image Processing by K.Ratchadaporn

23

Application : Dilation0 1 01 1 10 1 0

Digital Image Processing by K.Ratchadaporn

24

Erosion

Let A and B as set in Z2,

The erosion of A by B is defined as

Then it is the set of all points z

Such that B translated by z, is contained in A

})(|{ ABzBA z

Digital Image Processing by K.Ratchadaporn

25

Example : Erosiond

d

x

y

2

y

2

y

2x

2x

Digital Image Processing by K.Ratchadaporn

26

Example : Erosion

Digital Image Processing by K.Ratchadaporn

27

Application : Erosion

(a) Image of squares of size 1,3,5,7,9 and 15 pixels on the side

(b) Erosion of (a) with a square structuring element of 1’s, 13 pixels on the side

(c) Dilation of (b) with a same structuring element

Digital Image Processing by K.Ratchadaporn

28

Erosion Complement

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

BABA cc ˆ)(

Digital Image Processing by K.Ratchadaporn

29

Proving

Starting with the definition of erosion

If set (B)z is contained in set A, then

thus

cz

c ABzBA })(|{)(

cz AB)(

BA

ABzABc

cz

c

ˆ

)(|)(

Digital Image Processing by K.Ratchadaporn

30

About Dilation & Erosion

Dilation expands an image.

Erosion shrinks an image.

Digital Image Processing by K.Ratchadaporn

31

Opening and Closing Opening generally smoothes the

contour of an object, breaks narrow isthmuses, and eliminates thin protrusions.

Closing also tends to smooth sections of contours but, as opposed to opening, it generally fuses narrow breaks and long thin gulfs, eliminates small holes, and fills gaps in the contour

Digital Image Processing by K.Ratchadaporn

32

Opening

The opening of set A by structuring element B is defined as

Thus, the opening A by B is the erosion of A by B, followed by a dilation of the result by B.

BBABA )(

Digital Image Processing by K.Ratchadaporn

33

OpeningBA

B

A

BA

Digital Image Processing by K.Ratchadaporn

34

Closing

The closing of set A by structuring element B is defined as

Thus, the opening A by B is the dilation of A by B, followed by a erosion of the result by B.

BBABA )(

Digital Image Processing by K.Ratchadaporn

35

ClosingBA

B

A

BA

Digital Image Processing by K.Ratchadaporn

36

Opening and Closing

Digital Image Processing by K.Ratchadaporn

37

Apply for Problem

Digital Image Processing by K.Ratchadaporn

38

HIS-or-MISS TranslationZYXA W

XY

XW

Z

cA XA

)( XWAc

)]([)( XWAXA c

Digital Image Processing by K.Ratchadaporn

39

HIS-or-MISS Translation If B denotes the set composed of X and its

background, The match (or set of matches) of B in A, denoted is

If B1=X and B2=(W-X)

By using the definition of set differences given

)]([)(* XWAXABA c

][)(* 21 BABABA c

]ˆ[)(* 21 BABABA

top related