Author Topic: Inverse LocalHistogramEqualization  (Read 3353 times)

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Inverse LocalHistogramEqualization
« on: 2016 April 26 11:04:23 »
This may sound strange but I find myself wishing to be able to have the exact inverse of the functionality of the LocalHistogramEqualization Tool. I use PixInsight for all my photography. Who needs all these other software packages for HDR and Focus and so on for regular photography when we have such a powerful tool already. Sometimes I have images with so much contrast that I would like to decrease it but in a way that we use LocalHistogramEqualization Tool to increase contrast. Basically to have a checkbox in the tool for inverse. 


Mike

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Inverse LocalHistogramEqualization
« Reply #1 on: 2016 April 26 12:04:27 »
What can be done is something called "Histogram specification".
In Histogram Equalization, we are trying to produce an image with a flat histogram, this means, that all the intensities have the same probability, and so, the accumulative probability function should look like a diagonal line (as the identity curve, in the CurvesTransform. To specify an histogram we "perform" 2 histogram equalizations. First, from the histogram of the image, is is calculated the curve that will turn the histogram flat. Additionally, from the specified histogram (let's suppose that you want to achieve a gaussian function, centered, to achieve lower contrast) you calculate the curve that should equalize that. This second curve is inverted (axes are transposed) and you just apply both curves (the first equalization and the inverted second one).

From there, to a local histogram tool just to defines sliding windows and a clamping parameter to avoid large changes. If someone is up to this task, I may provide help. I would first try the algorithm with a global adjustment (and start modifying the HistogramEqualization tool that I wrote) and then translate that into the LocalHistogramEqualization tool.

:)


On a side note, you may try wavelets to reduce contrast.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: Inverse LocalHistogramEqualization
« Reply #2 on: 2016 April 26 13:22:27 »
Carlos

Thanks for the quick reply. What you said makes since. Not that I'm up to the task but it does give me some good ideas to try. Working with wavelets and masks based on wavelets of an image will do the trick for now.

Mike