How to find locations of intersection of 2 matrices?

조회 수: 4 (최근 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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by