calculating centroids of multiple ROIs at a time
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Sunetra Banerjee
il 15 Giu 2021
Commentato: Sunetra Banerjee
il 16 Giu 2021
Hi,
I have segmented my ROIs, which are circles/ellipses. I need to calculate the centroids of all ROIs at a time and save those values in Excel file for further processing. I am not able to figure out how to do that.
I am attaching my segmented image with multiple ROIs.
Thanks in advance.
0 Commenti
Risposta accettata
DGM
il 15 Giu 2021
Modificato: DGM
il 15 Giu 2021
If you have the binarized image, just use regionprops.
inpict = imread('blobs.png'); % standard test image
S = regionprops(inpict,'centroid')
vertcat(S.Centroid)
Note that I'm not using your image in this example. I don't want to deal with cropping all the padding off, and the size (and thus the coordinates) are probably altered now anyway. Don't save images by saving the displayed figure. There's rarely a good reason to degrade images by doing that. Just use imwrite().
5 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!