← all work classical-computer-vision

Histogram equalisation

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-3776AB?logo=python&logoColor=white)](https://www.python.org/)

Result

SrSceneDegradedDo nothingGlobal HEAHE (unclipped)CLAHE (clip 2)Hist. matchingGamma 0.6**Oracle**
1moonlit pines · tone 25%15.3 dB**15.3**9.48.614.39.39.7**22.2**
2mare and foal · tone 76%14.9 dB14.911.19.9**15.4**11.49.7**26.2**
3covered wagons · tone 84%16.4 dB16.4**18.8**11.716.517.912.2**23.1**
4child on water · tone 98%13.0 dB13.015.110.915.3**16.9**9.5**30.4**

The finding

The curve *is* the method

Every row above is one monotonic map from input level to output level. Drawing that map says more than any metric, because the oracle's curve is the correct answer and distance from it is the error:

* Global HE and histogram matching lift the shadows roughly 50 levels too far between inputs 100 and 140, then run out of range and clip. * Gamma barely has a shape — it lifts everything and is nearly flat against the oracle's slope, which is why it scores worst of all. * AHE is visibly *non-monotonic*. Its map depends on where the pixel is, so the median curve zig-zags; two pixels of the same input brightness come out at different levels depending on their neighbours. That is the noise amplification, drawn. * CLAHE tracks the oracle closest in the shadows and gives up at the top.

---

Figures

equalised.png
equalised

Elsewhere

Code and full results on GitHub (code private)

Every number is read from the file the run produced. github.com/hammasbuilds · kaggle.com/muhammadhammas13