Top Banner
1 What is mathematic morphology What is mathematic morphology ( ( 形形形 形形形 ) ) ? ? The mathematic way of analyzing geometri The mathematic way of analyzing geometri c shape and structure. c shape and structure. Its theory foundation is set algebra ( Its theory foundation is set algebra ( ). ). Can describe the geometric shape using s Can describe the geometric shape using s et theory. et theory. Chap 6 Morphological Chap 6 Morphological Processing Processing
44

Chap 6 Morphological Processing

Jan 01, 2016

Download

Documents

Chap 6 Morphological Processing. What is mathematic morphology ( 形态学 ) ? The mathematic way of analyzing geometric shape and structure. Its theory foundation is set algebra ( 代数 ) . Can describe the geometric shape using set theory. Chap 6 Morphological Processing. - 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: Chap 6 Morphological Processing

11

What is mathematic morphology What is mathematic morphology (( 形态学形态学 ))?? The mathematic way of analyzing geometric shaThe mathematic way of analyzing geometric sha

pe and structure.pe and structure.

Its theory foundation is set algebra (Its theory foundation is set algebra ( 代数代数 ).).

Can describe the geometric shape using set theoCan describe the geometric shape using set theory.ry.

Chap 6 Morphological Chap 6 Morphological ProcessingProcessing

Page 2: Chap 6 Morphological Processing

22

The origin and development:The origin and development: 六十年代六十年代

19641964 年,法国巴黎矿业学院,年,法国巴黎矿业学院, G. MatheronG. Matheron 和 和 J.J.SerraSerra ,铁矿的定量岩石分析,预测开采价值;,铁矿的定量岩石分析,预测开采价值;

19661966 年,年, G.Matheron, J.SerraG.Matheron, J.Serra 和和 Ph. FormenyPh. Formeny奠定了数学形态学;奠定了数学形态学;

19681968 年年 44 月,法国成立枫丹白露数学形态学研究中月,法国成立枫丹白露数学形态学研究中心;心;

Chap 6 Morphological Chap 6 Morphological ProcessingProcessing

Page 3: Chap 6 Morphological Processing

33

The origin and development:The origin and development: 七十年代七十年代

TASTAS (纹理分析系统)(纹理分析系统) ;;

大量专利大量专利 ;;

但仅面向用户和自然科学家;但仅面向用户和自然科学家;

Chap 6 Morphological Chap 6 Morphological ProcessingProcessing

Page 4: Chap 6 Morphological Processing

44

The origin and development:The origin and development: 八十年代,数学形态学广为人知八十年代,数学形态学广为人知

19821982 年,年, SerraSerra ,”,” Image Analysis and MatheImage Analysis and Mathematical Morphology”;matical Morphology”;

8484 年枫丹白露成立年枫丹白露成立 MorphoSystemMorphoSystem 指纹识别公司;指纹识别公司;

8686 年枫丹白露成立年枫丹白露成立 NoesisNoesis 图象处理公司;图象处理公司;

全球成立十几家数学形态学研究中心,进一步奠定全球成立十几家数学形态学研究中心,进一步奠定理论基础理论基础

19851985 年后,它逐渐成为分析图像几何特征的工具。年后,它逐渐成为分析图像几何特征的工具。

Chap 6 Morphological Chap 6 Morphological ProcessingProcessing

Page 5: Chap 6 Morphological Processing

55

The origin and development:The origin and development: 九十年代以后九十年代以后

现已应用在多门学科的数字图像分析和处理现已应用在多门学科的数字图像分析和处理的过程中,进行图象增强、分割、恢复、边缘检测、的过程中,进行图象增强、分割、恢复、边缘检测、纹理分析等,例如:纹理分析等,例如:

医学和生物学中应用数学形态学对细胞进行检测、医学和生物学中应用数学形态学对细胞进行检测、研究心脏的运动过程及对脊椎骨癌图像进行自动数研究心脏的运动过程及对脊椎骨癌图像进行自动数量描述;量描述;

在工业控制领域应用数学形态学进行食品平检验在工业控制领域应用数学形态学进行食品平检验(( 碎米碎米 )) 和电子线路特征分析;和电子线路特征分析;

在交通管制中监测汽车的运动情况等等。在交通管制中监测汽车的运动情况等等。 另外,数学形态学在金相学、指纹检测、经济地理、另外,数学形态学在金相学、指纹检测、经济地理、

合成音乐和断层合成音乐和断层 XX 光照像等领域也有良好的应用前光照像等领域也有良好的应用前景。景。

Page 6: Chap 6 Morphological Processing

66

Chap 6 Morphological Chap 6 Morphological ProcessingProcessing

The purpose of morphological processing:The purpose of morphological processing: used to extract image components that are usefuused to extract image components that are usefu

