Variational approach to image segmentation