Fast kmeans Algorithm Code

A Very fast and efficient Implementation for kmeans clustering of an Image or Array.
Updated 10 Jan 2014

View License

This code uses MATLAB's Internal Functions and Memory Preallocations to apply a Fast Implementation of kmeans algorithm. This is a efficient code for clustering a gray or Color image or it can be used for clustering a Multidimensional Array.

1. Faster than MATLAB's internal kmeans function.
2. Consistant Output than internal kmeans.
3. 100% convergence.
4. Very efficient for color image segmentation in L*a*b* color space.
5. Very easy to understand and can be easily modified according to requirement.

Hope you will like it. i am waiting for your reviews and comments.

Cite As

ankit dixit (2024). Fast kmeans Algorithm Code (, MATLAB Central File Exchange. Retrieved .

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

Inspired: Sparsified K-Means

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Change in output mean

These code supports color image as input and returns a segmented labeled image as output.

Minor Changes.

Now return Clustered Image at Output!!!...I will put kmeans for color clustering in next update :-)