octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: usage of imread.m in octave


From: Ole Jacob Hagen
Subject: Re: usage of imread.m in octave
Date: Thu, 15 Jul 2004 11:05:30 +0200
User-agent: Mozilla Thunderbird 0.5 (X11/20040404)

Hi, Daniel.

I've tried that one (imshow(r,g,b)), but the image doesn't appear in colours, just greyscale.

So I guess a fix in imread.m is required, if colour images are impossible to visualise from Octave. Any volunteers?

Cheers,

Ole

Daniel J Sebald wrote:

From what I've seen, only gray scale and color palettes (i.e., "colormap") currently work in Octave. To show a color image, you need independent primary color components, e.g., RGB. So first, you can't use

X = imread('testimage.jpg');

because X can't have RGB. (Unless it were a 3 dimensional matrix, which I think it isn't.) So you need something like the RGB variant:

[r,g,b]= imread( fname );

Then you can do an

imshow(r,g,b);

But, currently here is what imshow() does for the RGB

elseif (nargin == 3)
[a1, a2] = rgb2ind (a1, a2, a3);
colormap (a2);
endif

i.e., converts to an indexed image. I believe in general that can only be an approximation.

Dan







reply via email to

[Prev in Thread] Current Thread [Next in Thread]