An Approach to Image Segmentation using K-means Clustering Algorithm