centroid of an image
48 ビュー (過去 30 日間)
古いコメントを表示
I want to find the centroid of an image.How to proceed?
1 件のコメント
Dipti S
2019 年 3 月 1 日
Something like
stats1=regionprops(BW,'MajorAxisLength','MinorAxisLength','Centroid','Orientation','Area','EquivDiameter')
centers = stats1.Centroid;
採用された回答
Chandra Kurniawan
2012 年 2 月 14 日
Hi,
did you mean 'find centroid of objects in an image'??
use regionprops with property : centroid
Eg : stat = regionprops(Ilabel,'centroid');
I = imread('coins.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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168712/image.jpeg)
1 件のコメント
J Shaw
2018 年 2 月 20 日
Hi,
If I use this code, I get a centroid array that has 255 elements. What is the meaning for each element? Thanks!
その他の回答 (1 件)
Sean Lawson
2012 年 2 月 14 日
Broad question, if the image is your input, simply find the center of the image. But I assume you are asking a more complicated question: like find the centroid of a specific object in an image? if so, need to segment the object out of the image, then find the center point.
4 件のコメント
Dhrubajyoti Das
2013 年 10 月 28 日
http://www.mathworks.com/matlabcentral/answers/104175-find-centroid-of-an-image this is the link. can you please help
Biswas Lohani V K
2016 年 1 月 25 日
HEllo everyone, What is the syntax for this bb = stats(object).BoundingBox; bc = stats(object).Centroid;
could you please define how this code works
Thank you
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!