How to find locations of intersection of 2 matrices?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
Aaron Greenbaum
el 28 de Jul. de 2016
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.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!