Image Segmentation: Subject: FIP (181102) Prof. Asodariya Bhavesh ECD, SSASIT, Surat
Image Segmentation: Subject: FIP (181102) Prof. Asodariya Bhavesh ECD, SSASIT, Surat
Image Segmentation: Subject: FIP (181102) Prof. Asodariya Bhavesh ECD, SSASIT, Surat
R ≥T
where T : a nonnegative threshold
Detection of Discontinuities
Line Detection
• First-order derivatives:
– The gradient of an image f(x,y) at location (x,y) is
defined as the vector:
G x ∂f
∂x
∇f = = ∂f
G y ∂y
– The magnitude of this vector: [
∇f = mag(∇f ) = Gx2 + G y2 ] 1
2
Gx
– The direction of this vector: α ( x, y ) = tan
−1
G
y
– It points in the direction of the greatest rate of change
of f at location (x,y)
Detection of Discontinuities
Gradient Operators
Detection of Discontinuities
Gradient Operators
Prewitt operators
Sobel operators
Detection of Discontinuities
Gradient Operators
∇f ≈ G x + G y
Detection of Discontinuities
Gradient Operators: Example
Detection of Discontinuities
Gradient Operators: Example
Detection of Discontinuities
Gradient Operators: Example
Detection of Discontinuities
Gradient Operators
∂x ∂y
∂ 2 G ( x , y ) ∂ 2 G ( x, y )
∇ G ( x, y ) =
2
+
∂x 2 ∂y 2
∂ − x − 2σ 2 ∂ − y − x + y2
2 2 2 2
x +y
∇ G ( x, y ) =
2
e + e 2σ
∂x σ 2
∂y σ 2
x2 + y2 x2 + y 2
x 1 2 − y 1 2 −
∇ 2G ( x, y ) = 4 − 2 e 2σ 2
+ 4 − 2 e 2σ 2
σ σ σ σ
x2 + y2
x + y − 2σ
2 2 2 −
∇ 2G ( x, y ) = e 2σ 2
σ 4
This expression is called Laplacian of a Gaussion (LoG)
More Advanced Techniques for Edge Detection
Detection of Discontinuities
Gradient Operators: Example
Sobel gradient
The major problem with this algorithm is that it does not work for
vertical lines, as they have a slope of infinity
Convert line into polar coordinates ρ = x cosӨ + ysinӨ, where Ө is the
angle between the line and x-axis, and ρ is the diameter
Edge Linking and Boundary Detection
Global Processing via the Hough Transform
2,3,4
1,4
Edge Linking and Boundary Detection
Hough Transform Example
Thresholding
r ( x, y ) (a) (c) i ( x, y )
(d) (e)
f ( x, y ) = i ( x , y ) r ( x , y )
Thresholding
Basic Global Thresholding
Thresholding
Basic Global Thresholding
Thresholding
Basic Adaptive Thresholding
Thresholding
Basic Adaptive Thresholding
Answer: subdivision
Thresholding
Optimal Global and Adaptive Thresholding
Color image
Region-Based Segmentation
• It states that a region is coherent if all the pixels of that region are
homogeneous with respect to some characteristics such as colour,
intensity, texture, or other statistical properties
•Selection of the initial seed: Initial seed that represent the ROI should
be given typically by the user. Can be chosen automatically. The seeds
can be either single or multiple
•Assume seed point indicated by underlines. Let the seed pixels 1 and 9
represent the regions C and D, respectively
•If the difference is less than or equal to 4 (i.e. T=4), merge the pixel
with that region. Otherwise, merge the pixel with the other region.
Split and Merge Algorithm
8 8 8
8 8 8
Region-Based Segmentation
Region Growing
Region-Based Segmentation
Region Growing
• This process is repeated for each quadrant until all the regions meet
the required homogeneity criteria. If the regions are too small, then the
division process is stopped.
•1) Split and continue the subdivision process until some stopping
criteria is fulfilled. The stopping criteria often occur at a stage where no
further splitting is possible.
•2) Merge adjacent regions if the regions share any common criteria.
Stop the process when no further merging is possible
Region-Based Segmentation
Region Splitting and Merging