Fix equalization formula in equalizeHist function & rewrite in C++
authorAndrey Kamaev <andrey.kamaev@itseez.com>
Sat, 15 Dec 2012 11:21:52 +0000 (15:21 +0400)
committerAndrey Kamaev <andrey.kamaev@itseez.com>
Sat, 15 Dec 2012 11:29:15 +0000 (15:29 +0400)
commit0bbba847a413f86e91d81f28f9cc7bd04a3375c9
tree8acefefb3df2d758dcb2213cc3544e98d08b6fa0
parent9b09f09b9affe8934d8c1b04eb32ac3a0fbf0b20
Fix equalization formula in equalizeHist function & rewrite in C++

Old implementation did

    lut[i] = 255 * (count(Y <= i)) / (width * height)

which actually shifts uniform histograms.
From now histogram is equalized as

    C = count(Y == min(Y))
    lut[i] = 255 * (count(Y <= i) - C) / (width * height - C)
modules/imgproc/src/histogram.cpp