Image parts and segmentation

19
- Rappy Saha (M2016006) Image parts and segmentation 1

Transcript of Image parts and segmentation

- Rappy Saha (M2016006)Image parts and segmentation 1

1

Connected Components for Foreground CleanupComparing Background Method.Watershed AlgorithmImage repair by InpaintingMean-Shift SegmentationOutline:

2

Lesson descriptions should be brief.

2

Connected Components for Foreground Cleanup:

3Connected 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.

rawlag

Lesson descriptions should be brief.

3

Connected Components for Foreground Cleanup:

4

Lesson descriptions should be brief.

4

Connected Components for Foreground Cleanup:

5First 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.

Lesson descriptions should be brief.

5

Connected Components for Foreground Cleanup:

6

Case-1Case-2

Lesson descriptions should be brief.

6

Connected Components for Foreground Cleanup:

7Comparing Background Method

Lesson descriptions should be brief.

7

Connected Components for Foreground Cleanup:

8

Lesson descriptions should be brief.

8

Watershed Algorithm:

9Any 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.

Lesson descriptions should be brief.

9

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 someregions belong together.

Lesson descriptions should be brief.

10

Watershed Algorithm:

11

Lesson descriptions should be brief.

11

Image repair by Inpainting:

12Images 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

Lesson descriptions should be brief.

12

Image repair by Inpainting :

13

src is an 8-bit single-channel grayscale image or a three-channel color imagemask is an 8-bit single-channel image of the same size as srcThe 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. Teleas method).

Lesson descriptions should be brief.

13

Image repair by Inpainting :

14

When damaged area is thick

Lesson descriptions should be brief.

14

Mean-Shift Segmentation:

15cvPyrMeanShiftFiltering(), 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.

Lesson descriptions should be brief.

15

Mean-Shift Segmentation:

16

src- input image and dst- output image, both must be8-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 wantused for segmentation.

Lesson descriptions should be brief.

16

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.

Lesson descriptions should be brief.

17

Mean-Shift Segmentation:

18

Test imageIncreasing iterations

Lesson descriptions should be brief.

18

19Thanks To All