A Method for Segmentation of Color Images and Contour Detection