How to overlay two images which is transparent on each other?

2 views (last 30 days)
Hi,
I have two images, one is ground truth with values of objects [0,1,2] for background, obj2 and obj3, respectively. I have another image obtained from the segmentation algorithm with values 0 to 4 in which zero is background and the other four values shows each of four specific objects. I want to overlay these two images to visualize them for better visualize the objects of two images separately. I went through this however, it is not giving proper visualization of my images.
Could someone please help with this?
Thanks a lot.
  4 Comments
Walter Roberson
Walter Roberson on 14 Nov 2017
"I want to show corresponding objects with same color,"
There are no corresponding objects. You defined 0 as background, and background is not an object. You defined 1 and 2 on the first image as obj2 and obj3, and you defined 1, 2, 3 and 4 on the second image as being "four specific objects", but we as outsiders have no reason to expect that "four specific objects" will correspond in any way to obj2 or obj3.
If it happens that, for example, 3 in the second image is intended to correspond to obj2 (1 in the first image) then what output do you want in the places where both 3 and obj2 occur? What output do you want in the places where 3 occurs but obj2 does not? What output do you want in the places where 3 does not occur but obj2 does? What output do you want in the place that 3 occurs but the other image has obj3 ?

Sign in to comment.

Answers (1)

Rik
Rik on 13 Nov 2017
Apart from the point Adam is making, you can also have a look at imfuse
  1 Comment
Sara Salimi
Sara Salimi on 14 Nov 2017
Thanks for your response, yes I tried with `imfuse` as well, my problem is how can I make one image transparent on the other? is there any function or options for showing this 2D images (like the one that we can use in 3D visualization)? Thanks

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!