Color based image segmentation based on http://cs.brown.edu/~pff/segment/