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

Home » Public Forums » archive » Re: Stretching an image
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: Stretching an image [message #41952 is a reply to message #41950] Fri, 10 December 2004 08:33 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Liam Gumley writes:

> I believe ENVI uses what is known as histogram clipping, as a way to
> remove outlier values from the stretch range. I describe an
> implementation of histogram clipping in Chapter 7 of my book. Here is
> the code from the book (imclip.pro):
>
> ;---start of imclip.pro---
> FUNCTION IMCLIP, IMAGE, PERCENT=PERCENT
>
> ;- Check arguments
> if (n_params() ne 1) then $
> message, 'Usage: RESULT = IMCLIP(IMAGE)'
> if (n_elements(image) eq 0) then $
> message, 'Argument IMAGE is undefined'
>
> ;- Check keywords
> if (n_elements(percent) eq 0) then percent = 2.0
>
> ;- Get image minimum and maximum
> min_value = min(image, max=max_value)
>
> ;- Compute histogram
> nbins = 100
> binsize = float(max_value - min_value) / float(nbins)
> hist = histogram(float(image), binsize=binsize)
> bins = lindgen(nbins + 1) * binsize + min_value

Liam, why 100 bins? I would have thought the minimum
number would be 256, to correspond with a possible byte
image. Or is 100 just a nice round number that gives
reasonable results?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help with Nested FOR Loop
Next Topic: Re: Help with Nested FOR Loop

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

Current Time: Sat Oct 11 04:48:58 PDT 2025

Total time taken to generate the page: 0.64471 seconds