How to get centroid specific part of an image
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (2)
Image Analyst
el 10 de Mzo. de 2015
0 votos
My Image Segmentation Tutorial shows you how to get centroids.
Ajay Goyal
el 11 de Mzo. de 2015
0 votos
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
