Adaptive Kmeans algorithm based on threshold