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

Home » Public Forums » archive » Re: Image Contrast Enhancement
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 Contrast Enhancement [message #47647 is a reply to message #47644] Mon, 27 February 2006 14:42 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> I haven't looked yet, but I wonder how you implement the cutoff in log
> scaling? Since the log of negative numbers is undefined, you are
> forced to shift things to be positive. The question becomes, what is
> the minimum value to which you shift? If it's too low, you waste all
> of your dynamic range on the low end where there are no data. If it
> is too high, you lose detail in the background. The method DS9 uses
> is really poor (which is why most people think sqrt() scaling is
> better than log() scaling). I've had good luck using 5% of the range
> (max-min) being thresholded as the magic minimum.

One of the advantages of not being an astronomer is that I
am free to to use brute force methods because I don't know
any better. :-)

Following the example of Gonzalez and Woods, I just scale
*everything* into the range 0 to 1 before I get started
doing the real work. I can get away with this, because in
the end I am scaling everything into the range of 0 to 255
anyway.

Now that I've barged into this arena, I'm learning all kinds
of new things about it. Ideas are coming to me faster than
I can work them out, which means, of course, I've got to
rewrite this whole business as an object so it can become
*really* useful to me. :-)

I did find, however, that I had to arbitrarily scale
the data in AsinhScl into the range 0 to 1000, instead
of 0 to 1 to make it work properly with the variety of
images I was testing against. I'm not sure why this is
so, except that -1 to 1 seems to be a strange zone in
the inverse hyperbolic sine equation. I noted this, but
haven't followed up, since it seems to *work* OK, even
if I don't understand it. That is to say, the modification
gave me results that looked right. However, I notice my
results are different than the FITS Liberator, so I am
looking at this again now.

> Regarding histogram equalization, the methods I've seen (and used)
> tend to reduce the dynamic range, creating "comb" effects in the
> histogram, i.e. not using the full range of value available. I feel
> like I've seen other tools which do not do this, but that may reflect
> more about the data than the tool.

Humm. I don't know. All the methods I've tried to use or implement
seem to use the full dynamic range, although it is an inherently
discrete, as opposed to smooth, process. Some bins are not filled
in the new histogram. Perhaps this is what bothers you.

> Now that you've put in all the goodies, if you really want to cause
> astronomers to loose their minds and begin sending you offers to name
> their first born or their computer after you, allow reading FITS files
> into three channels RGB, with truecolor display, and allow separate or
> grouped scaling of each of those channels, using HREBIN/HASTROM as
> needed to put them onto the same scale, with output to a variety of
> image formats. Try "RGB Frame" in DS9 for an example.

This is what I have been working on today. But, I am still
debating whether to write this as a widget program (which will
be harder to maintain over time), or write it as the object
program, which will take more time, but be more robust. As I say,
I have more ideas than I have the time to implement, which always
suggests objects to me.

Anyway, I'm interested in getting famous, since I need a calling
card to get that Astronomy Post-Doc position I hope someone is
going to offer me. (Preferably in a Spanish-speaking part of the
world, if you please. :-)

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
Previous Topic: Stack Trace
Next Topic: Re: Stack Trace

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

Current Time: Wed Oct 08 19:01:48 PDT 2025

Total time taken to generate the page: 0.00197 seconds