MATLAB: How can the center be determined by the Kmeans method centerized of kmeans algorithmMATLAB Best Answer [idx,C,D] = kmeans(grayImge(:),numberOfclasses) ; C is your cneter. Read about kmeans. You can your center along with the function. The output is random..the classe indices change for every run. Related SolutionsMATLAB: K-means for a grayscale image kmeans returns a vector of cluster indices, one index per row of input. You are trying to reshape that as if it had as many entries as the number of pixels in your image.Possibly you want to tryc = kmeans(I(:), 3); MATLAB: K-means image processing color scales Refer to the Colormap Name-Value Pair Argument of the function labeloverlay.colorMap = [1 0 0; 0 0 1; 0 1 0];B = labeloverlay(I,L,'Colormap',colorMap); Related QuestionKmeans gives different results each timeHow can i choose the k initial centroids far away from each other in k-means clustering based image segmentationProblems with kmeans clustering
Best Answer