extract the intersection of two matrices
Afficher commentaires plus anciens
Hi
I have two matrices, one is binary (A) and other one with values between [0-1] (B). My aim is to extract the intersection of these two matrices. I did the following but I don't know why another area has been added to it.
Binary image:
imshow(A)
B:
imagesc(B)

A = double(A);
A(A==0) = -1; % Change zeros to -1 to keep the zero values in matrix B
A = A.*B;
imagesc(A,'alphadata',A>=0);
caxis([0 1])
colormap jet
here is the output image, and some extra pixels have been selected as well.

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Region and Image Properties dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

