フィルターのクリア

Clustering of 1's in the binary 3-D matrix and find the coordinate of center of the clusters

1 回表示 (過去 30 日間)
Yatish Yatish
Yatish Yatish 2021 年 1 月 28 日
編集済み: Walter Roberson 2021 年 1 月 28 日
I have this attached 256x256x512 logical matrix (comprised of only 0's and 1's). I want to cluster the 1's and then determine the coordinate of these clusters as (m,n,p); 1<m<256, 1<n<256, 1<p<512. It can be assumed that two different clusters are at least 4 pixels away from each other. Thanks in advance!

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 1 月 28 日
編集済み: Walter Roberson 2021 年 1 月 28 日
regionprops() and ask for 'Centroid' -- using one possible meaning for the "center" of the clusters, and keeping in mind that the centroid is not necessarily going to be an integer at all.
Or perhaps you will want to ask for the bounding box, and then use half way through the bounding box, which is a different meaning of "center", but would be integer or half-integer

Community Treasure Hunt

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

Start Hunting!

Translated by