I have some values and their possibilities, actually histogram of image. My aim is to equalize that histogram using this formula:
In order to use this formula I devided the histogram by number of image pixels. So I got a normalized histogram (probability values). Then for every pixel of the image I calculated a new value using that formula above, so I just make a sum of elements of normalized histogram. For example pixel with value 23 gets a new value which is calculated as the sum of elements of normalized histogram from 0 to 23. hist[0] + ... + hist[23]. And then multiplying the sum by 255 to get values between 0 and 255 (not between 0 and 1)
The method gives good result, I saw some results in the book, but in my case, my implementation doesn't give good results, it is wrong actually, does anybody see the mistake in my approach?