A color segmentation algorithm based on k-means