MATLAB: Kmeans on RGB/ Lab colorspace

kmeanslab colorspacergb

Hi , I performed k means on an rgb image after converting it to lab colorspace. I also performed k means on the rgb image directly. The former gave better results. Conceptually I would like to know the reason behind this difference in results??? Please enlighten me..

Best Answer

Because the color space is a different shape. It's hard to predict what happens to the clusters (their shapes) after you do that kind of non-linear transform. You might want to download and install ImageJ http://rsbweb.nih.gov/ij/download.html and the Color Inspector 3D plugin http://rsbweb.nih.gov/ij/plugins/color-inspector.html so that you can visualize the 3D color gamuts. You will be glad you did because it is very enlightening and informative. MATLAB does not (yet) have this capability.