File Exchange

image thumbnail

K-means segmentation

version 1.0.0.0 (11.9 KB) by Alireza
This code implements K-means color segmentation

42 Downloads

Updated 27 Aug 2015

View License

Demo.m shows a K-means segmentation demo

K-means clustering is one of the popular algorithms in clustering and segmentation. K-means segmentation treats each imgae pixel (with rgb values) as a feature point having a location in space. The basic K-means algorithm then arbitrarily locates, that number of cluster centers in multidimensional measurement space. Each point is then assigned to the cluster whose arbitrary mean vector is closest. The procedure continues until there is no significant change in the location of class mean vectors between successive iterations of the algorithms.

Comments and Ratings (9)

yao zhang

kindly requesting friends. could any any one explain this code clearly?i didn't understand the operation in that.

Ana Campos

Hi, thank you.
Could you include a confusion matrix in the code? I would like to see the resutls and compare with different images.

Aeolus Exe

what's the meangin of "NAN centers"
thanks

Alireza

To compute the accuracy, you will need the ground truth for test images. By subtracting and computing the difference between each segment's pixel with groundtruth the error and accuracy can be computed.

Anis Mahmon

Hai Alireza thank you for it..
can you explain how to get the accuracy or plotting of image segmentation..I really hope u can help me, thanks

MATLAB Release Compatibility
Created with R2011a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: K-means clustering