from skimage.segmentation import slic
from skimage.measure import regionprops
# Assume image is given
segments = slic(image, n_segments=numSegments, compactness=0.1,enforce_connectivity=True)
props = regionprops(segments,intensity_image=image)
segmentsToExclude = []
for s, segment in enumerate(segments):
if props[s].mean_intensity < 5: # basically black
segmentsToExclude.append(s)
您可以使用
skimage.measure.regionprops
。在沿着这些线索。有关regionprops的详细信息,请查看this skimage link。在
相关问题 更多 >
编程相关推荐