问题 I have the following map: I want to extract the polygon coordinates (pixls), I am using the following code snipt, but the inteverted labeled image is all 0's (False): import numpy as np from skimage import io, measure, morphology from skimage.io import imsave, imread img = io.imread('map.png', as_gray=True) imsave("test.png", img) img = morphology.binary_dilation(img, selem=np.ones((5,5))) img_inverted = np.invert(img) img_inverted_labeled = measure.label(img_inverted) n_lbls = np.unique(img