0% found this document useful (0 votes)
3 views75 pages

Module 5 ImageSegmentation

Module 5 covers image segmentation techniques including pixel-based and region-based approaches, as well as edge detection methods. It discusses fundamental concepts such as intensity discontinuity and similarity, and various algorithms like thresholding, region growing, and edge detection. The module emphasizes the importance of detecting edges and regions for effective image segmentation, detailing methods like Canny edge detection and Otsu's method for optimal thresholding.

Uploaded by

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

Module 5 ImageSegmentation

Module 5 covers image segmentation techniques including pixel-based and region-based approaches, as well as edge detection methods. It discusses fundamental concepts such as intensity discontinuity and similarity, and various algorithms like thresholding, region growing, and edge detection. The module emphasizes the importance of detecting edges and regions for effective image segmentation, detailing methods like Canny edge detection and Otsu's method for optimal thresholding.

Uploaded by

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

Module 5

Image Segmentation
Dr. Resmi N.G.
Reference:
Digital Image Processing
FOURTH EDITION
Rafael C. Gonzalez • Richard E. Woods
Module 5 - Syllabus
Image Segmentation:
Pixel-Based Approach –
Multi-Level Thresholding, Local
Thresholding, Threshold Detection Method;
Region-Based Approach-
Region Growing Based Segmentation, Region
Splitting, Region Merging, Split and Merge,
Edge Detection –
Edge Operators; Line Detection, Corner
Detection.
Image segmentation
Most of the segmentation algorithms are based on
one of two basic properties of image intensity
values: discontinuity and similarity.
In the first category, the approach is to partition an
image into regions based on abrupt changes in
intensity, such as edges.
Approaches in the second category are based on
partitioning an image into regions that are similar
according to a set of predefined criteria.
Thresholding, region growing, and region splitting
and merging are examples of methods in this
category.
Fundamentals
Fundamental problem in segmentation is to
partition an image into regions that satisfy
the preceding conditions.

Segmentation algorithms for monochrome


images generally are based on one of two
basic categories dealing with properties of
intensity values: discontinuity and similarity.
In the first category, we assume that boundaries of
regions are sufficiently different from each other,
and from the background, to allow boundary
detection based on local discontinuities in intensity.
Edge-based segmentation is the principal approach
used in this category.

Region-based segmentation approaches in the


second category are based on partitioning an
image into regions that are similar according to a
set of predefined criteria.
Point, Line and Edge Detection
based on detecting sharp, local changes in
intensity.

Three types - isolated points, lines, and edges.

Edge pixels are pixels at which the intensity of


an image changes abruptly, and edges (or edge
segments) are sets of connected edge pixels.

Edge detectors are local image processing tools


designed to detect edge pixels.
A line may be viewed as a (typically) thin
edge segment in which the intensity of the
background on either side of the line is either
much higher or much lower than the intensity
of the line pixels.

An isolated point may be viewed as a


foreground (background) pixel surrounded by
background (foreground) pixels.
First- and second-order derivatives are
particularly well suited for detecting abrupt,
local changes in intensity.

Derivatives of a digital function are


expressed in terms of finite differences.
For two variables,
(1) First-order derivatives generally produce
thicker edges.

(2) Second-order derivatives have a stronger


response to fine detail, such as thin lines, isolated
points, and noise.

(3) Second-order derivatives produce a double-


edge response at ramp and step transitions in
intensity.

(4) The sign of the second derivative can be used


to determine whether a transition into an edge is
from light to dark or dark to light.
Spatial convolution can be used to compute
first and second derivatives at every pixel
location in an image .
The procedure is to compute the sum of
products of the kernel coefficients with the
intensity values in the region encompassed by
the kernel.
That is, the response of the filter at the
center point of the kernel is
DETECTION OF ISOLATED POINTS
Point detection should be based on the
second derivative which means using the
Laplacian.
The idea is that the intensity of an isolated
point will be quite different from its
surroundings, and thus will be easily
detectable by this type of kernel.
LINE DETECTION
For line detection, second derivatives will
result in a stronger filter response, and
produce thinner lines than first derivatives.
Thus, the Laplacian kernel is used for line
detection also.
The preferred direction of each kernel is
weighted with a larger coefficient (i.e., 2)
than other possible directions.

The coefficients in each kernel sum to zero,


