Find the distance transfrom of a labeled image.