l in the representation and description of region l in the representation and description of region shape, such asshape, such as

boundaries extractionboundaries extraction

skeletonsskeletons

morphological filteringmorphological filtering

thinning (thinning ( 细化细化 ))

pruning (pruning ( 修剪修剪 ))

Page 7: Chap 6 Morphological Processing

77

Contents:Contents:

Basic symbols and termsBasic symbols and terms

Element and SetElement and Set

SubsetSubset

Hit and MissHit and Miss

Structuring elementStructuring element

Basic morphological operatorsBasic morphological operators

ErosionErosion

Other morphological operators and Other morphological operators and

applicationsapplications

Opening and Closing …………Opening and Closing …………

Chap 6 Morphological Chap 6 Morphological ProcessingProcessing

Foreground and BackgroundForeground and Background

Basic operators of setBasic operators of set

Translation and ReflectionTranslation and Reflection

DilationDilation

Page 8: Chap 6 Morphological Processing

88

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

Element and SetElement and Set

An image is called as a set.An image is called as a set.

For an image A, if pixel ‘a’ locates in the For an image A, if pixel ‘a’ locates in the

region of A, ‘a’ is called as the element of region of A, ‘a’ is called as the element of

A, written as,A, written as,

aaAA

Otherwise, written as,Otherwise, written as,

aaAA AA

aa

bb

Page 9: Chap 6 Morphological Processing

99

SubsetSubset For two images A and B, if each pixel of B locates For two images A and B, if each pixel of B locates

in the region of A, B is called as the subset of A, win the region of A, B is called as the subset of A, written as,ritten as,

BBA A

It is said that B is the subset of A, or B is inclued iIt is said that B is the subset of A, or B is inclued in A.n A.

When When BBAA and there exists at least a pixel ‘a’ and there exists at least a pixel ‘a’ of A, of A, aaA and aA and aBB, it is written as , it is written as BBAA

BBA is equal toA is equal to A ABB, and B, and BA is equal to A is equal to AABB

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

Page 10: Chap 6 Morphological Processing

1010

ZZ22 and Z and Z33

In mathematic morphology, the set In mathematic morphology, the set represents objects in an image. represents objects in an image.

As we known, there are two kinds of As we known, there are two kinds of image:image:

binary image binary image Z Z22

the element of the set is the the element of the set is the coordinatescoordinates (x,y) of pixel belong to the (x,y) of pixel belong to the objectobject

gray-scaled image gray-scaled image Z Z33

the element of the set is the the element of the set is the coordinatescoordinates (x,y) of pixel belong to the (x,y) of pixel belong to the object and the object and the gray levelsgray levels

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

Page 11: Chap 6 Morphological Processing

1111

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

Foreground and BackgroundForeground and Background

For a binary image, generally, For a binary image, generally,

let the set ‘A’, which includes all pixels let the set ‘A’, which includes all pixels

that have value ‘1’ in the image, that have value ‘1’ in the image,

represents the object, also called as represents the object, also called as

foreground.foreground.

Contrarily, the set ‘B’, which includes all Contrarily, the set ‘B’, which includes all

pixels that have value ‘0’ in the image, pixels that have value ‘0’ in the image,

represents the background.represents the background.

In other words, the set ‘A’ corresponds to In other words, the set ‘A’ corresponds to

the binary image.the binary image.

Page 12: Chap 6 Morphological Processing

1212

Basic operators of setBasic operators of set

BB

AA

the union the union

(( 并并 ) of A ) of A

and Band B

A∪BA∪B

the intersection the intersection

( ( 交交 ) ) of A and of A and

BB

AA∩∩BB

the the

complement complement

(( 补补 ) of A) of A

AACC

the difference the difference

(( 差差 ) between A ) between A

and Band B

AA--BBConsider: Consider:

A-B ?=B-AA-B ?=B-A

Page 13: Chap 6 Morphological Processing

1313

TranslationTranslation

Let A is an image, b is a point, then the Let A is an image, b is a point, then the

translation of A by b can be defined as,translation of A by b can be defined as,

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

A b a b a A

44

33

22

11

0 1 2 3 40 1 2 3 4

44

33

22

11

0 1 2 3 40 1 2 3 4

Image A Point Image A Point

bb

44

33

22

11

0 1 2 3 40 1 2 3 4

A[b] or A[b] or

A[1,1]A[1,1]

Page 14: Chap 6 Morphological Processing

1414

ReflectionReflection

The reflection of set A is defined as,The reflection of set A is defined as,

AAvv={a|-a={a|-aA}A}

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

44

33

22

11

0 1 2 3 40 1 2 3 4

Image AImage A

-1-1

-2-2

-3-3

-4-4

-4 -3 -2 -1 0-4 -3 -2 -1 0

AAvv

See ‘imreflection.See ‘imreflection.m’m’

