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: Daniel J Sebald
Subject: Re: usage of imread.m in octave
Date: Thu, 15 Jul 2004 03:41:17 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01

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



Ole Jacob Hagen wrote:

Hi.

Octave-Forge has imread.m as part of the signal processing module inside.
I am using imread like this:
X = imread('testimage.jpg');
The testimage.jpg can be found here
http://cvs.sourceforge.net/viewcvs.py/oplot/oplot/examples/

And imshow(X), will then give me a black-white image, but it's supposed
to be a colour image. I'd like to have colours.
Does imshow or image work with colour?

I would like to have working example script, if anyone has a working example...if it's possible....


Why doesn't this works? Where does it fails, what is wrong, and does
someone have a fix for this?

Oplot-developers have implemented the same thing, but the image popups
in Oplot instead of ImageMagic. :-)

We can do:

Line, Image, Axes, Figure.
Soon Patch and Surface.

Then we are heading for UIControl...



Cheers,

Ole J.




--

Dan Sebald
email: daniel DOT sebald AT ieee DOT org
URL: http://acer-access DOT com/~dsebald AT acer-access DOT com/





reply via email to

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