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

Re: Function BYTSCL

Steffen Kernchen (steffen.kernchen@student.uni-magdeburg.de) writes:

> no, itīs an exercise, so that we learn, what BYTSCL does.
> I 've a pic and I read it with READ_BMP to get an array. that array I have
> to transform to get a better contrast.
> but unfortunately without using BYTSCL...  :(

Oh, well, then. 

What BYTSCL does is take the data, finds the minimum
and maximum of the data, then linearly maps the min
and max to 0 and 255. This is the scaling function.
Then, it adds a translation to the scaled vector, so
that the minimum value is set to zero. Then, it converts
the whole thing to BYTE type.

You are right, the whole thing can be done in 4-5 lines. :-)



P.S. Let's just say that if you poked around in the
on-line libraries for a couple of minutes, you would
probably find something that did this sort of thing
for you. :-)

David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155