MATLAB: Hello everyone. I would be very grateful if anyone can help to see if there is any problem with the centroid extracted by this program.
centroid extract
BW = imread('k.png');
s = regionprops(BW,'centroid');
centroids = cat(1,s.Centroid);
imshow(BW)
hold on
plot(centroids(:,1),centroids(:,2),'b*')
Best Answer
Hi,
I have tried reproducing the issue on my end. Iwould statethat you are following the correct method to extract the centroid of thegiven figure.The centroid coordinate so obtained is the mean of coordinates of all the contour points in thegiven image. I am attaching the image of the figure along with its centroid.
Best Answer