Gradient Based Image Segmentation