comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: image color representing a vector...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: image color representing a vector... [message #15843] Wed, 16 June 1999 00:00
Peter Mason is currently offline  Peter Mason
Messages: 145
Registered: June 1996
Senior Member
John Stanly Videen <user@internet.com> wrote:
<...>
> for x=0,127 do begin
> for y=0,127 do begin
>
> red = ei(x,y) * ev(x,y,0) ; x direction
> green = ei(x,y) * ev(x,y,1) ; y
> blue = ei(x,y) * ev(x,y,2) ; z
>
> out(x,y) = new_function(red, green, blue)
>
> endfor
> endfor
>
> tv, out
<...>

Somewhat hesitantly, from what you've got here I'd say that you're
just looking for a function to take "unscaled" values "red", "green" and
"blue" and get a coloured pixel from them.

If by some chance you don't have a copy of David Fanning's book on IDL
programming techniques then I'd shamelessly recommend that you get a
copy. He covers this stuff well.
But anyway, here are some ideas...

First, do the calc in one hit using array arithmetic:
rgb_unscaled = REBIN(REFORM(ei,nx,ny,1),nx,ny,3) * ev
(Rgb_unscaled has dimensions [nx,ny,3] and is probably float or double?)

Next, scale to byte. This could be as simple as:
rgb_scaled=BYTSCL(rgb_unscaled)
or it might be done band by band with selected minima and maxima, and
perhaps with each band going through some non-linear stretch (like
histogram normalisation), etc.

Finally, if you have a hi- or truecolor display you can display this
result immediately with: TV,rgb_scaled,TRUE=3
If you have an 8-bit display the you must first construct a 1-byte
paletted image and corresponding colour table with COLOR_QUAN(), e.g.,
rgb_paletted=COLOR_QUAN(rgb_scaled,3,rlut,glut,blut,COLORS=2 20). This
can then be displayed with TV,rgb_paletted & TVLCT,rlut,glut,blut.


I hope this is of some help.

Peter Mason


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
[Message index]
 
Read Message
Previous Topic: Re: ENVI: Filter ROI's
Next Topic: Re: Reading PCI files in ENVI

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:41:41 PDT 2025

Total time taken to generate the page: 0.00407 seconds