0% found this document useful (0 votes)
69 views49 pages

04 Morphological Image Processing

Here is a morphological algorithm to solve Problem 9.36: (a) Perform an opening operation on the original image using a structuring element of the particle size. This will remove overlapping particles and particles on the boundary will remain. (b) Subtract the result of (a) from the original image. This will contain only overlapping particles. (c) Perform a closing operation on the result of (a) using the same structuring element. This will fill in any small holes left by particles on the boundary and result in an image containing only non-overlapping particles.

Uploaded by

Hamza Mazen
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)
69 views49 pages

04 Morphological Image Processing

Here is a morphological algorithm to solve Problem 9.36: (a) Perform an opening operation on the original image using a structuring element of the particle size. This will remove overlapping particles and particles on the boundary will remain. (b) Subtract the result of (a) from the original image. This will contain only overlapping particles. (c) Perform a closing operation on the result of (a) using the same structuring element. This will fill in any small holes left by particles on the boundary and result in an image containing only non-overlapping particles.

Uploaded by

Hamza Mazen
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/ 49

CSE 483: Computer Vision

Morphological Image Processing

Prof. Mahmoud Khalil

1
Morphological Image Processing

2
Morphological Image Processing

3
Morphological operators
• Change the shape of the foreground regions via
intersection/union operations between a scanning
structuring element and binary image.
• Useful to clean up result from thresholding.

• Basic operators are:


• Dilation
• Erosion

4
Dilation
• Dilation expands the connected sets of a binary image.
• It can be used for
• growing features

• filling holes and gaps

5
Ahmed Elgammal, Rutgers
Erosion
• Erosion shrinks the connected sets of a binary image.
• It can be used for
• shrinking features

• Removing bridges, branches and small protrusions

6
Kristen Grauman, UT-Austin
Structuring elements
• Masks of varying shapes and sizes used to perform
morphology, for example:

• Scan mask across foreground pixels to transform the


binary image.

7
Ahmed Elgammal, Rutgers
Example for Dilation (1D)

Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1
g ( x)  f ( x)  SE

Output Image 1

8
Adapted from T. Moeslund
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1

9
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1 0

10
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1 0 1

11
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1 0 1 1 1

12
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1 0 1 1 1 1

13
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1 0 1 1 1 1 1

14
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1 0 1 1 1 1 1

15
Example for Dilation
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 1 0 1 1 1 1 1 1

Note that the object gets bigger and holes are filled.
>> help imdilate
16
Dilation

17
Dilation

18
Dilation

19
Example for Erosion (1D)

Input image
1 0 0 0 1 1 1 0 1 1

1 1 1
Structuring Element _
g ( x)  f ( x)OSE

Output Image 0

20
Example for Erosion (1D)
Input image
1 0 0 0 1 1 1 0 1 1

1 1 1
Structuring Element
g ( x)  f ( x)O_ SE

Output Image 0 0

21
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0

22
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0

23
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 0

24
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 0 1

25
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 0 1 0

26
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 0 1 0 0

27
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 0 1 0 0 0

28
Example for Erosion
Input image
1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 0 1 0 0 0 1

Note that the object gets smaller


>> help imerode 29
Erosion

30
Erosion

31
Morphological Image Processing

32
Problem 9.6

33
Opening
• Erode, then dilate
• Remove small objects, keep original shape

Before opening After opening

34
Kristen Grauman, UT-Austin
Closing
• Dilate, then erode
• Fill holes, but keep original shape

Before closing After closing

35
Kristen Grauman, UT-Austin
Open and Close

36
Open and Close

37
Open and Close

38
Hit or Miss

39
Hit or Miss

40
Boundary Extraction

41
Boundary Extraction

42
Region Filling

43
Region Filling

44
Extraction of Connected Components

45
Extraction of Connected Components

46
Problem 9.17

47
Problem 9.17

48
Problem 9.36
A preprocessing step in an application
of microscopy is concerned with the
issue of isolating individual round
particles from similar particles that
overlap in groups of two or more
particles. Assuming that all particles are
of the same size, propose a
morphological algorithm that produces
three images consisting respectively of
(a) Only of particles that have merged
with the boundary of the image.
(b) Only overlapping particles.
(c) Only nonoverlapping particles.

49

You might also like