Adding resize and morphological operations