what does allcentroids do?

1 回表示 (過去 30 日間)
noha maabreh
noha maabreh 2015 年 5 月 5 日
コメント済み: Walter Roberson 2015 年 5 月 8 日
allAreas = [measurements.Area];
allPerimeters = [measurements.Perimeter];
allCentroids = [measurements.Centroid];
centroidX = allCentroids(1:2:end);
centroidY = allCentroids(2:2:end);
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 5 月 8 日
That looks like code I might have written ;-)
Note that in the above, "allCentroids" is just another variable name, not the name of a command or function call. What will be stored in that variable is as the others have described below.

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

回答 (1 件)

Jeff E
Jeff E 2015 年 5 月 5 日
This is pulling the various measurements (Area, Perimeters, Centroid coordinates) out of the cell array measurements, and putting them into arrays. allCentroids will contain the centroid X and Y coordinates concatenated together along the lines of: ROI_1_Xcoord ROI_1_Ycoord ROI_2_Xcoord ROI_2_Ycoord ...
By taking every other element of allCentroids, centroidX contains the X coordinates, while centroidY contains the Y coordinates.
  3 件のコメント
Jeff E
Jeff E 2015 年 5 月 5 日
If your image has two ROIs with centroid XY coordinates as follows:
ROI1 - 50x 60y
ROI2 - 100x 120y
Then allCentroids would be an array containing: [50 60 100 120]
noha maabreh
noha maabreh 2015 年 5 月 6 日
thank you

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

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by