Image segmentation metrics--matlab code