Page 15: Chap 6 Morphological Processing

1515

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

ReflectionReflection

See ‘imreflection.m’See ‘imreflection.m’

hh

wwhh

’’

w’w’

(imh,imw)(imh,imw)

1 0

0 1

1 1 1 1 1

h imh h

w imw w

h h imh

w w imw

Page 16: Chap 6 Morphological Processing

1616

Hit (Hit ( 击中击中 ) and Miss) and Miss

For image A and B,For image A and B,

If If AABB, it is called as , it is called as ‘B hit A’‘B hit A’, written as,, written as,

BBAA

Otherwise, it is called as Otherwise, it is called as ‘B miss A’‘B miss A’..

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

B hit AB hit A

AA

BB

B miss AB miss A

AA

BB

Page 17: Chap 6 Morphological Processing

1717

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

Structuring Element Structuring Element For an image, in order to find its structure, it is nFor an image, in order to find its structure, it is n

ecessary to observe the relationship between eaecessary to observe the relationship between each part of the image. Finally, a set of this relationch part of the image. Finally, a set of this relationship is obtained.ship is obtained.

When we observe the image, a kind of probe (When we observe the image, a kind of probe ( 探探针针 ), called as ‘structuring element’, is shifted i), called as ‘structuring element’, is shifted in the image. n the image.

Generally, Generally, the size of structuring element is smalthe size of structuring element is smaller than that of image.ler than that of image.

Page 18: Chap 6 Morphological Processing

1818

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

Structuring Element Structuring Element

Let structuring element S locates at Let structuring element S locates at

position x. There are three kinds of position x. There are three kinds of

relationship between image X and S[x].relationship between image X and S[x].

S[xS[x11] is included in X: ] is included in X: S[xS[x11]]XX

S[xS[x22] hits X: ] hits X: S[xS[x22]]XX

S[xS[x33] misses X: ] misses X: S[xS[x33]]X=X= S[x]S[x] 与与 XX 相关最相关最大大

S[x]S[x] 与与 XX 部分相部分相关关

S[x]S[x] 与与 XX 不相关不相关

S[xS[x11]] S[xS[x33]]

S[xS[x22]]

Page 19: Chap 6 Morphological Processing

1919

6.1 Basic Symbols and Terms6.1 Basic Symbols and Terms

5 basic structuring elements5 basic structuring elements

Page 20: Chap 6 Morphological Processing

2020

6.2.1 Erosion6.2.1 Erosion

The points set, which satisfies The points set, which satisfies

formulaformula

S[x]S[x]X, xX, xXX

is called as the erosion of S to X, is called as the erosion of S to X,

written as,written as,

XXSS

Also, defined as,Also, defined as,

XXS={x|S[x]S={x|S[x]X}X}

Page 21: Chap 6 Morphological Processing

2121

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

XXSS

6.2.1 Erosion6.2.1 Erosion

For example,For example,

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

XX

SS

Page 22: Chap 6 Morphological Processing

2222

6.2.1 Erosion6.2.1 Erosion

Consider,Consider,

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

XX

SS

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

XXSS

Page 23: Chap 6 Morphological Processing

2323

6.2.1 Erosion6.2.1 Erosion

See ‘imageerode.m’See ‘imageerode.m’

Note, for an image X, with different S or samNote, for an image X, with different S or same S and different origin of S, the result of eroe S and different origin of S, the result of erosion is different.sion is different.

Page 24: Chap 6 Morphological Processing

2424

6.2.1 Erosion6.2.1 Erosion

Application: obtaining boundaryApplication: obtaining boundary

See ‘extractedge_erose.m’See ‘extractedge_erose.m’

XXSS

OriginOrigin

A=XA=XSS X-AX-A

Page 25: Chap 6 Morphological Processing

2525

6.2.1 Erosion6.2.1 Erosion

Application:Application:

Eliminating the objects, whose size are smaller tEliminating the objects, whose size are smaller than that of structuring element.han that of structuring element.

See ‘denoise_erose.m’See ‘denoise_erose.m’

Review:Review:

Other ways to denoiseOther ways to denoise

See chapter 3 and chapter 4, enhancement, smoSee chapter 3 and chapter 4, enhancement, smoothingothing

Page 26: Chap 6 Morphological Processing

2626

6.2.1 Erosion6.2.1 Erosion

Application:Application:

Separating the objects, between which there exiSeparating the objects, between which there exist smaller connected region.st smaller connected region.

See ‘separateobject_erose.m’See ‘separateobject_erose.m’

Page 27: Chap 6 Morphological Processing

2727

6.2.1 Erosion6.2.1 Erosion

Problem:Problem:

Size of objects after erosion is reducedSize of objects after erosion is reduced

How to eliminate the holes inside the How to eliminate the holes inside the

objectsobjects

Page 28: Chap 6 Morphological Processing

