Segmentation
Segmentation
Unit VI
Part I
Introduction
• Segmentation is to subdivide an image into its component regions or
objects.
❑ pixels in the same category have similar grey scale of multivariate values
and form a connected region,
• In partial segmentation, ‰
➢ Regions segmented do not correspond directly with image objects.
2. Edge-based segmentation
3. Region-based segmentation
Detection of Discontinuities
-1 -1 -1
-1 8 -1
-1 -1 -1
Point detection
-1 -1 -1
-1 8 -1
-1 -1 -1
R=8 f 5 − ( f 1 + f 2 + f 3 + f 4 + f 6 + f 7 + f 8 + f 9 ) > T
i.e |R|>T
• Where R is the response of the mask at any point in the image and
• T is pre defined non-negative threshold value.
Point detection
• It means that isolated point is detected at the corresponding value (x, y).
• This formulation serves to measures the weighted differences between the
center point and its neighbors since the gray level of an isolated point will
be very different from that of its neighbors.
Point detection
Actually any pixel whose value is larger than T after being masked will be
considered as an isolated point.
Detection of lines
-1 -1 -1 -1 2 -1
2 2 2 -1 2 -1
-1 -1 -1 -1 2 -1
-1 -1 2 2 -1 -1
-1 2 -1 -1 2 -1
2 -1 -1 -1 -1 2
Detection of lines
With the help of lines
detector masks, we can
detect the lines in a specified
direction. For example, we
are interesting in finding all
the lines that are one pixel
thick, oriented at -45°.
Edge detection
➢ Edge detection is the most common approach in gray level discontinuity
segmentation. It is very useful in detecting of discontinuity in an image.
-1 -1 -1 -1 0 1
0 0 0 -1 0 1
1 1 1 -1 0 1
-1 -1 -1 -1 0 1
0 0 0 -1 0 1
1 1 1 -1 0 1
-1 -2 -1 -1 0 1
0 0 0 -2 0 2
1 2 1 -1 0 1
-1 -2 -1 -1 0 1
0 0 0 -2 0 2
1 2 1 -1 0 1
0 -1 0
-1 4 -1
0 -1 0
-1 -1 -1 1 1 1
-1 8 -1 1 -8 1
-1 -1 -1 1 1 1
➢ To reduce the effect of noise, first image will be smooth using the Gaussian
operator and then it is operated by Laplacian operator.
➢ Real life: ƒThe detected set of pixels very rarely describes a complete edge
due to effects from: noise, breaks in the edge due to non-uniform
illumination.
➢ All points that are similar according to predefined criteria are linked,
forming an edge of pixels that share common properties. Similarity
according to:
➢ Involves:
n(n-1)/2 ~ n2 lines
n(n(n-1))/2 ~ n3 computations for comparing every point to
all lines.
Global Processing via the Hough Transform
➢ Better solution: Hough Transform ƒ
➢ Classical Hough Transform can locate regular curves like straight lines,
circles, parabolas, ellipses, etc.
• Each sub image is then processed with respect to its local threshold.
Threshold selection based on boundary
characteristics
• A reliable threshold must be selected to identify the mode peaks of a given
histogram.
• We can consider only those pixels that lie on or near the boundary between
objects and the background such that the associated histogram is well-
shaped to provide a good chance for us to select a good threshold.
Threshold selection based on boundary
characteristics
• The gradient can indicate if a pixel is on an edge or not.
• The Laplacian can tell if a given pixel lies on the dark or light (background
or object) side of an edge.
(1) split into 4 disjointed quadrants any regions Ri where P(Ri) =false;
(2) merge any adjacent regions Rj and R k for which P(Ri ∪ Rj) =true; and
(3) stop when no further merging or splitting is possible.
Region splitting and merging
Region splitting and merging