Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

k-means image segmentation

Clustering pixel intensities into k groups by alternating nearest-centroid assignment and centroid recomputation.

K-means image segmentation treats each pixel's intensity (or feature vector) as a point in feature space, then alternates two steps until convergence: assign every point to its nearest of k centroids, then recompute each centroid as the mean of the points now assigned to it. Replacing each pixel with its own cluster's centroid value partitions the image into k regions, chosen by proximity in intensity space rather than a fixed cutoff rule.

Read the full section →
Graph settings

Calculator