Gradient Based Image Segmentation Python Code Tester