indicating a zero response in areas of
constant intensity.
Let Z1, Z2 , Z3, and Z4 denote the responses
of the horizontal, +450, vertical and -450
kernels.
Suppose that an image is filtered with these
four kernels, one at a time. If, at a given point
in the image, Zk > Zj, for all j ≠ k, that point
is said to be more likely associated with a line
in the direction of kernel k.
For example, if at a point in the image, Z1 >
Zj for j = 2,3,4, that point is said to be more
likely associated with a horizontal line.
Edge Models
Edge detection is an approach used
frequently for segmenting images based on
abrupt (local) changes in intensity.

Edge models are classified according to their


intensity profiles.

Eg; step, ramp, roof edge models


A step edge is characterized by a transition
between two intensity levels occurring ideally
over the distance of one pixel.

The slope of the ramp is inversely


proportional to the degree to which the edge
is blurred. An edge point now is any point
contained in the ramp, and an edge segment
would be a set of such points that are
connected.
Roof edges are models of lines through a region,
with the base (width) of the edge being determined
by the thickness and sharpness of the line.

In the limit, when its base is one pixel wide, a roof
edge is nothing more than a one-pixel-thick line
running through a region in an image.

Roof edges arise, for example, in range imaging,


when thin objects (such as pipes) are closer to the
sensor than the background (such as walls).
The magnitude of the first derivative can be used
to detect the presence of an edge at a point in an
image.

Similarly, the sign of the second derivative can be


used to determine whether an edge pixel lies on
the dark or light side of an edge.

Two additional properties of the second derivative


around an edge are:
(1) it produces two values for every edge in an
image;
(2) its zero crossings can be used for locating the
centers of thick edges.
The three steps performed typically for edge
detection are:
1. Image smoothing for noise reduction.

2. Detection of edge points - This is a local


operation that extracts from an image all
points that are potential edge-point
candidates.

3. Edge localization. The objective of this


step is to select from the candidate points
only the points that are members of the set of
points comprising an edge.
BASIC EDGE DETECTION
Image Gradient
The tool of choice for finding edge strength and
direction at an arbitrary location (x, y) of an
image, f, is the gradient, denoted by f and defined
as the vector

It points in the direction of maximum rate of


change of f at (x, y).
This is the value of the rate of change in the
direction of the gradient vector at point (x, y).
The direction of an edge at a point (x, y) is orthogonal to
the direction, (x, y), of the gradient vector at the point.
The gradient vector sometimes is called the edge
normal.
When the vector is normalized to unit length by dividing
it by its magnitude, the resulting vector is referred to as
the edge unit normal.
Gradient Operators
Roberts cross-gradient operators
Prewitt operators
Sobel operators
The Prewitt kernels are simpler to implement
than the Sobel kernels.
The Sobel kernels have better noise-
suppression (smoothing) characteristics
which makes them preferable.
The Canny Edge Detector
Canny’s approach is based on three basic
objectives:
1. Low error rate.
All edges should be found, and there should be
no spurious responses.

2. Edge points should be well localized.


The edges located must be as close as possible
to the true edges.
That is, the distance between a point marked
as an edge by the detector and the center of
3. Single edge point response.
The detector should return only one point for
each true edge point.
That is, the number of local maxima around
the true edge should be minimum.
This means that the detector should not
identify multiple edge pixels where only a
single edge point exists.
Canny edge detection algorithm consists of
the following steps:

1. Smooth the input image with a Gaussian


filter.

2. Compute the gradient magnitude and


angle images.

3. Apply nonmaxima suppression to the


gradient magnitude image.

4. Use double thresholding and connectivity


analysis to detect and link edges.
Combining the Gradient with Thresholding
Edge detection can be made more selective
by smoothing the image prior to computing
the gradient.

Another approach aimed at achieving the


same objective is to threshold the gradient
image.
THRESHOLDING
The Basics of Intensity Thresholding
Helps to extract the objects from the
background.
Select a threshold, T, that separates the two
modes. Then, any point (x, y) in the image at
which f (x, y) > T is called an object point.
Otherwise, the point is called a background
point.
In other words, the segmented image,
denoted by g(x, y), is given by
When T is a constant applicable over an entire
image, the process given in this equation is
referred to as global thresholding.

When the value of T changes over an image,


we use the term variable thresholding.

The terms local or regional thresholding are


used sometimes to denote variable
thresholding in which the value of T at any
point (x, y) in an image depends on properties
of a neighborhood of (x, y) (for example, the
average intensity of the pixels in the
neighborhood).
If T depends on the spatial coordinates (x, y)
themselves, then variable thresholding is often
referred to as dynamic or adaptive thresholding.

