0% found this document useful (0 votes)
16 views56 pages

Morphological Image Processing

Uploaded by

yesn8218
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views56 pages

Morphological Image Processing

Uploaded by

yesn8218
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Morphological Image Processing

 It is basically a filtering operation.


 Here set theoretic operations are used for image processing
applications.
 In normal image filtering, we have an image and filtering is done
through Convolutional mask.

1
Mathematic Morphology
 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

2
Z2 and Z3
 set 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

3
Image is represented =
by a set I {( x, y ) /( x, y) ∈ R } 2

For a binary image, A is the object and is represented by a set

A
=A {=
( x, y ) / I ( x, y ) 1}
This is called Binary Image Morphology.

In Gray Scale Morphology, =


A {( x, y, z ) /( x, y) ∈ R , I ( x,=
2
y ) z}

The value of ‘z’ is important as it gives the gray value, (x, y) gives the gray
point.

4
Basic Set Theory

5
Reflection and Translation
Bˆ = {w | w ∈ −b, for b ∈ B}
( A) z = {c | c ∈ a + z , for a ∈ A}

6
B (0,0)
(1) Reflection Operation:
Reflection of ‘B’ is given by,

=Bˆ {( x, y) /(− x, − y) ∈ B} (0,0)

(2) Translation Operation: Y

Translation of ‘A’ is given by X


( A) x ={a + x / a ∈ A} (A) x

7
Logic Operations

8
Example

9
Structuring element (SE)
 small set to probe the image under study
 for each SE, define origo
 shape and size must be adapted to geometric
properties for the objects

10
Structuring Element:

It is similar to mask in convolution. It is used to smoothout the object


image A.
Y

Structuring element
Entire image
A
X

x
11
Basic idea
 For each pixel in binary image:
 check if SE is ”satisfied”
 output pixel is set to 0 or 1 depending on
used operation

12
Basic morphological operations
 Erosion

 Dilation

keep general shape but


 combine to smooth with respect to

 Opening object
 Closening background

13
Increases the object size
A= Object and B= Structuring element

( B) Z = Structuring element translated to point z ∈ z 2 = a + z a ∈ B { }


B and A overlap by at least one element.

Generally size of B or B̂ is smaller than A


A If B̂ is placed at the boundary of ‘A
Then the size of ‘A’ increases to include B̂ points.

( B̂ ) Here all the points touching the boundary will be


Dilation of A with B included.
14
Dilation

B = structuring element

A ⊕ B = {z|(Bˆ )z ∩ A ≠ Φ}
15
Dilation

16
Dilation

17
Why Dilation?

 If there is a very small object, say (hole) inside the object ‘A’, then
this unfilled hole inside the object is filled up.
 Small disconnected regions outside the boundary may be connected
by dilation.
 Irregular boundary may be smoothened out.

Properties of Dilation:

1. A ⊕ B = B ⊕ A
2. A ⊕ ( B ⊕ C ) = ( A ⊕ B) ⊕ C
3. ( A ⊕ B) x =Ax ⊕ B Dilation is translation invariant.

18
Dilation : Bridging gaps

19
Decreases the object size

 Here, structuring element ‘B’ should be completely inside the object


‘A’.
 Boundary pixels are not included.

20
Erosion

A − B = {z|(B)z ⊆ A}
21
Erosion

22
Erosion

23
Advantages:

1. Two nearly connected regions will be separated by erosion operation.


2. Any hole inside the object will be increased.
3. Boundary may be smoothened.

Properties of Erosion:

1. Erosion is translation invariant i.e. ( AΘB ) x =Ax ΘB


2. ( AΘB ) =BΘA
3. ( AΘB ) ΘC = AΘ ( BΘC )
Dilation and Erosion are dual operations in the sense that,
( AΘB ) = AC ⊕ B
C
ˆ

( )
C
A⊕ B
ˆ =AC ΘB 24

( AΘB) = A ⊕ B
C C

{ z /( B)Z ⊆ A}
C
Since ( AΘB=
C
)

{ }
C
ϕ as ( B) Z is completely
= z /( B) Z ∩ A =C

ϕ
inside A. So, ( B) Z ∩ AC =
{
= z /( B) Z ∩ AC ≠ ϕ }

∴ ( AΘB) = A ⊕ B
C C


and ( A ⊕ B)C =AC ΘB
25
useful
 erosion
 removal of structures of certain shape and
size, given by SE
 Dilation
 filling of holes of certain shape and size,
given by SE

26
Opening
erosion followed by dilation, denoted ∘

