##Algorithm Overview:
- The KMeans algorithm is an unsupervised clustering algorithm that classifies the input data points into multiple classes based on their inherent distance from each other. The algorithm assumes that the data features form a vector space and tries to find natural clustering in them.
- The points are clustered around centroids The algorithm takes a 2 dimensional image as input.
- Various steps in the algorithm are as follows:
- Compute the intensity distribution(also called the histogram) of the intensities.
- Initialize the centroids with k random intensities
- Repeat the following steps until the cluster labels of the image does not change anymore.
- Cluster the points based on distance of their intensities from the centroid intensities.
- Compute the new centroid for each of the clusters.
- where k is a parameter of the algorithm (the number of clusters to be found), i iterates over the all the intensities,j iterates over all the centroids and µ are the centroid intensities.
usage: kmeans_imgsegment.py [-h] -i SOURCE_IMG -k BIN_SIZE