Re: Image Contrast Enhancement [message #47651 is a reply to message #47647] |
Mon, 27 February 2006 13:55   |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Sat, 25 Feb 2006 16:39:53 -0700, David Fanning wrote:
> Folks,
>
> I've finally completed what I have been doing piecemeal over
> the past week or so: put ALL my new image contrast improvements
> into a single user interface, XSTRETCH.
>
> http://www.dfanning.com/programs/xstretch.zip
>
> Using the image histogram as a guide, you can now threshhold
> your image values and perform a contrast stretch between those
> values using linear, power-law (gamma), log, or an inverse
> hyperbolic sine function as the scaling function. Moreover,
> the code has been re-organized so that I can easily add additional
> scaling functions as needed. This program works great with
> even the worst of the images I have in my perverse collection.
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.
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.
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.
JD
|
|
|