A  B = ( A − B) ⊕ B
 eliminates protrusions (projecting out from something)
 breaks necks
 smoothes contour

( A  B)  B = A  B

27
Opening

28
Opening

29
Opening

A  B = ( A − B) ⊕ B
A  B = ∪{( B ) z | ( B) z ⊆ A} 30
Closing
dilation followed by erosion, denoted •

A • B = ( A ⊕ B) − B
 smooth contour
 fuse narrow breaks and long thin gulfs
 eliminate small holes
 fill gaps in the contour
31
Closing Operation:
Dilation followed by erosion. A • B = ( A ⊕ B ) ΘB
After Dilation operation, the size of the object is increased and it is brought
back to the original size by erosion operation.

Closing


Object A Structuring
Element B

By using closing operation, irregular boundaries may be smoothened


depending upon the structuring element.

32
Closing

33
Closing

34
Closing

A • B = ( A ⊕ B) − B
35
Properties
Opening
(i) A°B is a subset (subimage) of A
(ii) If C is a subset of D, then C °B is a subset of D °B
(iii) (A °B) °B = A °B
Closing
(i) A is a subset (subimage) of A•B
(ii) If C is a subset of D, then C •B is a subset of D •B
(iii) (A •B) •B = A •B

Note: repeated openings/closings has no effect!


36
Duality
 Opening and closing are dual with respect
to complementation and reflection

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

37
38
Useful: open & close

39
Application: filtering

40
Hit-or-Miss Transformation
⊛ (HMT)
 find location of one shape among a set of shapes
”template matching

 composite SE: object part (B1) and background


part (B2)
 does B1 fits the object while, simultaneously,
B2 misses the object, i.e., fits the background?
41
Hit-or-Miss Transformation

A ∗ B = ( A − X ) ∩ [ A − (W − X )]
c

42
Boundary Extraction

β ( A) = A − ( A − B)
43
Example

44
Thinning Operation:
This gives the image as single pixel width line

Thinning
Object

Skeletonizing
Object

Thinning and Skeletonizing are impact operations.

Thinning operator A ⊗ B = A − ( A∗ B) 45
Thinning

A ⊗ B = A − ( A ∗ B)
= A ∩ ( A ∗ B) c

46
Thickening
A • B = A ∪ ( A ∗ B)

47
Skeletons
Obtained from thinning or skeletonizing processes

Medial axes (dash lines)


For each point p in R, find its closest neighbor in border B. If p
has more than one such neighbor, it is said to belong to the
medial axis (skeleton) of R.
Grassfire Transform

Skeleton forms at the points in the region where the


"fires" meet

49
K
S ( A) = ∪ S k ( A)
Skeletons k =0

S k ( A) = ( A − kB) − ( A − kB)  B

K = max{k | ( A − kB) ≠ Φ}
K is the last iterative step before A erodes to an empty set.

Reconstruction of A :
K
A = ∪ ( S k ( A) ⊕ kB)
k =0

If z is a point of S ( A) and ( D) z is the largest disk centered


at z and contained in A, one cannot find a larger disk (not necessarily
centered a z ) containing ( D) z and included in A. The disk ( D) z is
called a maximum disk. The disk touches the boundary of A at two or
more different places.

50
51
5 basic structuring elements

52
53
Dilation at a point (s,t) of f with b:

( f ⊕ b )(=
s, t ) max { f ( s − x, t − y ) + b ( x, y ) , s − x, t − y ∈ D f , ( x, y ) ∈ Db }
We can also write like convolution i.e f ( x, y ) + b ( s − x, t − y )
Here mask is rotated. When mask is placed over the object from overlapping
pixels, maximum value is considered..

Since it is maxima operation, darker regions become bright.

Applications:
1. Pepper noise can be removed.
2. Size of the image is also changed because of dilation.
54
Erosion operation:

( f Θb )(=
s, t ) min { f ( s + x, t + y ) − b ( x, y ) , s + x, t + y ∈ D f , ( x, y ) ∈ Db }
Since it is minimum operation, bright details will be reduced.
Subtract values from f.
Application: salt noise is removed.

We can erose and dilate with a flat structuring element.

55
Closing operation: dilation followed by erosion.

f •b = ( f ⊕ b ) Θb
It removes pepper noise by keeping intensity approximately constant.

Opening operation: erosion followed by dilation.

f b = ( f Θb ) ⊕ b
It removes the salt noise and at the same time brightness level is maintained.
(Keeping the intensity approximately constant)

56

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy