Top Banner
Morphological Image Processing Spring 2006, Jen-Chang Liu
46

Morphological Image Processing Spring 2006, Jen-Chang Liu.

Dec 20, 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: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Morphological Image Processing

Spring 2006, Jen-Chang Liu

Page 2: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Preview Morphology 形態學

About the form and structure of animals and plants

Mathematical morphology Using set theory Extract image component Representation and description of region shap

e

Page 3: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Preview (cont.) Sets in mathematical morphology

represent objects in an image

Example Binary image: the elements of a set is the

coordinate (x,y) of the pixels, in Z2

Gray-level image: the element of a set is the triple, (x, y, gray-value), in Z3

Page 4: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Outline

Preliminaries – set theory Dilation and erosion Opening and closing Hit-or-miss transformation Some basic morphological

algorithms Extensions to gray-scale images

Binaryimages

Page 5: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Preliminaries – set theory A be a set in Z2.

a = (a1, a2) is an element of A.

a is not an element of A

Null (empty) set:

Aa

Aa

Page 6: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Set theory (cont.) Explicit expression of a set

Example:

naaaA ,...,, 21

elementsset for condition elementA

DddwwC for ,

1

2

Page 7: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Set operations A is a subset of B: every element of A is an elemen

t of another set B

Union 聯集

Intersection 交集

Mutually exclusive

BA

BAC

BAC

BA

Page 8: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Graphical examples

Page 9: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Graphical examples (cont.)

AwwAc BwAwwBA ,

Page 10: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Logic operations on binary images

Functionally complete operations AND, OR, NOT

Page 11: Morphological Image Processing Spring 2006, Jen-Chang Liu.

BA

BA

AB

Page 12: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Special set operationsfor morphology

translation

AazaccA z for ,)(

reflection

BbbwwB for ,ˆ

Page 13: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Outline Preliminaries Dilation( 擴張 ) and erosion( 侵蝕 ) Opening and closing Hit-or-miss transformation Some basic morphological algorithms Extensions to gray-scale images

Page 14: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Dilation ( 擴張 ) )ˆ( ABzBA z B:structuring

element

Page 15: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Dilation: another formulation

AABzBA z )ˆ(

Page 16: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Application of dilation: bridging gaps in images

Structuringelement

max. gap=2 pixels

Effects: increase size, fill gap

Page 17: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Erosion 侵蝕 ABzBA z )(

z: displacement

B:structuring element

Page 18: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Erosion (cont.)

Page 19: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Application of erosion: eliminate irrelevant detail

original image

Squares of size1,3,5,7,9,15 pels

erosion

Erode with13x13 square

dilation

Page 20: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Dilation and erosion are duals

czc ABzBA )( ) (

ccz ABz )(

)( cz ABz

)ˆ( ABzBA z

BAc ˆ

Page 21: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Application: Boundary extraction

Extract boundary of a set A: First erode A (make A smaller) A – erode(A)

) ( BAA =

Page 22: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Application: boundary extraction

Using 5x5 structuring elementoriginal image

Page 23: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Outline Preliminaries Dilation and erosion Opening and closing Hit-or-miss transformation Some basic morphological algorithms Extensions to gray-scale images

Page 24: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Opening Dilation: expands image w.r.t

structuring elements Erosion: shrink image erosion+dilation = original image ? Opening= erosion + dilation

BBABA ) (

Page 25: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Opening (cont.)

Page 26: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Opening (cont.)

Smooth the contour of an image, breaks narrow isthmuses, eliminates thin protrusions

消去小凸起切除窄接線

Find contour Fill in contour

Page 27: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Closing Dilation+erosion = erosion + dilation ? Closing = dilation + erosion

BBABA )(

Page 28: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Closing (cont.)

Find contour Fill in contour

Smooth the object contour, fuse narrow breaks and longthin gulfs, eliminate small holes, and fill in gaps

連接小斷點,消除小空洞,填補空隙

Page 29: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Properties of opening and closing

Opening

Closing

ABA of (subimage)subset a is (i) BDBCC ofsubset a is then D,ofsubset a is If (ii)

BABBA )( (iii)

BAA of (subimage)subset a is (i)

BDBCC ofsubset a is then D,ofsubset a is If (ii)BABBA )( (iii)

Open 後變小

close 後變大

重複做 open 等於做一次 open

重複做 close 等於做一次 close

Page 30: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Noisyimage

openingRemoveouternoise

Removeinnernoise

closing

Page 31: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Outline Preliminaries Dilation and erosion Opening and closing Hit-or-miss transformation Some basic morphological algorithms Extensions to gray-scale images

Page 32: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Hit-or-miss transformation Find the location of certain shape

erosion

Find the set of pixels thatcontain shape X

如何只找到相符形狀中心點?

X

Page 33: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Hit-or-miss transformation

Erosionwith (W-X)

Detect object via background

Page 34: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Hit-or-miss transformation Eliminate un-necessary parts

AND

Page 35: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Outline Preliminaries Dilation and erosion Opening and closing Hit-or-miss transformation Some basic morphological algorithms Extensions to gray-scale images

Page 36: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Basic morphological algorithms

Extract image components that are useful in the representation and description of shape

Boundary extraction Region filling Extract of connected components Convex hull Thinning Thickening Skeleton Pruning

Page 37: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Region filling How? Idea: place a point inside the region,

then dilate that point iteratively

,...3,2,1,)( 1 kABXX ckk

pX 0

Until 1 kk XX

Bound the growth

Page 38: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Region filling (cont.)

stop

Page 39: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Application: region filling

Original image

The first filledregion

Fill all regions

Page 40: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Extraction of connected components

找到連通部分 Idea: start from a point in t

he connected component, and dilate it iteratively

,...3,2,1 ,)( 1 kABXX kk

pX 0

Until 1 kk XX

Page 41: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Extraction of connected components (cont.)

Page 42: Morphological Image Processing Spring 2006, Jen-Chang Liu.

original

雞肉

thresholding

erosion

去除小雜訊

Page 43: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Skeletons 骨架

Set A Maximum disk

1. The largest disk Centered at a pixel2. Touch the boundaryof A at two or more places

Recall: Balls of erosion!

How to define a Skeletons?

Page 44: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Skeleton Idea: 不斷的 erosion

Erosion k 次直到空集合

Page 45: Morphological Image Processing Spring 2006, Jen-Chang Liu.
Page 46: Morphological Image Processing Spring 2006, Jen-Chang Liu.

Problem The scanned image is not adjusted well

How to detection the direction of lines? How to rotate?