• Welcome to Orpington Astronomical Society.
 

News:

New version SMF 2.1.4 installed. You may need to clear cookies and login again...

Main Menu

Paper on image stretching

Started by Ivor, Nov 18, 2013, 15:54:09

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ivor

Mark,

You once directed me to to a science paper on image processing which explained the maths behind arcsinh(), could you point me to it again please?

Thanks

MarkS

It was by Lupton et al:
http://web.ipac.caltech.edu/staff/fmasci/home/astro_refs/OptimumColorLupton.pdf

The colour examples are not very pretty (by today's standards) but the important principles are there.

Mark

mickw

Why oh why did I look at that link  :roll:  :oops:
Growing Old is mandatory - Growing Up is optional

Ivor

Cheers Mark.

I've been searching for the similar documents for the other stretch functions to little avail other than some MATLAB code.

f(x) = arcsinh(aQ[x- m])/Q

I'm assuming I can apply the equation to LOG and EXP but I'm not sure how to apply it to power and root functions. Could you shed some light please?




MarkS

#4
Quote from: Ivor
I'm assuming I can apply the equation to LOG and EXP but I'm not sure how to apply it to power and root functions. Could you shed some light please?

I don't understand what you mean.  The equation is applied to the raw "luminance" i.e. it adjusts pixel intensity without adjusting pixel colour balance.  I don't know what you mean about applying it to LOG, EXP, power and root functions.

Mark

Ivor

Sorry to clarify, using FITS Liberator you have the ability to use asinh(), log(), exp(), X1.5 - X5, X1/2 - X1/5 as stretch functions. What I wanted to do is plot these in Excel to understand the different characteristics of the stretches.

Both asinh(), log() have logarithmic curves so the applied formula an be the same.

  • f(x) = arcsinh(aQ[x- m])/Q
  • f(x) = log(aQ[x- m])/Q

The root and exp() functions are parabolic curves so I wanted to understand how they would be applied to bring out the low level detail.

MarkS

I'm not familiar with FITS liberator.  I can't see how exp() or Xn (where n >1) can ever be used to bring out low level detail - they're fundamentally the wrong shape.  X1/n is OK though (n>1)

There's one very important point to remember.  Whatever non-linear function is applied the the image, if it is applied separately to the R,G,B channels then it will alter the colour balance of each pixel.  The functions need to be applied to the intensity if you want the colour balance left intact.

Mark

Ivor

FITS Liberator offers quite a few different stretch function include some compound ones which appear to handling white clipping better.



Further reading of the manual states The Xn (where N > 1) should be used for compression but in the native form they appear quite aggressive.

QuoteThere's one very important point to remember.  Whatever non-linear function is applied the the image, if it is applied separately to the R,G,B channels then it will alter the colour balance of each pixel.  The functions need to be applied to the intensity if you want the colour balance left intact.

Where you process the individual channels in FITS Liberator it possible to lock the settings to ensure consistancy.

MarkS

Quote from: Ivor
Where you process the individual channels in FITS Liberator it possible to lock the settings to ensure consistancy.

You'll probably find that means the same settings are applied to each channel.  Hence it will shift the colour balance because it is not separating out the "intensity channel" and applying the function to the "intensity channel" alone.  So it's not doing the same as Lupton's approach (if that is what you are trying to achieve).

Mark


Ivor

I think you are probably right, but I've not actively tried to test FITS Liberator for any negative colour balance. To date I've always found keeping the black and white points the same keeps the colour balance.

How to you think IRIS approaches it?

The reason behind this is I've finished most of my cloudy night projects now (and I want to avoid watching "zz list in the jungle" my daughter watches) and FITS Liberator is open source so I wanted to do some analysis to see if there were other functions or enhancements such as Lupton's approach which could be added. To work out whether it is worth the effort I wanted to build out a spreadsheet with the various image functions in and have a play.

MarkS

I reverse engineered what IRIS was doing.  It was like this:

If the initial pixel values are (R,G,B)

Intensity = (R+G+B)/3

colour components are then R/I, G/I, B/I

scale Intensity using arcsinh function

final pixel values are:
(R,G,B) x Intensity_scaled/Intensity

By construction the ratios of R:G:B remain fixed

MarkS

#11
Another stretching technique is here:
http://www.progressiveastroimaging.com/viewtopic.php?f=28&t=7564

But I find it gives an oddly saturated look, possibly because of how the H channel is used instead of "intensity".

I prefer the centre of bright stars to be slightly saturated rather than filled with block colour.

Mark

RobertM

Just got around to this thread and both links make very interesting reads.  Beauty is in the eyes of the beholder as they say.