This is a programming assignment. You are asked to experiment with two methods implemented in the OpenCV library. One is the Mean Shift based segmentor; another is Watershed superpixel algorithm. Details of the two are given below.

Part (a): Mean Shift Segmentor

Implement and test a Mean Shift Segmentor. The Mean shift algorithm is given by the function PyrMeanShiftFiltering. Following link provides the declaration of the function in OpenCV documentation:


Note 1: We will do the image segmentation based on LAB color space in this problem.

Note 2: You only need to use a level-1 pyramid for this assignment with different spatial window radius and different color window radius values.

Part (b): Watershed Segmentor

Implement and test a marker-based image segmentation using Watershed Segmentor. The Watershed algorithm is given by the function watershed. Following link provides the declaration of the function in OpenCV documentation:


Note: One of the input, “markers” map, is the initialization of the “seeds” for the image regions.

You can define it manually.

You will need to write code to invoke the functions given above, and to display the results. Apply your segmentors to the given image data. Vary the key parameters involved in the two algorithms to see the effects on the segmentation results. You are also asked to perform a qualitative comparison between the algorithms with the ground truth boundaries.

Image Data:

Following links provide access to three images and their corresponding ground truth boundaries.




What to Submit?

You should submit the following:

  1. A brief description of the programs you write (include the source listing). Include comments in your code.

  1. Test results on the given images with a few different values of the applicable parameters. Obviously, one can easily create hundreds of results by varying parameters; just include a few that you think illustrate the key differences.

  1. An analysis of your test results. This should include a discussion of the effects of the choice of relevant parameters and how one might make a good choice of these parameters. Base your conclusions on your test results rather than on the observations made by the instructor or the authors of the books and papers.

error: Content is protected !!