• Used to extract image components that are useful...

Preview:

Citation preview

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Used to extract image components that are useful in the representation and description of region shape, such as – boundaries extraction– skeletons– convex hull– morphological filtering– thinning– pruning

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Sets in mathematic morphology represent objects in an image:– binary image (0 = white, 1 = black) : the element

of the set is the coordinates (x,y) of pixel belong to the object Z2

– gray-scaled image : the element of the set is the coordinates (x,y) of pixel belong to the object and the gray levels Z3

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Preliminary:• A: A set in Z2 with elements of a=(a1,a2)

{ }{ },

c

c

a Aa AA BC A BD A BA B

A w w A

A B w w A w B A B

• ∈• ∉• ⊆• =• =• =∅

• = ∉

• − = ∈ ∉ =

∪∪

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Operators by examples:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Preliminary:• A: A set in Z2 with elements of a=(a1,a2)

{ }( ) { }ˆ , for , Reflection

, for , Translationz

B w w b b B

A c c a z a A

• ∈ = − ∈

• ∈ = + ∈

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Reflection and Translation by examples:– Need for a reference point.

Reference point

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Basic Logic Operations:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Examples

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Two Fundamental Morphological Operators:– Dilation:

• Set B: A structural elements.• Relation to Convolution mask:

– Flipping– Overlapping

• Other names: Grow, Expand

( ){ } ( ){ }ˆ ˆz z

A B z B A z B A A⊕ = ≠ ∅ = ⊆∩ ∩

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Dilation by example:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Dilation by example:– B: a 3×3 mask.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Application:– Gap filling

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Two Fundamental Morphological Operators:– Erosion:

• Set B: A structural elements.• Other banes: Shrink, Reduce

( ){ }zA B z B A= ⊆

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

( ){ }zA B z B A= ⊆

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Erosion by example:– B: a 3×3 mask.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Erosion by example:

11 pixels (Diameter)

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Dilation-Erosion Duality:

( ) ( ){ } ( ){ }( ){ }

( ){ }ˆ

ˆRemember:

ccc cz z

c cz

z

A B z B A z B A

z B A A B

A B z B A

= ⊆ = =∅

= ≠ ∅ = ⊕

⊕ = ≠ ∅

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Erosion Application:– Remove details

1,3,5,7,9, and 15 Erode with 13 Dilate with 13

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening and Closing:– Dilation expands and Erosion shrinks.– Opening:

