Sie sind auf Seite 1von 58

PLT 425

VISION SYSTEM

Chapter 5:
Morphological Binary Image
Processing

School of Mechatronic Engineering


AiCOS Research Group
Morphological Binary Image
Processing
 Morphological image processing describes a range
of image processing techniques that deal with the
shape (or morphology) of features in an image.

 Morphological operations are originally developed for


binary images for shape and structural
manipulations.

School of Mechatronic Engineering


AiCOS Research Group
Grayscale image Image after segmentation
(segmented image)

School of Mechatronic Engineering


AiCOS Research Group
Morphological operations are typically applied to remove
imperfections introduced during image segmentation
process.

School of Mechatronic Engineering


AiCOS Research Group
Binary Image Morphology

 A binary image can be considered as a set by


considering “white” pixels as elements in the set
(foreground) and “black” pixels as outside the set
(background).

 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

School of Mechatronic Engineering


AiCOS Research Group
Set Operations

School of Mechatronic Engineering


AiCOS Research Group
Logic Operations

7 School of Mechatronic Engineering


AiCOS Research Group
Logical Operations between Binary
Images

School of Mechatronic Engineering


AiCOS Research Group
Basic Morphological Operations

The basic operations of binary morphology are:


 Erosion makes a region smaller.
 Dilation enlarges a region.
 Opening operation can get rid of small portions of the
region that jut out from the boundary (spurs, bridges).
 Closing operation can close up internal holes in a region
and eliminate bays along boundaries.

School of Mechatronic Engineering


AiCOS Research Group
Structuring Element (SE)

 Structuring element (SE) is small sets or sub-images


used to probe an image under study for properties of
interest.
 SE is usually another smaller binary image or sub-image.
 It represents a shape, can be of any size and have
arbitrary structure that can be represented by a binary
image.

School of Mechatronic Engineering


AiCOS Research Group
Structuring Element (SE)
 Members and origin (centre of gravity) of SE are specified.

School of Mechatronic Engineering


AiCOS Research Group
How structuring elements are
used in morphology?

School of Mechatronic Engineering


AiCOS Research Group
Erosion
 Erodes away the boundary regions, hence foreground
pixels shrink in size.
 Does the structuring element fit the set?

Erosion of a set A by structuring element B: all z in A such


that B is in A when origin of B=z.

Shrink the object

A  B  {z|(B)z  A}

School of Mechatronic Engineering


AiCOS Research Group
Example: Erosion

School of Mechatronic Engineering


AiCOS Research Group
Example: Erosion

School of Mechatronic Engineering


AiCOS Research Group
Example: Erosion

School of Mechatronic Engineering


AiCOS Research Group
Example: Erosion

School of Mechatronic Engineering


AiCOS Research Group
Example of Image and Structure Element

School of Mechatronic Engineering


AiCOS Research Group
Erosion of A by B

School of Mechatronic Engineering


AiCOS Research Group
Example: Erosion

School of Mechatronic Engineering


AiCOS Research Group
Dilation
 This operator enlarges the boundary of foreground pixels,
hence holes inside pixels become smaller.
 Does the structuring element hit the set?

Dilation of a set A by structuring element B: all z in A such


that B hits A when origin of B=z.

Grow the object

A  B  {z|( Bˆ )z  A  Φ}

School of Mechatronic Engineering


AiCOS Research Group
Dilation
Translation of SE on the image.

School of Mechatronic Engineering


AiCOS Research Group
Dilation of A by B

School of Mechatronic Engineering


AiCOS Research Group
Example: Dilation

School of Mechatronic Engineering


AiCOS Research Group
Example: Dilation

School of Mechatronic Engineering


AiCOS Research Group
Example: Dilation

School of Mechatronic Engineering


AiCOS Research Group
Example: Dilation

School of Mechatronic Engineering


AiCOS Research Group
Dilation: Bridging Gaps

School of Mechatronic Engineering


AiCOS Research Group
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.

School of Mechatronic Engineering


AiCOS Research Group
Combining Erosion and Dilation

Wanted:
Remove structures / fill holes without affecting
remaining parts

Solution:
Combine erosion and dilation (using same SE)

School of Mechatronic Engineering


