Clustering, Segmentation, Data Science, Remote Sensing, Satellite.
So now we can simply calculate distances and assign a cluster to each data point. Thus, our new centroids became old, so we store them in another variable and recalculate the new ones. To do that we iterate over each cluster and take a mean across all the coordinates (in our case, across RGB