How to get centroid specific part of an image
Ältere Kommentare anzeigen
I am intended to compute centroid of a part of image. I am getting centroid of all parts of the image which makes me confused of selecting the right one. my code is:
I = imread('Murine_Tibia_Crosssection.png')
Ibw = im2bw(I);
Ibw = imfill(Ibw,'holes');
Ilabel = bwlabel(Ibw);
stat = regionprops(Ilabel,'centroid');
imshow(I); hold on;
for x = 1: numel(stat)
plot(stat(x).Centroid(1),stat(x).Centroid(2),'ro');
end
please help me to get the right one.
Akzeptierte Antwort
Weitere Antworten (2)
Image Analyst
am 10 Mär. 2015
0 Stimmen
My Image Segmentation Tutorial shows you how to get centroids.
Ajay Goyal
am 11 Mär. 2015
0 Stimmen
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
