Simplify an Image Mask

Combine segmentation and morphological functions to create a clean mask from an image.