Top Banner
Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007
62

Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Dec 31, 2015

Download

Documents

aquila-mccarthy

Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007. What are Morphological Operations?. Morphological operations come from the word “morphing” in Biology which means “ changing a shape ”. Morphing. Image morphological operations are used to manipulate - PowerPoint PPT Presentation
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: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Digital Image ProcessingChapter 9:

Morphological Image Processing

5 September 2007

Digital Image ProcessingChapter 9:

Morphological Image Processing

5 September 2007

Page 2: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

What are Morphological Operations? What are Morphological Operations?

Morphological operations come from the word “morphing”in Biology which means “changing a shape”.

Morphing

Image morphological operations are used to manipulateobject shapes such as thinning, thickening, and filling.

Binary morphological operations are derived fromset operations.

Page 3: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Basic Set Operations Basic Set Operations

Concept of a set in binary image morphology: Each set may represent one object. Each pixel (x,y) has its status: belong to a set or not belong to a set.

Page 4: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Translation and Reflection Operations Translation and Reflection Operations

A

(A)z

z = (z1,z2)

Translation Reflection

B

BbbwwB for ,ˆ AazaccA z for ,

Page 5: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Logical Operations* Logical Operations*

*For binary images only

Page 6: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Dilation Operations Dilation Operations

ABzBA zˆ

= Empty set

A = Object to be dilatedB = Structuring element

Dilate means “extend”

Page 7: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Dilation Operations (cont.) Dilation Operations (cont.)

StructuringElement (B)

Original image (A)

B̂Reflection

Intersect pixel Center pixel

Page 8: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Dilation Operations (cont.) Dilation Operations (cont.)

Result of Dilation Boundary of the “center pixels”where intersects A zB̂

Page 9: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example: Application of DilationExample: Application of Dilation

“Repair” broken characters

Page 10: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Erosion Operation Erosion Operation

ABzBA z

A = Object to be erodedB = Structuring element

Erosion means “trim”

Page 11: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Erosion Operations (cont.) Erosion Operations (cont.)

StructuringElement (B)

Original image (A) Intersect pixel Center pixel

Page 12: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Erosion Operations (cont.) Erosion Operations (cont.)

Result of Erosion Boundary of the “center pixels”where B is inside A

Page 13: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example: Application of Dilation and ErosionExample: Application of Dilation and Erosion

Remove small objects such as noise

Page 14: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Duality Between Dilation and ErosionDuality Between Dilation and Erosion

