Gradient Based Image Segmentation Python Code Run