Indexing out of regionprops

조회 수: 8 (최근 30일)
Anna van der Stap
Anna van der Stap 2021년 2월 12일
댓글: Anna van der Stap 2021년 2월 15일
I have used regionprops to find areas of interest in my data, although this has worked brilliantly, I now can't seem to find back the index of my regions of interest.
My starting data that I want to index back into is a 244530 x 1 logical. From this I used the following code:
CC = bwconncomp(data);
props = regionprops(CC, 'area');
properties = cell2mat(struct2cell(props))';
To find regions of interest. However, 'properties' is now 1731 x 1 double, with no indexable relation to the original data. Does anybody know how I can index back out of regionprops to find the row of data in which it occurred?
Thanks in advance.

채택된 답변

Image Analyst
Image Analyst 2021년 2월 12일
What would you like? You could also ask regionprops to retrieve the blob shape for every index if you want. If you want you can write the labels on the image at the centroid, like in the attached demo:
Labeling goes from top to bottom in the first/left column, then moves over column by column after that, finding blobs in each column.
  댓글 수: 1
Anna van der Stap
Anna van der Stap 2021년 2월 15일
Thank you, this worked brilliantly!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by