2. Image Segmentation
Segmentation attempts to partition the pixels of an image
into groups that strongly correlate with the objects in an
image
Typically the first step in any automated computer vision
application
4/28/2021
Narmada Reddy Kari
2
3. Introduction to image segmentation
Usually image segmentation is an initial and vital
step in a series of processes aimed at overall image
understanding
Applications of image segmentation include
Identifying objects in a scene for object-based
measurements such as size and shape
Identifying objects in a moving scene for object-based
video compression (MPEG4)
Identifying objects which are at different distances from
a sensor using depth measurements from a laser range
finder enabling path planning for a mobile robots
4/28/2021
Narmada Reddy Kari
3
4. Introduction to image segmentation
4/28/2021
Narmada Reddy Kari
4
Example 1
• Segmentation based on greyscale
• Very simple ‘model’ of greyscale leads to inaccuracies in
object labelling
5. Introduction to image segmentation
Example 2
• Segmentation based on texture
• Enables object surfaces with varying patterns of grey to
be segmented
4/28/2021
Narmada Reddy Kari
5
7. Introduction to image segmentation
Example 3
• Segmentation based on motion
• The main difficulty of motion segmentation is that an
intermediate step is required to (either implicitly or
explicitly) estimate an optical flow field
• The segmentation must be based on this estimate and not,
in general, the true flow
4/28/2021
Narmada Reddy Kari
7
9. Introduction to image segmentation
Example 3
• Segmentation based on depth
• This example shows a range image, obtained with a laser
range finder
• A segmentation based on the range (the object distance
from the sensor) is useful in guiding mobile robots
4/28/2021
Narmada Reddy Kari
9
10. Image Segmentation
• Group similar components (such as, pixels in an image,
image frames in a video) to obtain a compact
representation.
• Applications: Finding tumors, veins, etc. in medical
images, finding targets in satellite/aerial images, finding
people in surveillance images, summarizing video, etc.
• Methods: Thresholding, K-means clustering, etc.
4/28/2021
Narmada Reddy Kari
10
11. Image Segmentation
Segmentation algorithms for monochrome images
generally are based on one of two basic properties of gray-
scale values:
Discontinuity
• The approach is to partition an image based on abrupt changes in
gray-scale levels.
• The principal areas of interest within this category are detection of
isolated points, lines, and edges in an image.
Similarity
• The principal approaches in this category are based on
thresholding, region growing, and region splitting/merging.
4/28/2021
Narmada Reddy Kari
11
12. Image Segmentation
Segmentation algorithms generally are based on
one of two basis properties of intensity values
• Discontinuity: to partition an image based on
abrupt changes in intensity (such as edges)
• Similarity: to partition an image into regions
that are similar according to a set of
predefined criteria.
4/28/2021
Narmada Reddy Kari
12
15. Image Segmentation
Detection of discontinuities:
• There are three basic types of gray-level
discontinuities:
points , lines , edges
• The common way is to run a mask through the image
4/28/2021
Narmada Reddy Kari
15
16. Point Detection
Note that the mark is the same as the mask of Laplacian
Operation
The only differences that are considered of interest are
those large enough (as determined by T) to be
considered isolated points.
|R| >T
4/28/2021
Narmada Reddy Kari
16
18. Line Detection
4/28/2021
Narmada Reddy Kari
18
Horizontal mask will result with max response when a line
passed through the middle row of the mask with a constant
background.
the similar idea is used with other masks.
note: the preferred direction of each mask is weighted with a
larger coefficient (i.e.,2) than other possible directions.
19. Line Detection
Apply every masks on the image
let R1, R2, R3, R4 denotes the response of
the horizontal, +45 degree, vertical and -45
degree masks, respectively.
If, at a certain point in the image
|Ri| > |Rj|, for all j≠i,
That point is said to be more likely
associated with a line in the direction of
mask i.
4/28/2021
Narmada Reddy Kari
19
20. Line Detection
Alternatively, if we are interested in detecting all lines in
an image in the direction defined by a given mask, we
simply run the mask through the image and threshold the
absolute value of the result.
The points that are left are the strongest responses, which,
for lines one pixel thick, correspond closest to the
direction defined by the mask.
4/28/2021
Narmada Reddy Kari
20
22. Edge Detection Approach
• Segmentation by finding pixels on a region boundary.
• Edges found by looking at neighboring pixels.
• Region boundary formed by measuring gray value
differences between neighboring pixels
4/28/2021
Narmada Reddy Kari
22
23. Edge Detection
An edge is a set of connected pixels that
lie on the boundary between two regions.
An edge is a “local” concept whereas a
region boundary, owing to the way it is
defined, is a more global idea.
4/28/2021
Narmada Reddy Kari
23
28. Edge Detection
First column: images and gray- level
profiles of a ramp edge corrupted by
random Gaussian noise of mean 0 and
= 0.0, 0.1, 1.0 and 10.0, respectively.
Second column: first-derivative
images and gray-level profiles.
Third column : second- derivative
images and gray- level profiles.
4/28/2021
Narmada Reddy Kari
28
57. Image Thresholding
What is thresholding?
Simple thresholding
Adaptive thresholding
4/28/2021
Narmada Reddy Kari
57
58. Thresholding
Suppose that an image, f(x,y), is composed of light
objects on a dark backround, and the following
figure is the histogram of the image.
Then, the objects can be extracted by comparing
pixel values with a threshold T.
4/28/2021
Narmada Reddy Kari
58
59. Thresholding – A KeyAspect
• Most algorithms involve establishing a threshold level of
certain parameter.
• Correct thresholding leads to better segmentation.
• Using samples of image intensity available, appropriate
threshold should be set automatically in a robust
algorithm i.e. no hard-wiring of gray values
4/28/2021
Narmada Reddy Kari
59
60. Automatic Thresholding
Use of one or more of the following:-
Intensity characteristics of objects
1. Sizes of objects
2.Fractions of image occupied by objects
3.Number of different types of objects
Size and probability of occurrence – most popular
Intensity distributions estimate by histogram computation.
4/28/2021
Narmada Reddy Kari
60
64. P-Tile Thresholding
Basic global thresholding:
Based on the histogram of an image Partition the image
histogram using a single global threshold
Basic global thresholding:
The success of this technique very strongly depends on
how well the histogram can be partitioned
4/28/2021
Narmada Reddy Kari
64
65. Iterative P-Tile Thresholding
The Basic global thresholding:
1. Select an initial estimate for T (typically the
average grey level in the image)
2. Segment the image using T to produce two
groups of pixels: G1 consisting of pixels
with grey levels >T and G2 consisting
pixels with grey levels ≤ T
3. Compute the average grey levels of pixels
in G1 to give μ1 and G2 to give μ2
4/28/2021
Narmada Reddy Kari
65
76. What is a Region?
• Basic definition :- A group of connected pixels with
similar properties.
• Important in interpreting an image because
they may correspond to objects in a scene.
• For that an image must be partitioned into regions
that correspond to objects or parts of an object.
4/28/2021
Narmada Reddy Kari
76
78. Region-Oriented Segmentation
Region Growing
• Region growing is a procedure that groups pixels or subregions into
larger regions.
• The simplest of these approaches is pixel aggregation, which starts
with a set of “seed” points and from these grows regions by
appending to each seed points those neighboring pixels that have
similar properties (such as gray level, texture, color, shape).
• Region growing based techniques are better than the edge-based
techniques in noisy images where edges are difficult to detect.
4/28/2021
Narmada Reddy Kari
78
81. Region-Oriented Segmentation
Region Splitting
Region growing starts from a set of seed points.
An alternative is to start with the whole image as a single
region and subdivide the regions that do not satisfy a
condition of homogeneity.
Region Merging
Region merging is the opposite of region splitting.
Start with small regions (e.g. 2x2 or 4x4 regions) and
merge the regions that have similar characteristics (such
as gray level, variance).
Typically, splitting and merging approaches are used
iteratively.
4/28/2021
Narmada Reddy Kari
81
83. Watershed Segmentation Algorithm
4/28/2021
Narmada Reddy Kari
83
Visualize an image in 3D: spatial coordinates and gray levels.
In such a topographic interpretation, there are 3 types of points:
Points belonging to a regional minimum
• Points at which a drop of water would fall to a single minimum.
(The catchment basin or watershed of that minimum.)
• Points at which a drop of water would be equally likely to fall to
more than one minimum. (The divide lines or watershed lines.)
Watershed lines
84. Watershed Segmentation Algorithm
4/28/2021
Narmada Reddy Kari
84
The objective is to find watershed lines.
The idea is simple:
• Suppose that a hole is punched in each regional minimum and that the
entire topography is flooded from below by letting water rise through the
holes at a uniform rate.
• When rising water in distinct catchment basins is about the merge, a dam
is built to prevent merging. These dam boundaries correspond to the
watershed lines.
86. Watershed Segmentation Algorithm
4/28/2021
Narmada Reddy Kari
86
Start with all pixels with the lowest possible value.
• These form the basis for initial watersheds
For each intensity level k:
• For each group of pixels of intensity k
• If adjacent to exactly one existing region, add these
pixels to that region
• Else if adjacent to more than one existing regions,
mark as boundary
• Else start a new region
90. Watershed Segmentation Algorithm
4/28/2021
Narmada Reddy Kari
90
A solution is to limit the number of regional minima. Use markers to specify
the only allowed regional minima. (For example, gray-level values might be
used as a marker.)