Multiple thresholding classifies a point (x, y) as


belonging to the background if f (x, y) ≤ T1 , to
one object class if T1 < f (x, y) ≤ T2, and to the
other object class if f (x, y) > T .

where a, b, and c are any three distinct intensity


values.
The success of intensity thresholding is related
directly to the width and depth of the valley(s)
separating the histogram modes.
In turn, the key factors affecting the properties of
the valley(s) are:
(1) the separation between peaks (the further
apart the peaks are, the better the chances of
separating the modes);
(2) the noise content in the image (the modes
broaden as noise increases);
(3) the relative sizes of objects and background;
(4) the uniformity of the illumination source;
(5) the uniformity of the reflectance properties of
the image.
BASIC GLOBAL THRESHOLDING
OPTIMUM GLOBAL THRESHOLDING USING
OTSU’S METHOD
It maximizes the between-class variance.

The basic idea is that properly thresholded classes


should be distinct with respect to the intensity
values of their pixels and, conversely, that a
threshold giving the best separation between
classes in terms of their intensity values would be
the best (optimum) threshold.

In addition to its optimality, Otsu’s method has the


important property that it is based entirely on
computations performed on the histogram of an
image, an easily obtainable 1-D array.
Multiple Thresholds
VARIABLE THRESHOLDING
Variable Thresholding Based on Local Image
Properties
A basic approach to variable thresholding is to
compute a threshold at every point, (x, y), in the
image based on one or more specified properties in
a neighborhood of (x, y).

Mean and standard deviation of the pixel values in


a neighborhood of every point in an image are two
quantities which are useful for determining local
thresholds because they are descriptors of
average intensity and contrast.
Variable Thresholding Based on Moving
Averages
Based on computing a moving average along
scan lines of an image.

This implementation is useful in applications


such as document processing, where speed is
a fundamental requirement.

The scanning typically is carried out line by


line in a zigzag pattern to reduce illumination
bias.
SEGMENTATION BY REGION GROWING
Region growing is a procedure that groups
pixels or subregions into larger regions based
on predefined criteria for growth.

The basic approach is to start with a set of


“seed” points, and from these grow regions
by appending to each seed those neighboring
pixels that have predefined properties similar
to the seed (such as ranges of intensity or
color).
Selection of similarity criteria: depends
not only on the problem under consideration,
but also on the type of image data available.

 Formulation of a stopping rule: Region


growth should stop when no more pixels
satisfy the criteria for inclusion in that region.
Let: f (x, y) denote an input image; S(x, y) denote
a seed array containing 1’s at the locations of
seed points and 0’s elsewhere; and Q denote a
predicate to be applied at each location (x, y).
Arrays f and S are assumed to be of the same
size.
A basic region-growing algorithm based on 8-
connectivity may be stated as follows.
REGION SPLITTING AND MERGING
Subdivide an image initially into a set of
disjoint regions and then merge and/or split
the regions in an attempt to satisfy the
conditions of segmentation.

One approach for segmenting R is to


subdivide it successively into smaller and
smaller quadrant regions so that, for any
region Ri and predicate Q, Q(Ri ) = TRUE.
Let R represent the entire image region. Select a
predicate Q.

We start with the entire region, R.

If Q(R) = FALSE, we divide the image into


quadrants.

If Q is FALSE for any quadrant, we subdivide that


quadrant into sub-quadrants, and so on.

This splitting technique has a convenient


representation in the form of so-called quadtrees;
that is, trees in which each node has exactly four
Note that the root of the tree corresponds to
the entire image, and that each node
corresponds to the subdivision of a node into
four descendant nodes.
In this case, only R4 was subdivided further.
If only splitting is used, the final partition
normally contains adjacent regions with
identical properties.

This drawback can be remedied by allowing


merging as well as splitting.

Satisfying the constraints of segmentation


requires merging only adjacent regions
whose combined pixels satisfy the predicate
Q.

That is, two adjacent regions Rj and Rk are


merged only if Q (RjURk ) = TRUE.
Steps:
1. Split into four disjoint quadrants any
region Ri for which Q(Ri)= FALSE.
2. When no further splitting is possible,
merge any adjacent regions Rj and Rk for
which Q (RjURk ) = TRUE.
3. Stop when no further merging is possible.
Thank You

You might also like