Article directory
hist map
1. Principle
code:https://github.com/rossgoodwin/hmap
Use the queue to record the index of hist src > tgt, src < tgt, src = tgt.
Then, for each hist excess, move it to hist deficit for filling.
Note that the way of filling here is sliding filling and sampling (all pixels with value val are randomly selected for replacement).
What is the difference compared to histogram specification?
It is guaranteed that the histograms are completely consistent. While histogram specification does not guarantee
It is reasonable to modify the source code as follows:
2. Grayscale image
If you follow the source code, the effect is as follows:
After modification:
3. For color images
The original code effect:
R,G,B :
The modified code effect:
R:
G:
B:
final result:
4. The effect of histogram specification
The histogram normalization (right) is smoother.