Fuzzy models and algorithms for pattern recognition and image processing. K-means clustering: how it works