How to find locations of intersection of 2 matrices?

2 ビュー (過去 30 日間)
Jocelyne Beelen
Jocelyne Beelen 2016 年 7 月 28 日
回答済み: Aaron Greenbaum 2016 年 7 月 28 日
Hi,
So I have 2 3D matrices. One matrix is a 3D labeled matrix - so each island is labeled a different value (let's call it matrix A). The other matrix is a 3D matrix of circled islands that have been filled using the imfill function (let's call it matrix B). I need to use these 2 matrices to find which labels from matrix A correspond to the islands on matrix B. How would I go about finding which ones intersect?

回答 (1 件)

Aaron Greenbaum
Aaron Greenbaum 2016 年 7 月 28 日
I've never worked with 3-D data, but it seems like you might be doing something sorta similar to me. One way you can do it is to use regionprops. It takes two matrices and calculates things for the things in common with them.
stats = regionprops(Islands,Labels, 'Centroid'); %Creates structure with location of centroid.
You can also look into the intersect function in matlab or ismember. Its possible that youtube tutorials for watershedding and finding centroids with bwlabel will also be helpful
https://www.mathworks.com/matlabcentral/answers/28996-centroid-of-an-image
I'm not a pro at matlab but I hope this helped a little.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by