How can I obtain pixel values from imfuse?

4 views (last 30 days)
Hello,
I would like to get the pixel values from the result of a imfuse function. So, I have two images that I called I1 and I2. I use imread to read both of them into Matlab. Then I use imfuse. The result of imfuse I save it on C and plot it. The spots in magenta are exactly what I need, but I cannot find any command to recover which pixels show magenta. Is there a way to recover the pixels that are colored in magenta?
Thank you in advance!
Here below is my code and the two images that I use:
I1 = imread('I1.png')
I2 = imread('I2.png')
Fused = imfuse(I1,I2);
imshow(Fused)

Accepted Answer

Shashank Gupta
Shashank Gupta on 9 Jun 2020
Hi Marco,
The function “imfuse” by default use “falsecolor” algorithm, so the green and magenta color you able to see are the regions where the intensities are different of the image I1 and I2 provided to the function. The first and the third channel of the output “Fused” has the information about the magenta color, while the second channel gives the information about the green color.
One easy way I can think of to address your concern is to extract magenta color channel from the output image and use it. I understand you need to work something more on top of it. But atleast extracting that channel gives an head start or some idea about the region of pixels which has color magenta.
I hope it helps you.
  1 Comment
Marco Terzariol
Marco Terzariol on 12 Jun 2020
Hi! Thanks for your reply. I ended up doing what you suggested. I extracted the magenta separately. So far it’s working. Thanks again!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!