• Smooth contour• Break narrow isthmuses (Means: تنگه(• Remove thin protrusion

– Closing:• Smooth contour• Fuse narrow breaks, and long thin gulfs.• Remove small holes, and fill gaps.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening and Closing:– Dilation expands and Erosion shrinks.– Opening:

• A erosion followed by a dilation using the same structuring element for both operations.

– Closing:• A Dilation followed by a erosion using the same

structuring element for both operations.

( ) ( ) ( ){ }z zA B A B B B B A= Θ ⊕ = ⊆∪

( )A B A B B= ⊕ Θ

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening Illustration:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening Illustration:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Closing Illustration:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Closing Illustration:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening and Closing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Medical Application:

Original Segmentation

Opening 5×5

Closing 5×5

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening and Closing Duality:

• Opening Properties:– A○B is a subset (subimage) of A– If C is a subset of D, then C○B is a subset of D○B– (A○B)○B = A○B ↔ Multiple apply has no effect.

• Closing Properties:– A is a subset (subimage) of A•B– If C is a subset of D, then C•B is a subset of D•B– (A•B)•B = A•B ↔ Multiple apply has no effect.

( ) ( )ˆc cA B A B• =

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Opening

Dilation of Opening Closing of Opening

• NoiseReduction

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Hit-or-Miss– Shape Detection– X-Y-X shape– X enclosed by W

– B1: Object related– B2: Background related

( ) ( )( )

( ) ( )1 2

1 2

*

*

ˆ*

c

c

A B A X A W X

A B A B A B

A B A B A B

⎡ ⎤= Θ Θ −⎣ ⎦⎡ ⎤= Θ Θ⎣ ⎦

= Θ − ⊕

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Hit-or-Miss:– Another application:

• Corners

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Morphological Operator Applications:– Boundary Extraction:

( ) ( )A A A Bβ = − Θ

Eroded Difference

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Boundary Extraction:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Region Filling:– Start form p inside boundary.

( )0

1Until:

ck k

k k

X p

X X B AX X+

=

= ⊕

=

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Region Filling Example:– Semi-automated to cancel reflection effect

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Connected components Extraction:– Start from p belong to desired region.

( )0

1Until: k k

k k

X pX X B A

X X+

=

= ⊕

=

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Original

Thr

Erosion (5×5)

Connected Components with size

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Convex Hull of S:– Smallest Convex set H, containing S

• Define Four basic structural elements, Bi, i=1,2,3,4

( )( )

0

4

1

1, 2,3,4 and 1, 2,3,

,

i

i i ik k

i i iconverged

i

X A

X X B A i k

C A D D X=

• =

• = ∗ = =

• = =

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Converged: C

C

C C

C C

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Shortcoming of previous algorithm:– Grow more than minimum required convex size.– Limit to vertical-horizontal expansion.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Thinning:( ) ( )

{ } { }{ } ( )( )( )( )

1 2

1 2

* *Another approach:

, , ,

Repeat until convergence

c

n

n

A B A A B A A B

B B B

A A B B B

⊗ = − =

=

⊗ = ⊗ ⊗ ⊗

B

B

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Convert to m-connection

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Thickening:

• Structural elements are as before.

( )

{ } ( )( )( )( )1 2

*n

A B A A B

A A B B B

=

=B

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Skeletonization A with notation S(A):– For z belong to S(A) and (D)z, the largest disk

centered at z and contained in A, one can not find a larger disk containing (D)z and included in A.

– Disk (D)z touches the boundary of A at two or more different points.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Skeleton by example:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Formulation:( ) ( )

( ) ( ) ( )( ) ( )( )( )( )

( ){ }

( )( )

( ) ( )( )( )( )

0

K

k=0

, : Opening

: times

K=max k

Reconstruction:

A=

: times

K

kk

k

k

S A S A

S A A kB A kB B

A kB A B B B k

A kB

S A kB

A kB A B B B k

=

=

= Θ − Θ

Θ = Θ Θ Θ

Θ ≠∅

⊕ = ⊕ ⊕ ⊕

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Extension to Gray-Level images:– f(x,y): the input image – b(x,y): a structuring element (a subimage function)– (x,y) are integers.– f and b are functions that assign a gray-level value

(real number or real integer) to each distinct pair of coordinate (x,y)

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Extension to Gray-Level images:– Dilation:

• Df and Db are the domains of f and b, respectively.

• condition (s-x) and (t-y) have to be in the domain of fand (x,y) have to be in the domain of b is similar to the condition in binary morphological dilation where the two sets have to overlap by at least one element

( )( , ) max{ ( , ) ( , ) |( ), ( ) ; ( , ) }f b

f b s t f s x y t b x ys x t y D x y D

⊕ = − − +− − ∈ ∈

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Dilation Similarity with Convolution:– f(s-x) : f(-x) is simply f(x) mirrored with respect to the

original of the x axis. the function f(s-x) moves to the right for positive s, and to the left for negative s.

– Max operation replaces the sums of convolution – Addition operation replaces with the products of

convolution.• General effect

– If all the values of the structuring element are positive, the output image tends to be brighter than the input

– Dark details either are reduced or eliminated, depending on how their values and shapes relate to the structuring element used for dilation.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• 1D example:( )( ) max{ ( ) ( ) | ( ) ; }f bf b s f s x b x s x D x D⊕ = − + − ∈ ∈

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Erosion:

Condition (s+x) and (t+y) have to be in the domain of f and (x,y) have to be in the domainof b is similar to the condition in binary morphological erosion where the structuring element has to be completely contained by the set being eroded.

( )( , ) min{ ( , ) ( , ) |( ), ( ) ; ( , ) }f b

f b s t f s x y t b x ys x t y D x y D

Θ = + + −+ + ∈ ∈

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Similarity to 2D correlation– f(s+x) moves to the left for positive s and to the

right for negative s.• General effect

– If all the elements of the structuring element are positive, the output image tends to be darker than the input

– The effect of bright details in the input image that are smaller in area than the structuring element is reduced, with the degree of reduction being determined by the gray-level values surrounding the bright detail and by the shape and amplitude values of the structuring element itself.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• 1D case:( )( ) min{ ( ) ( ) |

( ) ; }f b

f b s f s x b xs x D x D

Θ = + −+ ∈ ∈

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Erosion-Dilation Duality:

ˆ( ) ( , ) ( )( , )where

ˆ( , ) and ( , )

c c

c

f b s t f b s t

f f x y b b x y

Θ = ⊕

= − = − −

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Dilation-Erosion

Original

Dilation

Erosion

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening-Closing:– Same (binary) relation with Dilation-Erosion:

( )( )

ˆ( )c c

f b f b bf b f b b

f b f b

= − ⊕• = ⊕ −

• =

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• 1D Example:One scan line

Rolling ball for opening

Opening results

Rolling ball for Closing

Closing Results

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening-Closing Properties:– Opening:

– Closing:

1 2 1 2

( ) ( )( ) if , then ( ) ( ),( ) ( ) ( )

i f b fii f f f b f biii f b b f b

↵↵ ↵

=

1 2 1 2

( ) ( )( ) if , then ( ) ( )( ) ( ) ( )

i f f bii f f f b f biii f b b f b

↵ •↵ • ↵ •• • = •

e↵r indicates that the domain of e is a subset of the domain of r, and also that e(x,y) ≤ r(x,y) for any (x,y) in the domain of e

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening– The structuring element is rolled underside the surface of f– All the peaks that are narrow with respect to the diameter of the

structuring element will be reduced in amplitude and sharpness– So, opening is used to remove small light details, while leaving

the overall gray levels and larger bright features relatively undisturbed.

– The initial erosion removes the details, but it also darkens theimage.

– The subsequent dilation again increases the overall intensity ofthe image without reintroducing the details totally removed by erosion.

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Closing– The structuring element is rolled on top of the surface

of f– Peaks essentially are left in their original form (assume

that their separation at the narrowest points exceeds the diameter of the structuring element)

– So, closing is used to remove small dark details, while leaving bright features relatively undisturbed.

– The initial dilation removes the dark details and brightens the image

– The subsequent erosion darkens the image without reintroducing the details totally removed by dilation

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Opening Closing Example

Opening: Decreased size of small bright details. No changes to dark region

Closing: Decreased size of small dark details. No changes to bright region

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Gray Level Morphological Examples:– Smoothing:– Gradient:– Laplacian:

( ) ( )g f b f b= ⊕ − Θ

( ) ( ) 2g f b f b f= ⊕ + Θ −

( )( )g f b b= •

Dilation Erosion Smoothing Gradient Laplacian

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Smoothing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Gradient:

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

• Top-hat:– Enhancing details in presence of shades

( )h f f b= −

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods

Chapter 9Morphological Image Processing

Chapter 9Morphological Image Processing

Recommended