I have two images. 1st one is with data type uint8. 2nd one with data type logical. I want to multiply these two images so that I can replace the "1" values of 2nd image by the intensity values of 1st image. How can I do that?
0
votes
2 Answers
2
votes
I'm going to call the image img and the logical matrix mask and assume same size. Using logical indexing you can do
img(~mask) = 0;
which should be faster than multiplication.