Erosion: by Steve Kelsch

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Erosion

By Steve Kelsch
What is Erosion?
„ Morphological Operation
„ Similar in nature to Dilation, but opposite effect

„ Removal of Pixels from the Edges of


Objects within an Image

„ Types: Binary and Grayscale Erosion


Uses for Erosion
„ Used in Commercial "machine vision"
systems

„ Separating distinct objects in an image

„ Removing ‘salt’ noise from images (grayscale)

„ Edge Detection
Separating Objects for Counting

Apply Erosion
Edge Detection

• Subtract Eroded Image from Original to Find Edges

ORIGINAL (ORIGINAL – ERODED)


How Binary Erosion Works
„ Utilizes set theory principles
Set A = Original Image
Set B = Structuring Element (Similar to
a Mask)

Erosion of A by B is the set of points x such that


B translated by x is contained in A.
How Binary Erosion Works – ex.

Original Image 3x3 Structuring Element Eroded Image


(SET A) (SET B)
How Binary Erosion Works…
„ “Active elements” of structuring elements
assume the same binary values as the
foreground pixels of the image.

i.e. Foreground pixels of original image, and the active


elements of the structuring element contain the value 1.
A Structuring Element (3x3)

The Structuring traverses


each pixel in the original
image, and the output value
of each pixel is set at the
origin of the structuring
element.
Rules of Binary Erosion
„ If the input pixel is set to foreground and
all its 8 neighbors are also set to
foreground, then the pixel remains set to
foreground.
3x3 Structuring
INPUT IMAGE Element

OUTPUT PIXEL
REMAINS 1
Rules of Binary Erosion cont..
„ If the Input pixel is set to foreground, but
at least one of its 8 neighbors is not, the
output pixel is set to background.
3x3 Structuring Element
INPUT IMAGE OUTPUT IMAGE

OUTPUT PIXEL
IS SET TO 0
Rules of Binary Erosion
„ Input pixels set to background remain
such.
3x3 Structuring Element

INPUT IMAGE OUTPUT IMAGE

OUTPUT PIXEL
REMAINS 0
Combining Erosion with Dilation

„ Example: to Eliminate Irrelevant Detail in


an Image
ORIGINAL ERODED DILATED
Grayscale Erosion
„ Grayscale erosion is used to smooth small light regions. It is
defined as the minimum of the difference of a local region of an
image and a grayscale mask. The shape of the input mask
(known as the structuring element, or SE) is generally chosen
to emphasize or de-emphasize elements in the image.

„ General Effects of Grayscale Erosion:


1. If all the values in the structuring element are positive, the output
image tends to be darker than the input.
2. Light elements within the image are reduced or eliminated,
depending on how their shapes relate to the structuring element
used.

„ The degree of these effects depends greatly on the shape and


values within the structuring element and by the details within
the image itself.
Grayscale Erosion Morphology

I = Original Image
H = Structuring Element
How Grayscale Erosion works
Grayscale Erosion
Elimination of Bright Spots -> Dark spots expand slightly
Grayscale Erosion vs Dilation
Project Progress
„ Goals:
„ To implement Binary Erosion with arbitrary SE sizes
and value orientation
„ Look into Implementation of Grayscale Erosion

„ Progress
„ Researched Matlab’s built in functionality
„ Determined Parameters: Mask (SE), Binary Image
„ Early Stages of Implementation
Conclusions about Erosion
„ Morphological

„ Can be either binary or grayscale

„ SE (Structuring elements acts as mask)

„ Binary Erosion of A by B is the set of points x such that


B translated by x is contained in A.

„ Grayscale Erosion at pixel U is the min value in the


neighborhood where the SE values are subtracted from
the image.
Comments or Questions

You might also like