chapter-2
chapter-2
Image Segmentation
Image segmentation partitions the set X into the subsets R(i),
i=1,…,N having the following properties
X = i=1,..N U R(i)
R(i) ∩ R(j) = 0 for I ≠ j
P(R(i)) = TRUE for i = 1,2,…,N
P(R(i) U R(j)) = FALSE for i ≠ j
Region-growing
1) Choose the seed pixels (one for every segment).The first pixel selected
can be just the first unlabeled pixel in the image or a set of seed pixels
can be chosen from the image
2) Check the neighboring pixels and add them to the region if they are
similar to the seed
3) Repeat step 2 for each of the newly added pixels; stop if no more pixels
can be added
Thresholding
1. Split (& merge) starts from the assumption that the entire image is homogeneous
2. If this is not true (by the homogeneity criterion), the image is split into four sub images
3. This split is repeated until no further splitting is possible
æ Gy ö
• Direction (angle is measured w.r.t x axis): a (x, y ) = tan çç ÷÷
-1
è Gx ø
Methods of Edge Detection
First Order Derivative / Gradient Methods
• Roberts Operator
• Sobel Operator
• Prewitt Operator
Second Order Derivative
• Laplacian
• Laplacian of Gaussian
• Difference of Gaussian
Optimal Edge Detection
• Canny Edge Detection
Robert Operator
Sobel Operator
These Kernels are applied separately to input image because separate measurements
can be produced in each orientation i.e Gx and Gy.
Sobel Operator
Gradient Methods – Prewitt Operator
Prewitt Operator
The Laplacian edge detection algorithm is a simple and efficient method for detecting edges in images.
• It works by calculating the Laplacian of the image, which is a measure of the second derivative of the
image.
• The Laplacian of an image is zero at all points where the image is smooth, but it will be positive at
points where the image has a sharp change in intensity, such as at edges.
❑Defined as
0 1 0
❑Very susceptible to noise, filtering required, use Laplacian 1 -4 1
of Gaussian 0 1 0
Laplacian of Gaussian (LoG)
(Marr-Hildreth operator)
▪ Filter the input image with a nxn Gaussian lowpass filter. N is the smallest
odd integer greater than or equal to 6
▪ Compute the Laplacian of the image resulting from step1
▪ Find the zero crossing of the image from step 2
g ( x, y) = G( x, y) f ( x, y)
2
Decomposition of LoG
• It can be shown than LoG can be written as follows:
actual LoG
approximation
Gradient vs LoG
step edge
Advantage of DoG
▪ Close approximation of LoG
▪ Less computation effort
▪ Width of edge can be adjusted
by changing s1 and s2
Second Order Derivative Methods - Difference of Gaussian - DoG
LoG requires large computation time for a large edge detector mask
To reduce computational requirements, approximate the LoG by
the difference of two LoG – the DoG
x 2+ y 2 x 2+ y 2
−( ) −( )
212
e 2 2
2
e
DoG ( x, y ) = −
2 1 2 2
2 2
Sheet -1
1)Do histogram stretching for the following 8 x 8 graylevel image
0 0 0 0 0 0 0 0
0 0 4 4 4 4 4 0
0 4 5 5 5 5 4 0
0 4 5 7 7 5 4 0
0 4 5 7 7 5 4 0
0 4 5 6 6 5 4 0
0 4 5 5 5 5 4 0
0 4 4 4 4 4 4 0
Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the
intensity distribution shown in following table.
Get the histogram equalization transformation function and give the ps(sk) for
each sk.
→1
0
s0 = T (r0 ) = 7 pr (rj ) = 7 0.19 = 1.33
j =0
1
s1 = T (r1 ) = 7 pr (rj ) = 7 (0.19 + 0.25) = 3.08 →3
j =0
s2 = 4.55 →5 s3 = 5.67 →6
s4 = 6.23 → 6 s5 = 6.65 →7
s6 = 6.86 →7 s7 = 7.00 → 7