![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/467305/image.png)
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.
1 次查看(过去 30 天)
显示 更早的评论
BW = imread('k.png');
s = regionprops(BW,'centroid');
centroids = cat(1,s.Centroid);
imshow(BW)
hold on
plot(centroids(:,1),centroids(:,2),'b*')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/463435/image.png)
0 个评论
采纳的回答
Rishabh Mishra
2020-12-21
Hi,
I have tried reproducing the issue on my end. I would state that you are following the correct method to extract the centroid of the given figure. The centroid coordinate so obtained is the mean of coordinates of all the contour points in the given image. I am attaching the image of the figure along with its centroid.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/467305/image.png)
Hope this helps.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!