here i am little bit confused while trying to apply k means algorithm for classification purpose. is clustering and classification of images are same thing?
You use K-means to cluster some training data and get some centroids out of that.
You could then use the centroids that you found to classify new data into the categories that were previously created, Using the shortest distance of the new data points to the centroids, for example (This would be an insanely simple linear classifier)
So K-means is a clustering method that helps you find categories to your data.
For image clustering, there are no priori knowledge about the categroy information of all the samples.
For image classification, we have categroy information about some of the samples (we call them training samples). These samples are used to train a classifier, which is used to classify the remaining samples whose category information are previously unknown.
Same Part: All of them are to label the samples.
Difference: Clustering is unsupervised while classification is supervised.