You are right. Matlab provides a kmeans function that does what you want to have.
As far as I know, inputs should be vectorized, which can be done by, e.g.
1. vectorize the image (stacking of column of row vectors). This approach induces a high-dimensional feature space with lost of redundancy in it. Alternatively, you could
2. get a low-dimensional vector representation of your images. For instance via the bag of visual words idea, which is as well based on a (e.g. kmeans) clustering step.
You are right. Matlab provides a kmeans function that does what you want to have.
As far as I know, inputs should be vectorized, which can be done by, e.g.
1. vectorize the image (stacking of column of row vectors). This approach induces a high-dimensional feature space with lost of redundancy in it. Alternatively, you could
2. get a low-dimensional vector representation of your images. For instance via the bag of visual words idea, which is as well based on a (e.g. kmeans) clustering step.