This algorithm is a fully automatic way to cluster an input Color or gray image using kmeans principle, but here you do not need to specify number of clusters or any initial seed value to start iteration, this algorithm automatically finds number of cluster and cluster center iteratively. It is a very fast implementation of clustering an image without knowing number of clusters.
1. Cluster a Gray(single channel(0-255)) or Color image(3 channel(0-255)) as in kmeans.
2. Not need to be specify number of cluster for clustering.
3. Very Fast implementation.
4. Very Easy to understand.
5. Easy to Modify the code according to your requirements.
6. No use of any Image Processing Tool Function.
This code uses same principle as in kmeans, but here you do not need to define number of clusters.
You can use this code to estimate the number of clusters(colors) present in image, this code may not be segment all images as you want, so post processing of clustered image is suggested.
Please review it after download, I am waiting for your suggestions and modifications.
ankit dixit (2024). Adaptive kmeans Clustering for Color and Gray Image. (https://www.mathworks.com/matlabcentral/fileexchange/45057-adaptive-kmeans-clustering-for-color-and-gray-image), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!