I am learning some image processing stuff and equalizing a histogram comes up as an important topic. I have followed the procedure listed on Wikipedia but the resulting equalized histogram does not look much better to me.
Let's say I have the following histogram where values only range from 0 to 7:
0 | 2
1 | 6
2 | 12
3 | 13
4 | 6
5 | 11
6 | 7
7 | 7
The equation to equalize the histogram is as follows: $h(v) = round(\frac{cdf(v) - cdf_{min}}{(M*N) - cdf_{min}} * (L - 1))$
So, using this I get the following:
$h(0) = 0$
$h(1) = 1$
$h(2) = 2$
$h(3) = 4$
$h(4) = 4$
$h(5) = 5$
$h(6) = 6$
$h(7) = 7$
Transferring this over to the new histogram, I get the following equalized histogram:
0 | 2
1 | 6
2 | 12
3 | 0
4 | (13 + 6) = 19
5 | 11
6 | 7
7 | 7
This doesn't look right at all... Have I done something incorrectly?