How to get centroid specific part of an image
Show older comments
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.
Accepted Answer
More Answers (2)
Image Analyst
on 10 Mar 2015
0 votes
My Image Segmentation Tutorial shows you how to get centroids.
Ajay Goyal
on 11 Mar 2015
0 votes
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!