2828

6.2.2 Dilation6.2.2 Dilation

Expanding each point x in X to S[x], Expanding each point x in X to S[x],

written as,written as,

XXSS

defined as,defined as,

XXS={x|S[x]S={x|S[x]xx}}

XXS=S={X[s]|s{X[s]|sS}S}

XXS=S={S[x]|x{S[x]|xX}X}

Page 29: Chap 6 Morphological Processing

2929

XXS=S={X[s]|s{X[s]|sS}S}

S: sS: s11(0,0), s(0,0), s22(0,1), s(0,1), s33(1,0)(1,0)

X[s]={x+s|xX[s]={x+s|xX} X} (translation)(translation)

XXS=X[sS=X[s11]]X[sX[s22]]X[sX[s33]]

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

XX

SS

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

X[sX[s11

]]55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

X[sX[s22

]]

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

X[sX[s33

]]

55

44

33

22

11

0 1 2 3 4 50 1 2 3 4 5

XXSS

Page 30: Chap 6 Morphological Processing

3030

6.2.2 Dilation6.2.2 Dilation

See ‘See ‘dilation.mdilation.m’’

Note, for an image X, with different S or samNote, for an image X, with different S or same S and different origin of S, the result of dile S and different origin of S, the result of dilation is different.ation is different.

Page 31: Chap 6 Morphological Processing

3131

6.3.1 Opening (6.3.1 Opening ( 开运算开运算 )) For image X and structuring element S, ‘opening’ For image X and structuring element S, ‘opening’

is denoted as,is denoted as,

XX○S○S

defined as,defined as,

X○S=(XX○S=(XS)S)SS

X○S=X○S={S[x]|S[x]{S[x]|S[x]X}X}

namely, restoring the eroded image using dilation onamely, restoring the eroded image using dilation operation. But the restored image is not equal to the peration. But the restored image is not equal to the original image.original image.

See ‘imageopening.m’See ‘imageopening.m’

Page 32: Chap 6 Morphological Processing

3232

6.3.1 Opening6.3.1 Opening

Application: smoothingApplication: smoothing

detecting accessory (detecting accessory ( 零件零件 ) using opening o) using opening operatonperaton

See ‘smoothing_opening.m’See ‘smoothing_opening.m’

Page 33: Chap 6 Morphological Processing

3333

6.3.1 Opening6.3.1 Opening

Application:Application:

Page 34: Chap 6 Morphological Processing

3434

6.3.2 Closing (6.3.2 Closing ( 闭运算闭运算 )) For image X and structuring element S, ‘closing’ iFor image X and structuring element S, ‘closing’ i

s denoted as,s denoted as,

XX●●SS

defined as, defined as, XX●●S=(XS=(XS)S)SS

namely, restoring the dilated image using erosion namely, restoring the dilated image using erosion operation. operation.

same as opening, the restored image is not equal to same as opening, the restored image is not equal to the original imagethe original image

Note, the result of opening and closing is different.Note, the result of opening and closing is different.See ‘imageclosing.m’See ‘imageclosing.m’

Page 35: Chap 6 Morphological Processing

3535

6.3.2 Closing6.3.2 Closing

Application:Application:

connect two adjacent objectsconnect two adjacent objects

See ‘connect_closing.m’See ‘connect_closing.m’

Page 36: Chap 6 Morphological Processing

3636

6.3.2 Closing (6.3.2 Closing ( 闭运算闭运算 ))

Application:Application:

Page 37: Chap 6 Morphological Processing

3737

6.3 Opening and Closing6.3 Opening and Closing

Application of opening and closingApplication of opening and closing

See ‘findboundary.m’See ‘findboundary.m’

Page 38: Chap 6 Morphological Processing

3838

Page 39: Chap 6 Morphological Processing

3939

Page 40: Chap 6 Morphological Processing

4040

6.3.3 Hit-or-Miss 6.3.3 Hit-or-Miss TransformationTransformation

For image X and structuring element S,For image X and structuring element S,

Let S consists of SLet S consists of S11 and S and S22

S= SS= S11SS22 SS11SS22==

X hit by S is defined as,X hit by S is defined as,

XXS=(XS=(XSS11))(X(XCCSS22))

=(X=(XSS11))(X(XSS22vv))CC

=(X=(XSS11)-(X)-(XSS22VV))

using hit-or-miss transformation, we can using hit-or-miss transformation, we can

exactly locate S in X.exactly locate S in X.

reflectioreflectio

nn

Page 41: Chap 6 Morphological Processing

4141

6.4 Region Filling6.4 Region Filling

Page 42: Chap 6 Morphological Processing

4242

6.4 Region Filling6.4 Region Filling

Page 43: Chap 6 Morphological Processing

4343

Page 44: Chap 6 Morphological Processing

4444