From: Tobias van der Neut on
Hello,

I got a question about displaying images, I hope someone can help me.

I want to display the image in a figure as it is, that means with all colors right. If I use the commands

figure;
imagesc(picture);
hold on;

all colors in the image are mixed up.

I also tried

figure;
imagesc(picture);
colormap(xy);
hold on;

with all available colormaps in Matlab, but the results were not satisfying. Is there any possibility to display my image as it is? I also tried formats from .bmp to .gif, it didn't work.

Thanks & best regards
Tobias
From: Steven Lord on

"Tobias van der Neut" <tobias-v-d-neut(a)arcor.de> wrote in message
news:hm0kas$cr3$1(a)fred.mathworks.com...
> Hello,
>
> I got a question about displaying images, I hope someone can help me.
> I want to display the image in a figure as it is, that means with all
> colors right. If I use the commands
>
> figure;
> imagesc(picture);
> hold on;
>
> all colors in the image are mixed up.
>
> I also tried
>
> figure;
> imagesc(picture);
> colormap(xy);
> hold on;
>
> with all available colormaps in Matlab, but the results were not
> satisfying. Is there any possibility to display my image as it is? I also
> tried formats from .bmp to .gif, it didn't work.

Try calling IMREAD with two outputs to read in your image data. If the
second output is nonempty, as I suspect it will be, that's the colormap you
should use in your call to COLORMAP.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Rich Ellis on
What is "picture"? Do you have the associated colormap?

Perhaps what you need to do is use imread with your .bmp or .gif file to
generate the proper data. See the imread documentation:

>> doc imread

You probably need to do something like this:

[img,cmap] = imread('imagefilename.gif');
figure
imagesc(img)
colormap(cmap)

"Tobias van der Neut" <tobias-v-d-neut(a)arcor.de> wrote in message
news:hm0kas$cr3$1(a)fred.mathworks.com...
> Hello,
>
> I got a question about displaying images, I hope someone can help me.
> I want to display the image in a figure as it is, that means with all
> colors right. If I use the commands
>
> figure;
> imagesc(picture);
> hold on;
>
> all colors in the image are mixed up.
>
> I also tried
>
> figure;
> imagesc(picture);
> colormap(xy);
> hold on;
>
> with all available colormaps in Matlab, but the results were not
> satisfying. Is there any possibility to display my image as it is? I also
> tried formats from .bmp to .gif, it didn't work.
>
> Thanks & best regards
> Tobias
>


From: Cokelid on
On Feb 23, 8:14 am, "Tobias van der Neut" <tobias-v-d-n...(a)arcor.de>
wrote:
> I want to display the image in a figure as it is, that means with all colors right. If I use the commands
> imagesc(picture);

Tobias, you'll need to explain what the variable "picture" is if
anyone is to have a hope of helping you. Please think carefully about
your question.

From: Tobias van der Neut on
Cokelid <cokelid(a)googlemail.com> wrote in message <d3fc3362-eb40-42ad-9c7c-c5489f3d2991(a)t21g2000vbo.googlegroups.com>...
> On Feb 23, 8:14 am, "Tobias van der Neut" <tobias-v-d-n...(a)arcor.de>
> wrote:
> > I want to display the image in a figure as it is, that means with all colors right. If I use the commands
> > imagesc(picture);
>
> Tobias, you'll need to explain what the variable "picture" is if
> anyone is to have a hope of helping you. Please think carefully about
> your question.

I now have implemented:

[image, cmap] = imread('picturename.bmp');
figure;
imagesc(image);
colormap(cmap);
hold on;

The test picture is a black circle, a blue triangle and a red rectangle. With this implementation I get the right colors of the objects but there is a noisy boundary around each object with varying colors. And these boundaries are unwanted.

What else do I have to specify? I am sorry, I am kinda new to Matlab and this forum...