This article is about the theory:
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/TUZEL1/MeanShift.pdf[
^]
But I don't think, this approach is good for photos in general, rather for artificial graphics content.
1) Don't treat colors as RGB, LUV(YUV) or HSB seams more adequate. A pixel consists of it's (x,y,h,s,b) coordinates. You will need to define a distance measure for pixels. I suppose position will have to have more weight than color distance. (
Color models[
^])
For the later two you have to figure it out based on the algorithm itself. The simplest dataset would be an array.