k-means on threshold