Topological Data Analysis For Image Segmentation