Lecture_2(DIP) (1)
Lecture_2(DIP) (1)
Oishi Jyoti
Lecturer
Dept. of ECE, RUET
Reference Book
Consider the following image and structuring element. Then find out the connected component in the image.
1 1 1 0 0 0 0 1 1 1
1 0 1 0 0 0 0 1 1 1
1 1 1 0 0 1 1 1 1 1
1 1 0 0 0 1 1
1 1 0 0 1 1 1
1 0 1 1 0 0 1
0 0 1 1 1 1 1
Other algorithms
➢ Thinning
➢ Thickening
➢ Skeleton
➢ Pruning
Thinning
➢ To remove selected foreground pixels from binary images
➢ Reduces the area of shape from every side of the image
➢ It also an application of hit-or-miss transform
➢ It an iterative method
➢ Mathematically can derived as
• Thinning of a set A of foreground pixels by a structuring element B, can be defined in terms of the hit-or-miss
transform:
1 1 0 0 0 0 0 1 1 1 × ×
1 1 1 1 1 1 1 1 0 0 × 1 × 1 1 1 1
1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 × × 1 1
1 1 1 1 1 1 1 1 0 0
B1 B2 …………… B8
1 1 1 0 0 1 1 1 0 0
❖ Similarity
1. Thresholding
2. Region growing
3. Region split
Image Segmentation
⁂ Point Detection
- Done using sharpening filters. (Laplacian kernel)
Image Segmentation
⁂ Point Detection
Image Segmentation
⁂ Line Detection
- We use 2nd order derivatives which result in a thinner line than first
derivative.
Image Segmentation
⁂ Line Detection
Image Segmentation
⁂ Edge Detection
- Used frequently for segmenting image based on abrupt changes in intensity
- Thicker lines : Robert-cross, Prewitt, Sobel Operators (First derivative)
- Thinner line : Laplacian(2nd Order)
- Maximum Edge strength in a predetermine directions : Kirsch Compass
- Canny Edge Detection
Image Segmentation
0 1 1 -1 -1 0
⁂ Edge Detection
-1 0 1 -1 0 1
-1 -1 0 0 1 1
0 1 2 -2 -1 0
-1 0 1 -1 0 1
-2 -1 0 0 1 2
Better noise
suppression
Image Segmentation
Image Segmentation
0 -1 0 -1 -1 -1
-1 4 -1 -1 8 -1
Second order kernels (The Laplacian)
0 -1 0 -1 -1 -1
Canny Edge Detection
Noise Reduction
Gradient Calculation
Non-Maximum Suppression
Double Thresholding
Hysteresis
Canny Edge Detection
Noise Reduction
Since edge detection is susceptible to noise in the image, first step is to remove the
noise.
Canny Edge Detection
Gradient Calculation
Smoothens image is filtered with a sobel kernel in both X and Y direction to get
derivatives.
Canny Edge Detection
Non-Maximum Suppression
The final image should have thin edges. Thus, we must perform non-maximum
suppression to thin out the edges.
The algorithm goes through all the points on the gradient intensity matrix and finds the
pixels with the maximum value in the edge directions.
Canny Edge Detection
Double Thresholding
More than maxVal = edges,
less than minVal = not edges
Canny Edge Detection
Hysteresis
Connected with ‘sure-edges’ pixel is considered to be part of edges.
Image Segmentation of Gray Image
⁂ In bi-level thresholding, image is segmented into two different regions.
⁂ The pixels with gray values greater than a certain value T are classified as object pixels, and
the others with gray values lesser than T are classified as background pixels.
⁂ Gray scale image contains pixel value within 0 to 255.
Image Segmentation of Gray Image
WaterShed Algorithm
⁂ The watershed is a classical algorithm used for segmentation, for separating
different objects in an image.
WaterShed Algorithm
⁂ Watershed : A watershed is the area of the land that drains to a particular
points along a stream
WaterShed Algorithm
⁂ Algorithm –
1. Start with pixels with lowest possible
values.
2. For each pixel intensity –
>> If there is adjacent pixel within one
region, add the pixel to that region.
>> Else if there is adjacent pixel which is
adjacent to more region, mark as boundary.
>> Else start new region
Watershed Algorithm
General Segmentation :
Watershed Algorithm
Watershed Segmentation :
THANK YOU