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.
Best Answer