This cdf shows that the minimum value in the subimage is 52 and the maximum value is 154. The cdf of 64 for value 154 coincides with the number of pixels in the image. The cdf must be normalized to [0,255]. The general histogram equalization formula is:h(v) = mathrm{round} left( frac {cdf(v) - cdf_{min}} {(M imes N) - cdf_{min}} imes (L - 1)
ight)where cdfmin is the minimum non-zero value of the cumulative distribution function (in this case 1), M × N gives the image's number of pixels (for the example above 64, where M is width and N the height) and L is the number of grey levels used (in most cases, like this one, 256).Note that to scale values in the original data that are above 0 to the range 1 to L-1, inclusive, the above equation would instead be:h(v) = mathrm{round} left( frac {cdf(v) - cdf_{min}} {(M imes N) - cdf_{min}} imes (L - 2)
ight) + 1where cdf(v) > 0. Scaling from 1 to 255 preserves the non-zero-ness of the minimum value.The equalization formula for the example scaling data from 0 to 255, inclusive, is:h(v) = mathrm{round} left( frac {cdf(v) - 1} {63} imes 255
ight)
đang được dịch, vui lòng đợi..
