CSE 455: Homework Set 2
Color Clustering and Skin Finding

Materials

Download the software you need.

Download the set of images.

Contents

In this assignment, you will segment images by color, using the k-means algorithm. You will also try to classify the skin areas on the face images using the generated clusters.

face image segmented by color skin pixels highlighted

What To Do

This assignment has two major components, color clustering and skin finding.

Color Clustering

First, implement kmeans, the basic k-means clustering algorithm in RGB color space. You can initialize the clusters any way you like. The number of clusters k should be given as input.

Then, extend your algorithm in both of the following ways:

  1. Use normalized RGB color space, or HSV color space, or any color space of your choosing that separates luminance (intensity) from chrominance (color).
  2. Initialize the clusters in a more intelligent way. Either look at the image and select good color seeds (manually), or use the image's color histogram to do this automatically, or initialize the clusters by assigning pixels to them spatially.

Try running k-means on the provided images (or your own images) with different values of k, and in different color spaces, and with different cluster initialization methods. Feel free to shrink the images before using them, but try to keep both dimensions above 200 pixels.

Skin Finding

Using the results of k-means, you can develop a simple skin finder.

First, divide the set of images into training images and test images. Then, run k-means on the training images. You should use a color space that separates luminance from chrominance. You may even want to remove the luminance channel.

Then, use conrgn to divide each color cluster into connected regions.

Now look at the regions that consist of skin pixels. Either manually or automatically, come up with your own characterization of skin pixels. This could be a mean color and a maximum distance in color space, or anything else of your choosing.

Finally, use your characterization of skin pixels to write a function findskin, which identifies skin pixels in color images. Run this function on the test images.

Turnin

You must turn in:

  1. your code for kmeans and findskin, along with any other functions you write
  2. a description of how you implemented these two functions and any others you write, making sure to address the details left open-ended by the assignment (k-means initialization method, color space, etc.)
  3. the results of your k-means algorithm on the following images (use autocolor to make them look nice):
    1. face9.ppm
    2. face4.ppm
    3. face6.ppm
    4. cannonbeach37.ppm
    5. cherry_3.ppm
  4. the results of your skin finding algorithm on the following images:
    1. nineFaces.ppm
    2. greenlake27.ppm
    3. threeKids.ppm
    4. 455class1.ppm
    5. face8.ppm

Please turn in your homework to Ian (iansimon@cs).

Your homework turnin can be a Word document, PDF document, or web page. If you create a web page, just send Ian the URL, and not the files themselves. If you create a Word or PDF document, you can either include the required images and code in the document itself, or you can submit a zip archive.

Homework is due on Thursday, January 27th, by 11:59 PM.

New Image from George

indonesia.ppm