How to superimpose 2 image using MATLAB, thanks

  • Follow


Dear all,

I want to show a heatmap (e.g. hm) on another image (e.g. im), how can I do this? I have tried the following codes:

imagesc(hm), colormap(hot);
axes('color','none')
hold on, h=imagesc(im);
alpha(h, 0.5);

However, the displayed hm and im have different sizes (but their resolutions are same to each other), and the image im was converted vertically.

I am looking forward to any suggestions. Thanks a lot.

Best regards,

Jani
0
Reply Jani 2/10/2011 8:21:06 PM

"Jani Korhonen" <eagle_nokia@hotmail.com> wrote in message <ij1hbi$ep4$1@fred.mathworks.com>...
> Dear all,
> 
> I want to show a heatmap (e.g. hm) on another image (e.g. im), how can I do this? I have tried the following codes:
> 
> imagesc(hm), colormap(hot);
> axes('color','none')
> hold on, h=imagesc(im);
> alpha(h, 0.5);
> 
> However, the displayed hm and im have different sizes (but their resolutions are same to each other), and the image im was converted vertically.
> 
> I am looking forward to any suggestions. Thanks a lot.
> 
> Best regards,
> 
> Jani

BTW, I want the heatmap hm to be transparent.
0
Reply Jani 2/10/2011 8:34:04 PM


On Feb 10, 3:34=A0pm, "Jani Korhonen" <eagle_no...@hotmail.com> wrote:
> "Jani Korhonen" <eagle_no...@hotmail.com> wrote in message <ij1hbi$ep...@=
fred.mathworks.com>...
> > Dear all,
>
> > I want to show a heatmap (e.g. hm) on another image (e.g. im), how can =
I do this? I have tried the following codes:
>
> > imagesc(hm), colormap(hot);
> > axes('color','none')
> > hold on, h=3Dimagesc(im);
> > alpha(h, 0.5);
>
> > However, the displayed hm and im have different sizes (but their resolu=
tions are same to each other), and the image im was converted vertically.
>
> > I am looking forward to any suggestions. Thanks a lot.
>
> > Best regards,
>
> > Jani
>
> BTW, I want the heatmap hm to be transparent.

------------------------------------------------------------------------
http://www.mathworks.com/support/solutions/en/data/1-194D0/?solution=3D1-19=
4D0
http://blogs.mathworks.com/steve/2008/08/20/image-visualization-using-trans=
parency/

or just search for "transparent image" on MATLAB Central.
0
Reply ImageAnalyst 2/10/2011 9:05:57 PM

Hi, thanks for the information, I studied the ideas given by Steve and tried to implement it. My cods are like this:

imshow(im);
hold on, h=imagesc(hm), colormap(hot);
buff=logical(hm>0);
set(h, ''AlphaData', buff);

But what I got is not like the superimposition of two images. Was I doing something wrong?

Thanks a lot!

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <23edcac7-2857-4f63-8ffb-54f104708943@z27g2000prz.googlegroups.com>...
> On Feb 10, 3:34 pm, "Jani Korhonen" <eagle_no...@hotmail.com> wrote:
> > "Jani Korhonen" <eagle_no...@hotmail.com> wrote in message <ij1hbi$ep...@fred.mathworks.com>...
> > > Dear all,
> >
> > > I want to show a heatmap (e.g. hm) on another image (e.g. im), how can I do this? I have tried the following codes:
> >
> > > imagesc(hm), colormap(hot);
> > > axes('color','none')
> > > hold on, h=imagesc(im);
> > > alpha(h, 0.5);
> >
> > > However, the displayed hm and im have different sizes (but their resolutions are same to each other), and the image im was converted vertically.
> >
> > > I am looking forward to any suggestions. Thanks a lot.
> >
> > > Best regards,
> >
> > > Jani
> >
> > BTW, I want the heatmap hm to be transparent.
> 
> ------------------------------------------------------------------------
> http://www.mathworks.com/support/solutions/en/data/1-194D0/?solution=1-194D0
> http://blogs.mathworks.com/steve/2008/08/20/image-visualization-using-transparency/
> 
> or just search for "transparent image" on MATLAB Central.
0
Reply Jani 2/10/2011 9:57:04 PM

3 Replies
1808 Views

(page loaded in 0.084 seconds)

Similiar Articles:













7/23/2012 1:04:36 PM


Reply: