newbie here! I'm working with python plus opencv and skimage packages. I've segmented an image in superpixels using:
segments = slic(image, n_segments=numSegments, sigma=1, convert2lab=True)
Now I'd like to get the coordinates associated with each superpixel's centroid, how can I do that?
Try looking at skimage.measure.regionprops:
from skimage.measure import regionprops
regions = regionprops(segments)
for props in regions:
cx, cy = props.centroid # centroid coordinates
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With