image segmentation method and test added