Arcsinh stretch

Image processing, astrometry, photometry, etc.
Post Reply
Forum_2014
Posts: 253
Joined: 03 Dec 2018, 22:33

Arcsinh stretch

Post by Forum_2014 »

Hi,

I'm trying to work out how to apply an arcsinh stretch to an an image, please can I have some help.

So far I've been approaching this using the formula commnd but my current effort reduce the histogram rather than stretch, what formula shoudld I be applying?

v = asinh(v * 0.007)

I’ve found this paper on image stretching http://web.ipac.caltech.edu/staff/fm...olorLupton.pdf which explains how arcsinh should be used (equally how other logarithmic equations could be used).

To summary the paper:
The key equation appears to be F(x) = asinh(aQ(x - m))/Q

Key
M High visualisation threshold (white point)
m Lower visualisation threshold (Black point)
Q Intensity ( should be 1 if black point has been set correctly)
a Stretch coefficient
x Pixel value
l sum of r + g + b pixel values
Target = (r,g,b) values for a single pixel.

So in semi pseudo code as I’m not sure whether I can do scripting syntax in the function command

A = 0.0001;
Q = 1;
r = $target[0];
g = $target[1];
b = $target[2];
l = r+g+b/3;
ls = ArcSinh(Q*a*(l-m))/a;
$target*ls/l

The problem I have is I don’t know how to access the different parameters or whether the current scripting language would support this.

The colour stretch functionality already available offers something similar it would be excellent if there was the option to apply various functions dynamically.

Forum_2014
Posts: 253
Joined: 03 Dec 2018, 22:33

Re: Arcsinh stretch

Post by Forum_2014 »

Hello, I would also scale the result so:
v = 1000 * asinh(v*0.007)

To use the black point and to set the coefficients the image could be normalized to 0-10000 using the command Scale/Transfer function, before using the Formula.
(I is r+g+b/3 in Astroart formulas) so the exact result can be obtained.

By the way the arcsinh is not so complex:
http://www.boost.org/doc/libs/1_52_0...per/asinh.html
this shape can be obtained with a Curve too. It'a also very similar to DDP.

Post Reply