Updated DIP UNIT4-2024
Updated DIP UNIT4-2024
Image segmentation is a method in which a digital image is broken down into various
subgroups called Image segments which helps in reducing the complexity of the image to make
further processing or analysis of the image simple
5. What are the two properties used for establishing similarity of edge pixels?
(a) The strength of the response of the gradient operator used to produce the edge pixel.
(b) The direction of the gradient.
1
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Types of Edges:
(a) Ideal Edge
(b) Ramp Edge
(c) Line Edge
(d) Roof Edge
11. What are the various techniques that can be used for edge linking?
The various techniques used for edge linking are
(a) Local Processing
(b) Global Processing via Hough Transform
(c) Global Processing via Graph Theoretic Techniques.
13. What is Thresholding? What are its types (OR) How an image are segmented
using thresholding?(APR/MAY-19)
Thresholding is the process of segmenting an image based on a threshold value that separates
the object and background of the image. Certain images will contain multiple objects, which
can be segmented using multiple thresholds.
Types of Thresholding
(a) Global Thresholding
(b) Variable Thresholding
(c) Regional (or) Local Thresholding
(d) Dynamic (or) adaptive thresholding
3
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
The selection of similarity criterion depends not only on the problem consideration but
also on the type of image data available which affects the region growing.
Descriptors can yield misleading results if connectivity or adjacency information is not
used in region growing process.
Formulation of stopping rule affects the region growing.
19. What are the limitations of region oriented segmentation techniques? [JUNE 2010]
Current region dominates the growth process -- ambiguities around Edges of adjacent
regions may not be resolved correctly.
Different choices of seeds may give different segmentation results.
Problems can occur if the (arbitrarily chosen) seed point lies on an edge.
20. State the conditions to be met by the partitions in region based segmentation? [NOV
2011]
Let R – be the entire region of the image.
The predicate P(Ri) is used to check the condition. In any region, if P(Ri)= true, then
image is subdivided into various sub images.
If P(Ri) = false, then divide the image into quadrants. If P(Ri) = false, then further divide
the quadrants into sub quadrants.
4
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
5
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
34. How the derivatives are obtained in edge detection during formulation? (APR/MAY-
18)
The first derivative at any pointin an image is obtainedby using the magnitude of the gradient at
that point.similarly, the second derivatives are obtained by using the laplacian.
The sobel technique perform 2D spatial gradiant of an image and highlights region of high
spatial frequency that correspond to edge. In general it used to find estimated absolute gradient
magnitude at each point in n input gray scale image.
Z1 Z2 Z3 -1 -2 -1 -1 0 1
Z4 Z5 Z6 0 0 0 -2 0 2
Z7 Z8 Z9 1 2 1 -1 0 1
6
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
PART-B
1. What is edge detection? Describe in detail about the types of edge detection
operation?(or) Explain how edges of different orientations can be detected in an
image?[NOV 2011& NOV 2012] &[Nov 2014][APR/MAY-19]
Detection of Discontinuities
1st order derivatives, produce thicker edge in an image. 2nd order derivatives detect fine detail
such as thin lines, isolated points and noise.
Types of detection:
1. Point detection
2. Line Detection
3. Edge detection
Edge detection is used for determining the discontinuities in gray level.
Edge:
An edge is a boundary between two regions with relatively gray level properties different.It is
a set of connected pixels that lie on the boundary between two regions.
An ideal image edge is a set of connected pixels in the vertical direction where edge of the
pixel is located at an orthogonal step transition in gray level.
Edges are blurred, due to optics, sampling and other image acquisition imperfections.
7
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Thick edges of ramp are inversely proportional to the degree of blurring in the edge.
The thickness is determined by length of ramp. Length is determined by slope, in turn
determined by degree of blurring. Blurred image edges tends to be thick of sharp edge tend to
be thin.
Use of Operator:
1. First derivative operator-Gradient.
2. Second derivative operator-Laplacian
|∇𝑓| =
8
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
P4 P5 P6
P7 P8 P9
-1 -1 -1
0 0 0
1 1 1
-1 0 1
-1 0 1
-1 0 1
Gx edge detection in Horizontal detection
Gx = (P7 + P8 + P9) – (P1 + P2 + P3)
Gy = (P3 + P6 + P9) – (P1 + P4 + P7 )
(Edge detection in vertical detection)
Where P1 ……. P9 Pixel values in subimage
P1 P2 P3
P4 P5 P6
P7 P8 P9
3x3 Images
-1 -2 -1
0 0 0
1 2 1
-1 0 1
-2 0 2
-1 0 1
For horizontal detection
Gx = (P7 + 2P8 + P9) – (P1 + 2P2 + P3)
To find Gy:-
Gy = (P3 + 2P6 + P9) – (P1 + 2P4 + P7)
10
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
P4 P5 P6
P7 P8 P9
3x3 Images
Laplacian Mask
0 -1 0
-1 4 -1
0 -1 0
For 3x3 images, the Laplacian operator is given below
The coefficients associated with center pixels are positive & negative.
Sum of coefficients is zero.
Drawbacks:
1. It is highly sensitive to noise.
2. Its magnitude produces double edges, which makes the segmentation difficult.
3. It is unable to detect edge detection.
2. Explain in detail about the process of edge linking and boundary detection? (Or) How
do you link edge pixels through global processing? (May/June-2013)(Or) how do you link
edge pixels through hough transform. {May 2015] (NOV/DEC-18)
Linking the edges of an image is done by edge linking and boundary detection.
11
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
The following techniques are used for edge linking and boundary detection.
1). Local processing.
2). Global processing using Hough transform.
3). Global processing using graph theoretic approach.
1) Local processing:-
One method for linking edges is to analyze the characteristic pixel in small neighborhood
about every point in an image.
There are ‘n’ points in an image. We have to find the subsets of points that lie on standard
lines.
One possible solution is to first find all lines. They are determined by every pair of points &
then find all subsets of points that are close to particular lines.
Infinitely many lines past through (xi, yi) but all satisfy the equation yi = axi + b
For varying a & b. However writing this equation as b= -axi + yi and considering ab plane
yields the equation of a single line for fixed pair (x i, y i). Further a second point (x i , y i ) also
has a lines in parameter space associated with it and this line intersects the line associated with
(x i , y i ) at (a’, b’)
[where a’ – slope & b’ – intercept of line]
y b’
The computational bminattractiveness bmaxof the Hough transform arises from subdividing the
parameter space into Accumulator cells.
Accumulator cells:
An important property of Huff transform is that the parameter space can be subdivided into
cells which is referred as accumulator cells.
Procedure:
1) Compute the gradient of an image and threshold
2) Specify subdivision in the plane
3) Examine the count of accumulator cell for high pixel concentration
4) Examine the relationship between the pixels
13
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Applications:
1) In addition to straight line, Huff transform has applied to any function
2) Huff transform can be used to detect curves without any simple analytical representation.
3. Explain the concept of thresholding in image segmentation and discuss the merits and
limitations? [NOV 2008]
This is the important technique used for image segmentation. It is used to separate the
objects present in an image from its background.
Basic concept:-
Let us consider histogram of an image f(x, y) which consist of light objects on a dark
background.
Types:
1. Single thresholding
2. Multilevel thresholding.
1. Single thresholding
Dark background Object
The histogram consists of two dominant regions one for dark background & other for
object.
T is used for represent the threshold value. If f(x, y) >T, then corresponding point is
known as object point & otherwise if f(x,y)<=Ts/2, the point known as background point.
2. Multilevel thresholding:
Now we can consider the histogram which corresponds to the two different light objects on
dark background. T1&T2 are 2 threshold values as shown in fig.
14
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
T1 T2
0 – Indicates background
1 – Indicates objects
Thresholding is divided into three types:
1. Global thresholding.
2. Local thresholding.
3. Adaptive and dynamic thresholding.
1. Global thresholding.
If T value depends only on gray levelf(x, y) then the threshold technique is known as global
thresholding.
2. Local thresholding.
If T depends on f(x, y) & P(x, y) then the threshold technique is known as local
thresholding.
15
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Optimal thresholding:-
If an image has 2 main brightness regions then
P(z) = Probability density function of gray level values in an image.
Overall P(z) = sum of two densities
= (Density for light region + Density for dark region)
If the density function is a known value, then optimal threshold for segmenting the image
into two brightness regions can be determined.
Overall P(z) = P1 x P1 (z) + P2 x P2 (z)
m1 , m2 - mean values for two brightness level.
σ1 , σ2 - SD of mean
P1 , P2 - Probability of 2 gray levels.
The Probability of error to classify an object point as background point is given as,
The Probability of error to classify the background point as object point is given as,
If P1 = P2, then nth optimal threshold is the mean average & it is given by,
Where, T – Optimal threshold,
16
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
4. Explain in detail about region growing process in detail? [APRIL 2010, May-2013] (or)
Explain region based segmentation and region growing with an example.(OR) Discuss
how the seed points are used for region growing and how image segmentation can be
done by splitting and merging the region of image? [May 2015](N/D 16, 17) [A/M-19, 21]
(1).
(2). Ri is a connected region for i=1, 2 … n,all the pixels in the region should be connected.
(3). Ri∩ Rk = Ф for all i & k, where i ≠ k. this shows that region must be disjoint. No pixel
should be presenting two different regions.
(4). P(Ri) = true, for i=1, 2, ………n, all pixels in region R i have same intensity levels.
(5). P(Ri URk) = false, for i ≠ k, this shows that R i&Rk are different. The pixels in two
adjacent regions should not have same intensity.
Steps:
1. Find seed points.
2. Find the similarity pixels.
3. Find the stopping point.
17
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Region growing is a process of rating pixels or sub regions into larger regions based on pre-
defined similarity criteria.
This approach starts with a set of start point known as “seed points”. Then the neighbouring
pixel having property that is similar to the seed are added to each seed. Thus new regions are
grown.
Similarity criteria:
It is based on intensity value, texture, color, size, and shape of the region being grown.
1 0 5 6 7
1 0 5 5 5
0 12 6 77 6
1 2 5 6 7
18
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
1 1 7 6 5
Values inside the boxes are gray level .Two seeds are 2 & 7.
The location of 2 is (4, 2) & the location of 7 is (3, 4).
These are the starting points. Then the regions are grown.
Here Th = 3
The absolute difference between gray level of that pixel and the gray level of seed must be
less than the threshold values
R1 R1 R2 R2 R2
R1 R1 R2 R2 R2
R1 R1 R2 R2 R2
R1 R1 R2 R2 R2
R1 R1 R2 R2 R2
Region 1 Region 2
5. Explain the principle of Region splitting and merging in details. [APRIL 2010, NOV
2011, May-2013, NOV 2012) (May/June 17)[NOV/DEC-18] &[May 2021]
Region splitting and merging is a segmentation process in which an image is initially
subdivided into a quadrant and then the regions are merged (or) splitted to satisfy the basic
conditions.
In this technique, the image is divided into various sub images of disjoint regions and then
merges the connected region together.
R – be the entire region of the image.
The predicate P(Ri) is used to check the condition. In any region, if P(Ri)= true, then image
is subdivided into various subimages.
If P(Ri) = false, then divide the image into quadrants. If P(Ri) = false, then further divide the
quadrants into sub quadrants.
R1
R11 R12
R2
R13 R14
R3 R4
Region R11 is divided into quadrants.
Quad tree:
A Quad tree is a tree in which the nodes have exactly four descendants (Followers).
This is shown in quadrants representation as shown below
19
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Quadtree representation
Example for split & merge algorithm is shown below:-
R1 R2 R3 R4
xxxxxx xxxxxx
R233 R234
xxxxxx xxxxxx
20
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Advantages:
It uses the same quad tree for splitting and merging.
6. Compare restoration with image enhancement. (Nov 2014) (8 marks)
Basic concept:
Image is visualized in 3 dimensions
1) Two spatial dimensions.
2). Gray level
Any gray tone image may be considered as topological surface.
The main aim of the segmentation algorithm based on this concept is to find watershed lines.
Catchment basins:-
Points at which water drop, if placed at locations of any of those points would fall to single
minimum is called as watershed lines.
22
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Watershed lines:-
Points at which water drop would fall more than one such minimum is called as watershed
lines.
A line is build to prevent the rising water from, distinct catchment basins form merging.
Only the taps of down are visible above the water line.
These dam boundaries correspond to the divide lines of water sheds.
They are the connected boundaries by watershed segmentation algorithm.
In order to prevent structure, higher height dams are calculated.
The value of height is determined by highest possible gray level value in the input image.
(i) Erosion:
In words, this equation indicates that the erosion of A by B is the set of all points z such
that B, translated by z, is contained in A. In the following discussion, set B is assumed to be a
structuring element.
The statement that B has to be contained in A is equivalent to B not sharing any common
elements with the background; we can express erosion in the following equivalent form:
23
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
The elements of A and B are shown shaded and the background is white.
The solid boundary in Fig. 9.4(c) is the limit beyond which further displacements of the
origin of B would cause the structuring element to cease being completely contained in A.
Thus, the locus of points (locations of the origin of B) within (and including) this
boundary, constitutes the erosion of A by B.
We show the erosion shaded in Fig. 9.4(c).
Keep in mind that that erosion is simply the set of values of z that satisfy Eq. (9.2-1) or
(9.2-2)
The boundary of set A is shown dashed in Figs. 9.4(c) and (e) only as a reference; it is
not part of the erosion operation.
Figure 9.4(d) shows an elongated structuring element, and Fig. 9.4(e) shows the erosion
of A by this element. Note that the original set was eroded to a line.
Equations (9.2-1) and (9.2-2) are not the only definitions of erosion (see Problems 9.9
and 9.10 for two additional, equivalent definitions.)
However, these equations have the distinct advantage over other formulations in that
they are more intuitive when the structuring element B is viewed as a spatial mask (see Section
3.4.1).
Thus erosion shrinks or thins objects in a binary image. In fact, we can view erosion as a
morphological filtering operation in which image details smaller than the structuring element
24
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
are filtered (re-moved) from the image. In Fig. 9.5, erosion performed the function of a "line
filter."
(ii) Dilation
This equation is based on reflecting B about its origin, and shifting this reflection by z
(see Fig. 9.1).
The dilation of A by B then is the set of all displacements, z, such that B and A overlap
by at least one element. Based on this interpretation, Eq. (9.2-3) can be written equivalently as
Equations (9.2-3) and (9.2-4) are not the only definitions of dilation currently in use (see
Problems 9.11 and 9.12 for two different, yet equivalent, definitions).
However, the preceding definitions have a distinct advantage over other formulations in
that they are more intuitive when the structuring element B is viewed as a convolution mask.
The basic process of flipping (rotating) B about its origin and then successively
displacing it so that it slides over set (image) A is analogous to spatial convolution, as
introduced in Section 3.4.2.
Keep in mind, however, that dilation is based on set opera- tions and therefore is a
nonlinear operation, whereas convolution is a linear operation.
Unlike erosion, which is a shrinking or thinning operation, dilation "grows" or
"thickens" objects in a binary image.
The specific manner and extent of this thickening is controlled by the shape of the
structuring element used.
Figure 9.6(a) shows the same set used in Fig. 9.4, and Fig. 9.6(b) shows a structuring
element (in this case B = B because the SE is symmetric about its origin).
The dashed line in Fig. 9.6(c) shows the original set for reference, and the solid line
shows the limit beyond which any further displacements of the origin of B by z would cause
the intersection of B and A to be empty.
Therefore, all points on and inside this boundary constitute the dilation of A by B.
Figure 9.6(d) shows a structuring element designed to achieve more dilation vertically
than horizontally, and Fig. 9.6(e) shows the dilation achieved with this element.
25
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
8. Discuss how the water flooding and Dam construction is related to watershed
segmentation. [May 2021]
The concept of watersheds is based on visualizing an image in 3 dimensions:-
1). Two Spatial coordinates Vs Intensity.
In topographic interpretation, we consider 3 types of points:-
1). Points belonging to a regional minimum.
2). Points at which a water drop placed at the location of any point would fall to
single minimum.
3). Points at which water would fall to more than one such minimum.
The set of points that satisfy the condition 2 is called as “catchment basin” or “watershed of
that minimum”.
The points satisfying condition 3 form crest line on surface and defined as watershed lines.
Dam construction is based on binary image, which are members of 2D – integer space.
The Dam must be built to keep water from spilling across the basins.
Let M1 & M2 be set of coordinates of the points in the two regional minima.
The set of coordinates of the points in the catchment basin associated with the two minima
in the flooding level n be Cn(M1) & Cn(M2) – let the union of these sets be C[n].
26
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
27
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Fig b shows water has spilled between basins of a dam must be built to keep this
from happening.
Now let q denotes the connected component formed in fig b by dilation from
flooding n-1 stage to n stage.
Set of coordinates of points in catchment basins with these two minima at stage n-1
be denoted as
Cn-1 (M1) & Cn-1 (M2) respectively.
At any step n of flooding process, the algorithm needs to know the numbers of points below
the flood depth.
The coordinates in T[n} that are below the plane g(x, y) =n are marked as black, and
all other coordinates marked as white.
28
EC8093- DIP UNIT IV – IMAGE SEGMENTATION
Then we will see the binary image on xy plane at any increment n of flooding.
Let Cn(M1) be set of points in catchment basin associated with M1.
Cn(Mi) = C(Mi) ∩ T[n]
Where, Cn(Mi) = 1 at location (x, y) if (x, y) ε C(Mi) and (x, y) ε T[n], otherwise it is 0.
C[n] be the union of flooded catchment basin portions at stage n.
Algorithm keeps on increasing the levels of flooding, Cn(Mi) & T[n] remains
constant or increase.
Algorithm initializes C[min+1] = T[min +1] and then proceeds recursively.
Let Q be set of connected components in T[n].
For each connected component, q ε Q[n]
There are 3 possibilities:-
(a). q ∩ C[n-1] is empty.
(b). q ∩ C[n-1] contains one connected component of C[n-1]
(c). q ∩ C[n-1] contains more than one connected component of C[n-1].
Condition (a) occurs when a new minima is encountered in this case, Q is added to
set C[n-1] to form C[n].
Condition (b) occurs when q lies within a catchment basin of some minima.
Condition (c) occurs when ridge between two catchment basin.
A one pixel thick dam can be constructed when needed by dilating q ∩ C[n-1] with
3x3 matrix of 1’s.
Histogram of g(x, y) can be used to evaluate min, max and these values.
Region is characterized by small variations, so watershed segmentation is applied.
Drawbacks:
Sensitivity to noise
Low contrast boundaries
Poor detection of thin edges
29