Download the software you need.
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 |
This assignment has two major components, color clustering and skin finding.
Color ClusteringFirst, 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:
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 FindingUsing 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.
You must turn in:
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.