I've recently had a problem with the coloring of the data clusters in K-means image processing. I'm trying to process multiple images to sort color gradients in the image into three distinct clusters, but each time I run K-means I get different colors representing each cluster. Is there any way to control this? I'm using the basic K-means image processing that's on this site.
I = imread('north_sm_gray.bmp');
[L,Centers] = imsegkmeans([I],3);
B = labeloverlay(I,L);
title('north sm processed')