Skip to content

k‐means Clustering

jarek edited this page Dec 20, 2019 · 10 revisions

k-means Clustering plugin performs pixel-based segmentation of multi-band images. Each pixel in the input image is assigned to one of the clusters. Values in the output image produced by the plugin represent cluster number to which original pixel was assigned.

An input image stack can be interpreted in two ways. Slices can be interpreted as bands in a 2D image or as a 3D image. For instance, an RGB color images has three bands: red, green, and blue. Each pixels is represented by an n-valued vector, where n is a number of bands, for instance, a 3-value vector [r,g,b] in case of a color image.

Each cluster is defined by its centroid in n-dimensional space. Pixels are grouped by their proximity to cluster's centroids. Cluster centroids are determined using a heuristics: initially centroids are initialized using the k-means++ algorithm and then their location is interactively optimized. For more information on this and other clustering approaches see:

Anil K. Jain and Richard C. Dubes, Algorithms for Clustering Data, Prentice Hall, 1988. (PDF version available).

The main plugin k-means Clustering takes an input image and segments it based on clusters discovered in that image. Utility plugin k-means Clustering Reapply can use centers cluster computed for one image and use them to segment another image of the same type (image size can be different).

Clone this wiki locally