1. - Rappy Saha (M2016006)
Image parts and segmentation
1
2. Connected Components for Foreground Cleanup
Comparing Background Method.
Watershed Algorithm
Image repair by Inpainting
Mean-Shift Segmentation
Outline:
2
3. Connected Components for Foreground Cleanup:
3
Connected component analysis is used to clean up the raw segmented images.
Mask the image using morphological operation open to shrink areas of small noise to 0.
Then the morphological operation close to rebuild the area of surviving components that was lost in opening.
raw lag
5. Connected Components for Foreground Cleanup:
5
First we declare memory storage for the connected components contour.
Then morphological operation is performed.
The routine takes two additional parameters, which here are hardcoded via #define.
9. Watershed Algorithm:
9
Any grayscale image can be viewed as a topographic surface where high intensity denotes peaks and hills
while low intensity denotes valleys.
User start filling every isolated valleys (local minima) with different colored water (labels).
As the water rises, depending on the peaks (gradients) nearby, water from different valleys, obviously with
different colors will start to merge.
To avoid that barriers are needed.
It then successively floods basins starting from user specified (or algorithm-specified) points until these regions meet.
Then the barriers gives the segmentation result.
10. Watershed Algorithm:
10
Image is an 8-bit color (three-channel) image
Markers is a single-channel integer (IPL_DEPTH_32S) image of the same (x, y) dimensions;
the value of markers is 0 except where the user (or an algorithm) has indicated by using positive numbers that some
regions belong together.
12. Image repair by Inpainting:
12
Images are often corrupted by noise.
Inpainting is a method for removing such damage by taking the color and texture at the border of the damaged
area and propagating and mixing it inside the damaged area.
When damaged area is thin
13. Image repair by Inpainting :
13
src is an 8-bit single-channel grayscale image or a three-channel color image
mask is an 8-bit single-channel image of the same size as src
The output image will be written to dst, which must be the same size and number of channels as src.
inpaintRadius is the area around each inpainted pixel that will be factored into the resulting output color of that pixel.
flags parameter allows you to experiment with two different methods of inpainting: CV_INPAINT_NS
(Navier-Stokes method), and CV_INPAINT_TELEA(A. Telea’s method).
15. Mean-Shift Segmentation:
15
cvPyrMeanShiftFiltering(), a similar algorithm of the function cvPyrSegmentation(), based on
mean-shift clustering over color.
Mean-shift segmentation finds the peaks of color distributions over space.
16. Mean-Shift Segmentation:
16
src- input image and dst- output image, both must be
8-bit, three-channel color images of the same width and height.
spatialRadius and colorRadius define how the mean-shift
algorithm averages color and space together to form a segmentation.
max_level describes how many levels of scale pyramid you want
used for segmentation.
17. Mean-Shift Segmentation:
17
CV_TERMCRIT_ITER or CV_TERMCRIT_EPS, which tells the algorithm that we want to terminate either
after some fi xed number of iterations or when the convergence metric reaches some small value (respectively).
max_iter limits the number of iterations if CV_TERMCRIT_ITER is set.
epsilon sets the error limit if CV_TERMCRIT_EPS is set.