farhi / matlab-mastrostack

Ma(e)stroStack: load, align, stack, and identify astrophotography images.
GNU General Public License v2.0
2 stars 0 forks source link

Improve contrast: use luminance stretching. #4

Open farhi opened 4 years ago

farhi commented 4 years ago

Resample luminance to enhance faint objects.

From https://skyandtelescope.org/astronomy-resources/the-abcs-of-ccd-imaging/

So what is stretching? To find out, we first need to examine a graph called a histogram. The histogram displays the range of dark and light levels in an image. Every good image-processing program has some form of histogram display. If we look at the histogram of a typical daylight photograph, the intensity range is spread out, occupying the majority of the graph. But when we examine the histogram of a typical unprocessed deep-sky photo, it generally consists of a flat graph with a single thin spike. That spike holds the bulk of the information in our precious data; everything to the right of that spike is a star. Our task is to redistribute, or stretch, the pixels over the greater part of the graph to better resemble the dynamic range of terrestrial photographs. This is where the art in astrophotography comes into play.

farhi commented 4 years ago

This can be achieved globally on luminance, or per RBG channel.