Top Banner
ECE533 Digital Image Processing Morphological Image Processing
27

1 ECE533 Digital Image Processing Morphological Image Processing.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 ECE533 Digital Image Processing Morphological Image Processing.

1ECE533 Digital Image Processing

Morphological Image Processing

Page 2: 1 ECE533 Digital Image Processing Morphological Image Processing.

2ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Morphology

Morphology» The branch of biology that deals with the

form and structure of organisms without consideration of function

Mathematical Morphology» Mathematical tool for processing shapes in

image, including boundaries, skeletons, convex hulls, etc.

» Use of set theoretical approach

Page 3: 1 ECE533 Digital Image Processing Morphological Image Processing.

3ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Set Theory: Definitions and Notations

SET ()» A collection of objects

(elements) membership ()

» If is an element (member) of a set , we write

Subset ()» Let A, B are two sets. If for

every a A, we also have a B, then the set A is a subset of B, that is, A B

» If A B and B A, then A = B.

Empty set ()

Complement set» If A , then its

complement set Ac = {| , and A}

Union ()» A B = {| A or B}

Intersection ()» A B = {| A and B}

Set difference (-)» B\A = B Ac

» Note that B-A A-B Disjoint sets

» A and B are disjoint (mutually exclusive) if A B=

Page 4: 1 ECE533 Digital Image Processing Morphological Image Processing.

4ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Set Relations

Page 5: 1 ECE533 Digital Image Processing Morphological Image Processing.

5ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Translation and Reflection

Translation (A)z = { c| c = a + z, for a A }

Reflection: BbbwwB for ,|ˆ

Page 6: 1 ECE533 Digital Image Processing Morphological Image Processing.

6ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Logic Operations Between Binary Images

Page 7: 1 ECE533 Digital Image Processing Morphological Image Processing.

7ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Dilation and Erosion

DilationB: structure element

ErosionA B = {z | (B)z A}

Relations(A B)c =

AABz

ABzBA

z

z

ˆ|

ˆ|

ˆcA B

Page 8: 1 ECE533 Digital Image Processing Morphological Image Processing.

8ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Example of Dilation

Page 9: 1 ECE533 Digital Image Processing Morphological Image Processing.

9ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Example of Erosion

Page 10: 1 ECE533 Digital Image Processing Morphological Image Processing.

10ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Opening

A B = (A B) B

Page 11: 1 ECE533 Digital Image Processing Morphological Image Processing.

11ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Closing

A B = (A B) B

Page 12: 1 ECE533 Digital Image Processing Morphological Image Processing.

12ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Example: Opening & Closing

Page 13: 1 ECE533 Digital Image Processing Morphological Image Processing.

13ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Finger Print Processing using Opening and Closing

Page 14: 1 ECE533 Digital Image Processing Morphological Image Processing.

14ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Hit-or-Miss Transformation for shape detection

Figure 9.12 (a) Set A, (b) A window W and the localBackground of X w.r.t. W, W-X. (c) Ac. (d) AX

Intersection of (d) and (e) shows the locationof the origin of X, as desired.

(d)

(e)

A

Page 15: 1 ECE533 Digital Image Processing Morphological Image Processing.

15ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Hit-or-Miss Transform

Denote B1: object, B2: local background of B1, then,

or

Reason to have a local background:» Two or more objects are distinct only if they form

disjoint (disconnected) sets. This is guaranteed by requiring that each object have at least a one-pixel-thick background around it.

Page 16: 1 ECE533 Digital Image Processing Morphological Image Processing.

16ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Hit-or-Miss Transform

Previous example does not contain don’t care entries.

In structure element» 1 – foreground» 0 – background» X – don’t care

Output is 1 if exact match of both foreground and background pixels.

Hitnmiss.m» +1: foreground» -1: background» 0: don’t care

Hitnmiss.m

match not :

match :

111

010

111

111

111

111

*.

111

010

111

111

010

111

111

111

111

*.

111

010

111

Page 17: 1 ECE533 Digital Image Processing Morphological Image Processing.

17ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Morphological Boundary Extraction

(A) = A − (A B) (9.5-1)

Page 18: 1 ECE533 Digital Image Processing Morphological Image Processing.

18ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Example of Boundary Extraction

Page 19: 1 ECE533 Digital Image Processing Morphological Image Processing.

19ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Region Filling

AXY

k

ABXX

k

ckk

,3,2,1

;1

Fig915.m

Page 20: 1 ECE533 Digital Image Processing Morphological Image Processing.

20ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Region Filling Example

Page 21: 1 ECE533 Digital Image Processing Morphological Image Processing.

21ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Connected Component Extraction

Y: connected component in set A,

p: a known point in Y

k

kk

kk

XY

XX

ABXX

pX

then

if 1

1

0

Fig915.m

Page 22: 1 ECE533 Digital Image Processing Morphological Image Processing.

22ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Thinning

Thinning is often accomplished using a sequence of rotated structuring elements (a). Given a set A (b), results of thinning with first element is shown in (c), and the next 7 elements (d) – (i). There is no change between 7th and 8th elements, and no change after first 3 elements. Then it converges to a m-connectivity.

n

n

BBBABA

BBBB

BAhitnmissABA

21

21 ,,

,

Fig921.m

Page 23: 1 ECE533 Digital Image Processing Morphological Image Processing.

23ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Thickening

AB = A hitnmiss(A,B)A{B} =((…(AB1) B2) … Bn)

Thickening is the dual of thinning operation. Usually, thickening a set A is accomplished by thinning Ac, and then complement the result. Then a post-processing prunning process is applied to remove disconnected points as shown to the left.

Page 24: 1 ECE533 Digital Image Processing Morphological Image Processing.

24ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Skeleton

A skeleton of a set A consists of points z that is the center of a maximum diskA maximum disk is a circle in A that can not be enclosed by another circle that is also in A. Figure 9.23. (a) set A, (b), (c) sets of possible maximum disks. (d) dotted line is the skeleton.

Page 25: 1 ECE533 Digital Image Processing Morphological Image Processing.

25ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Skeleton Equations

1

0

( ) ( ) (9.5-11)

( ( ) ) (9.5-15)

K

kk

K

kk

S A S A

A S A kB

Define k consecutive erosions of A as:AkB = ( …(AB)B) …)B) (9.5-13)

Sk(A) = (AkB) − (AkB)B (9.5-12)

Let K = max{k | (AkB) } (9.5-14)

Then the skeleton can be found as:

Page 26: 1 ECE533 Digital Image Processing Morphological Image Processing.

26ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Illustration of Skeleton Computation

Figure 9.24 Implementation of eq. (9.5-11)-(9.5-15). The original set is at the top left and its morphological skeleton is at the bottom of the 4th column. The reconstructed set is at the bottom of the 6th column.

Define k consecutive erosions of A as:AkB = ( …(AB)B) …)B) (9.5-13)Sk(A) = (AkB) − (AkB)B (9.5-12)Let K = max{k | (AkB) } (9.5-14)Then the skeleton can be found as:

1

0

( ) ( ) (9.5-11)

( ( ) ) (9.5-15)

K

kk

K

kk

S A S A

A S A kB

Page 27: 1 ECE533 Digital Image Processing Morphological Image Processing.

27ECE533 Digital Image Processing(c) 2003-2006 by Yu Hen Hu

Pruning