BABA cc ˆ) (

Proof:

where c = complement

BA

ABz

ABz

ABzBA

c

cz

ccz

c

zc

ˆ

) (

Page 15: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Opening Operation Opening Operation

BBABA ) (

ABBBA zz or

= Combination of all parts of A that can completely contain B

Opening eliminates narrow and small details and corners.

Page 16: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example of Opening Example of Opening

Page 17: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Closing Operation Closing Operation

BBBA )A(

Closing fills narrow gaps and notches

Page 18: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example of Closing Example of Closing

Page 19: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Duality Between Opening and ClosingDuality Between Opening and Closing

BABA cc ˆ

Properties OpeningProperties Opening

BABBA

BDBCDC

ABA

.3

then If 2.

.1

BABBA

BDBCDC

BAA

.3

then If 2.

.1Properties ClosingProperties Closing

Idem potent property: can’t change any more

Page 20: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Example: Application of Morphological OperationsExample: Application of Morphological Operations

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Finger print enhancement

Page 21: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Hit-or-Miss Transformation Hit-or-Miss Transformation

)( XWAXAXA c *

where X = shape to be detected W = window that can contain X

Page 22: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Hit-or-Miss Transformation (cont.) Hit-or-Miss Transformation (cont.)

)( XWABABA c *

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Page 23: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Boundary Extraction Boundary Extraction

BAAβ(A)

Original image

Boundary

Page 24: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Region Filling Region Filling

ckk ABXX 1

Original image

Results of region filling

where X0 = seed pixel p

Page 25: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Extraction of Connected Components Extraction of Connected Components

ABXX kk 1 where X0 = seed pixel p

Page 26: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Example: Extraction of Connected Components Example: Extraction of Connected Components

X-ray imageof bones

Thresholdedimage

Connectedcomponents

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Page 27: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Convex Hull Convex Hull

i

i

DAC

4

1

)(

4,3,2,1 , 1 iABXX ik

ik *

iconv

i XD

Convex hull has no concave part.

Convex hull

Algorithm: where

Page 28: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Example: Convex Hull Example: Convex Hull

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Page 29: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Thinning Thinning

cBAA

BAABA

) (

) (

*

*

))...))((...(( 21 nBBBABA

Page 30: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Example: Thinning Example: Thinning

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Make an object thinner.

Page 31: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Thickening Thickening

* ) ( BAABA . ) )...) ) ((...(( 21 nBBBABA . . . .

Make an object thicker

*

Page 32: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Skeletons Skeletons

Dot lines are skeletons of thisstructure

Page 33: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Skeletons (cont.) Skeletons (cont.)

)()(0

ASAS k

K

k

with

where ...) ) ) (...( ( BBBAkB)A

BkB)AkB)AASk ( ()(

k times

and kBAkK max

Page 34: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Skeletons Skeletons

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Page 35: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Pruning Pruning

BAX 1

AHXX )( 23

) ( 1

8

12

k

k

BXX

*

314 XXX

= thinning

= finding end points

= dilation at end points

= Pruned result

Page 36: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Example: Pruning Example: Pruning

Original image

Pruned result

After Thinning3 times

End points

Dilationof end points

Page 37: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Tables from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Summary of Binary Morphological Operations Summary of Binary Morphological Operations

Page 38: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Summary of Binary Morphological Operations (cont.) Summary of Binary Morphological Operations (cont.)

(Tables from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Page 39: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Summary of Binary Morphological Operations (cont.) Summary of Binary Morphological Operations (cont.)

(Tables from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Page 40: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Summary of Binary Morphological Operations (cont.) Summary of Binary Morphological Operations (cont.)

(Tables from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Page 41: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Basic Types of Structuring ElementsBasic Types of Structuring Elements

x = don’t care

Page 42: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Gray-Scale Dilation Gray-Scale Dilation

bf DyxDytxsyxbytxsfbf ),(;)(),(|),(),(max

bf DxDxsxbxsfbf and )(|)()(max2-D Case

1-D Case

Page 43: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

SubimageOriginal image

Moving window

Max

Output image

Gray-Scale Dilation (cont.) Gray-Scale Dilation (cont.)

+

Reflectionof B

Structuring element B

Note: B can be any shape and subimage must have the same shape as reflection of B.

Page 44: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Gray-Scale ErosionGray-Scale Erosion

bf DyxDytxsyxbytxsfbf ),(;)(),(|),(),(min2-D Case

1-D Case bf DxDxsxbxsfbf and )(|)()(min

Page 45: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

SubimageOriginal image

Moving window

Min

Output image

Gray-Scale Erosion (cont.) Gray-Scale Erosion (cont.)

-

B

Structuring element B

Note: B can be any shape and subimage must have the same shape as B.

Page 46: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example: Gray-Scale Dilation and ErosionExample: Gray-Scale Dilation and ErosionOriginal image After dilation

After erosion

Darker Brighter

Page 47: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Gray-Scale OpeningGray-Scale Opening

bbfbf )(

Opening cuts peaks

Page 48: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Gray-Scale ClosingGray-Scale Closing

bbfbf )(

Closing fills valleys

Page 49: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example: Gray-Scale Opening and ClosingExample: Gray-Scale Opening and Closing

Original image After closingAfter opening

Reduce whiteobjects

Reduce darkobjects

Page 50: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Gray-scale Morphological Smoothing Gray-scale Morphological Smoothing

Smoothing: Perform opening followed by closing

Original image After smoothing

Page 51: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Morphological Gradient Morphological Gradient

Original image Morphological Gradient

)()( bfbfg

Page 52: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Top-Hat Transformation Top-Hat Transformation

Original image Results of top-hat transform

)( bffh

Page 53: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example: Texture Segmentation Application Example: Texture Segmentation Application

Algorithm:1. Perform closing on the image by using successively larger structuring elements until small blobs are vanished.2. Perform opening to join large blobs together3. Perform intensity thresholding

Original image Segmented result

Small blob

Large blob

Page 54: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Example: Granulometry Example: Granulometry Objective: to count the number of particles of each sizeMethod: 1. Perform opening using structuring elements of increasing size2. Compute the difference between the original image and the result after each opening operation3. The differenced image obtained in Step 2 are normalized and used to construct the size-distribution graph.

Original imageSize distribution

graph

Page 55: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Morphological Watershads Morphological Watershads

Page 56: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Morphological Watershads Morphological Watershads

Page 57: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Morphological Watershads Morphological Watershads

Page 58: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

Surface of P

at edges looklike mountain ridges.

P

Originalimage

P

Gradient ImageGradient Image

Page 59: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Morphological Watershads Morphological Watershads

Page 60: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Morphological Watershads Morphological Watershads

Page 61: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Morphological Watershads Morphological Watershads

Page 62: Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

Convex Hull Convex Hull