Grouping boundary points of several ROIs

4 ビュー (過去 30 日間)
Sunetra Banerjee
Sunetra Banerjee 2021 年 6 月 23 日
コメント済み: DGM 2021 年 6 月 23 日
Hi,
I have 6 region of interests (ROI) and their boundary points and centroids. I got this boundary points randomly through MATLAB programming. Do you have an idea how to group them according to corresponding ROIs in MATLAB? I need individual ROI's boundary points for further calculations.
I have applied Kmeans and it didn't work.
  5 件のコメント
Sunetra Banerjee
Sunetra Banerjee 2021 年 6 月 23 日
Thank you so much. I got
idx =
6×1 cell array
{170×1 double}
{210×1 double}
{190×1 double}
{243×1 double}
{182×1 double}
{162×1 double}
So, That means the first ROI has 170 boundry points, 2nd has 210 boundary points and so on. Right?
DGM
DGM 2021 年 6 月 23 日
Yes, but like I said, bear in mind which one is "first", "second", etc. The label array L contains a map of each object it found in the image, each labeled with their ordinal value. In this case, the objects are numbered [5 6 4 3 2 1] from top to bottom.

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

採用された回答

DGM
DGM 2021 年 6 月 23 日
編集済み: DGM 2021 年 6 月 23 日
This may be extraneous, but if you don't need the boundary coordinates for anything other than finding the extrema, consider this instead:
inpict = imread('lumber.png')>128;
% you'll need the centroid anyway
S = regionprops(inpict,'centroid','extrema');
imshow(inpict); hold on
for n = 1:numel(S)
% calculate the right and left extrema of this object
rextrema = mean(S(n).Extrema(3:4,:),1);
lextrema = mean(S(n).Extrema(7:8,:),1);
% for sake of demonstration, show where the extrema are
plot(rextrema(1),rextrema(2),'*')
plot(lextrema(1),lextrema(2),'*')
end
  3 件のコメント
Image Analyst
Image Analyst 2021 年 6 月 23 日
For next time, look up bwboundaries() - better than boundary(). Also look up bwferet() if you want extrema locations and distances.
DGM
DGM 2021 年 6 月 23 日
That's a good point. I was assuming the goal was to find the horizontal extrema instead of the maximal diameter.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by