AiCOS Research Group
Combining Erosion & Dilation :
Eliminating Irrelevant Detail and
Restoring

Structuring element B = 13x13 pixels of gray level 1

School of Mechatronic Engineering


AiCOS Research Group
Opening and Closing
 Opening
• Smoothes the contour of an object,
• breaks narrow isthmuses, and
• eliminates thin protrusions.

 Closing
• Smooth sections of contours but,
• fuses narrow breaks and long thin gulfs,
• eliminates small holes, and
• fills gaps in the contour.

School of Mechatronic Engineering


AiCOS Research Group
Opening

 Like “smoothing from the inside”.


 The opening of set A by structuring element B,
denoted A ∘ B, is defined as:

A  B  ( A  B)  B
 Thus, the opening A by B is the erosion of A by B,
followed by dilation of the result by B.

School of Mechatronic Engineering


AiCOS Research Group
Opening
 Erosion followed by dilation.

School of Mechatronic Engineering


AiCOS Research Group
Example: Opening
 Erosion followed by Dilation.

School of Mechatronic Engineering


AiCOS Research Group
Example: Opening
 Erosion followed by dilation.

School of Mechatronic Engineering


AiCOS Research Group
Example: Opening
 Erosion followed by dilation.

School of Mechatronic Engineering


AiCOS Research Group
Example: Opening

School of Mechatronic Engineering


AiCOS Research Group
Closing

 Like “smoothing from the outside”.


 The closing of set A by structuring element B,
denoted A• B, is defined as:

A  B  ( A  B)  B
 Dilation of A by B, followed by erosion of the result
by B.

School of Mechatronic Engineering


AiCOS Research Group
Example: Closing
 Dilation followed by erosion.

School of Mechatronic Engineering


AiCOS Research Group
Example: Closing
 Dilation followed by erosion.

School of Mechatronic Engineering


AiCOS Research Group
Example: Closing
 Dilation followed by erosion.

School of Mechatronic Engineering


AiCOS Research Group
Example: Closing
 Dilation followed by erosion.

School of Mechatronic Engineering


AiCOS Research Group
Example: Closing

School of Mechatronic Engineering


AiCOS Research Group
Useful: Open & Close

School of Mechatronic Engineering


AiCOS Research Group
Application:
Filtering Operation

School of Mechatronic Engineering


AiCOS Research Group
Some Basic Morphological Algorithms:
Boundary Extraction
 The boundary of a set A, denoted by β(A),can be obtained by
first eroding A and B and then performing the set difference
between A and its erosion.
 ( A)  A  ( A  B)
 B is a structuring element.

47 School of Mechatronic Engineering


AiCOS Research Group
Example: Boundary Extraction

School of Mechatronic Engineering


AiCOS Research Group
Some Basic Morphological Algorithms:
Hole filling/Region Filling
 Hole: A background region surrounded by a connected border of
foreground pixels.
 Filling a background region surrounded by a connected border of
foreground pixels.

49 School of Mechatronic Engineering


AiCOS Research Group
Hole filling/Region Filling
X k  ( X k 1  B)  A c
k  1,2,3,...

School of Mechatronic Engineering


AiCOS Research Group
Some Basic Morphological Algorithms:
Thinning

 Is a process where the binary-


valued image regions are
reduced to lines or skeleton.

51 School of Mechatronic Engineering


AiCOS Research Group
Thinning

A  B  A  ( A  B)
 A  ( A  B) c

School of Mechatronic Engineering


AiCOS Research Group
Some Basic Morphological Algorithms:
Thickening

 Thickening is a morphological
operation that is used to grow
selected regions of foreground
pixels in binary images.
 Normally, thickening is done
by thinning the background of
the set of interest, and then
complementing the result.
 Followed by post-processing
to remove disconnected
pixels.

53 School of Mechatronic Engineering


AiCOS Research Group
Thickening

A  B  A  ( A  B)

54 School of Mechatronic Engineering


AiCOS Research Group
School of Mechatronic Engineering
AiCOS Research Group
School of Mechatronic Engineering
AiCOS Research Group
School of Mechatronic Engineering
AiCOS Research Group
School of Mechatronic Engineering
AiCOS Research Group

Das könnte Ihnen auch gefallen