From: K. P. on
Welcome ...

I have a small problem with using the functions imshow (or image) and contourf. I would like to view the image (img) and put down on it the chart contourf matrix (M x N). However, the function Contourf is one color and I can't get the effect heatmaps

figure
image (img);
hold on;
contourf (I);

What can I do? Any hint?
From: ImageAnalyst on
On Nov 17, 3:17 am, "K. P." <kapie...(a)gmail.com> wrote:
> Welcome ...
>
> I have a small problem with using the functions imshow (or image) and contourf. I would like to view the image (img) and put down on it the chart contourf matrix (M x N). However, the function Contourf is one color and I can't get the effect heatmaps
>
> figure
> image (img);
> hold on;
> contourf (I);
>
> What can I do? Any hint?

--------------------------------
Are img and I the same size?
Are you sure img is not an rgb image? If so, can't have a colormap on
the image, but I'm not sure if you can have a colormap for contour
lines over an rgb image - I'd have to look it up and try it.
Did you look into the colormap() function?
Maybe image() take a colormap as an argument.
From: K. P. on
> Are img and I the same size?
> Are you sure img is not an rgb image? If so, can't have a colormap on
> the image, but I'm not sure if you can have a colormap for contour
> lines over an rgb image - I'd have to look it up and try it.
> Did you look into the colormap() function?
> Maybe image() take a colormap as an argument.

Yes, img ang matrix I are the same size.
I tried image RGB and image BW - without effects
And yes, I used colormap function:

image(img);
hold on;
contourf(I);
colormap(hot);

Also without effects :/
From: Thomas Clark on
Is the image normalised in the same way as I?

Often you have an image varying between 0 and 255 (say, for an 8 bit grayscale) and actual data varying between 0 and 1. If that were the case, all your contours could show up the same colour when the colormap is applied.

Just a guess!

Tom

"K. P." <kapieren(a)gmail.com> wrote in message <hdudeb$rnu$1(a)fred.mathworks.com>...
> > Are img and I the same size?
> > Are you sure img is not an rgb image? If so, can't have a colormap on
> > the image, but I'm not sure if you can have a colormap for contour
> > lines over an rgb image - I'd have to look it up and try it.
> > Did you look into the colormap() function?
> > Maybe image() take a colormap as an argument.
>
> Yes, img ang matrix I are the same size.
> I tried image RGB and image BW - without effects
> And yes, I used colormap function:
>
> image(img);
> hold on;
> contourf(I);
> colormap(hot);
>
> Also without effects :/
From: K. P. on
"Thomas Clark" <t.clark(a)remove.spamcantab.net> wrote in message <hdula3$k15$1(a)fred.mathworks.com>...
> Is the image normalised in the same way as I?

YES! You're right! :) I forgot normalised variables. Now it's ok!

Thanks a lot! :)