Extract y coordinates of centriod of an image

3 ビュー (過去 30 日間)
Hamza Ahmed
Hamza Ahmed 2014 年 11 月 15 日
コメント済み: Hamza Ahmed 2014 年 11 月 15 日
I have found the x and y co-ordinates of centroid of an image. I need to extract only the y-axis value and plot it against x=1:1:10. How can I extract the why axis value?
Code to find the centroid is in the comment below. Thanks
  1 件のコメント
Hamza Ahmed
Hamza Ahmed 2014 年 11 月 15 日
I1 = imread('images\imgc1.jpg');
Ibw = im2bw(I1);
Ibw = imfill(Ibw,'holes');
Ilabel = bwlabel(Ibw);
stat1 = regionprops(~Ilabel,'centroid');
imshow(I1); hold on;
for x = 1: numel(stat1)
plot(stat1(x).Centroid(1),stat1(x).Centroid(2),'ro');
end
The variable 'stat' contains the values of xy axis of centroid. I only need the y axis value.
Typing stat(2) does not help.

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2014 年 11 月 15 日
The y value for index x is stat1(x).Centroid(2).

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by