Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr. Bart ter Haar Romeny Prof.dr.ir. Marcel Breeuwer dr. Anna Vilanova Histogram equalization
Feb 23, 2016
Basis beeldverwerking (8D040)
dr. Andrea FusterProf.dr. Bart ter Haar RomenyProf.dr.ir. Marcel Breeuwerdr. Anna Vilanova
Histogram equalization
Contact
• dr. Andrea Fuster – [email protected]• Mathematical image analysis at W&I and Biomedical
image analysis at BMT • HG 8.84 / GEM-Z 3.108
Today
• Definition of histogram • Examples • Histogram features• Histogram equalization:
• Continuous case• Discrete case
• Examples
Histogram definition
• Histogram is a discrete function h(rk) = N(rk) , where
• rk is the k-th intensity value, and• N(rk) is the number of pixels with intensity rk
• Histogram normalization by dividing N(rk) by the number of pixels in the image (MN)
• Normalization turns histogram into a probability distribution function
rk
Histogram
MN: total number of pixels (image of dimensions MxN)
What do the histograms of these images look like?
Bimodal histogram
Tri- (or more) modal histogram
Example histograms
More examples histograms
More examples histograms
• Mean
• Variance
Histogram Features
Mean: image mean intensity, measure of brightnessVariance: measure of contrast
Questions?
• Any questions so far?
Histogram processing
Histogram processing
Histogram equalization
• Idea: spread the intensity values to cover the whole gray scale
• Result: improved/increased contrast!☺
Histogram equalization – cont. case
• Assume r is the intensity in an image with L levels:
• Histogram equalisation is a mapping of the form
• with r the input gray value and s the resulting or mapped value
Histogram equalization – cont. case
• Assumptions / conditions:• ① is monotonically increasing function in • ②
• Make sure output range equal to input range
Histogram equalization – cont. case
• Monotonically increasing function T(r)
Histogram equalization – cont. case
• Consider a candidate function for T(r) – conditions ① and satisfied?②
• Cumulative distribution function (CDF)• Probability density function (PDF) p is always non-
negative• This means the cumulative probability function is
monotonically increasing, ok!①
Histogram equalization – cont. case
• Does the CDF fit the second assumption?
•
• To have the same intensity range as the input image, scale with (L-1)
So ② ok!
Histogram equalization – cont. case
What happens when we apply the transformation function T(r) to the intensity values? – how does the histogram change?
Histogram equalization – cont. case
• What is the resulting probability distribution?• From probability theory
Histogram equalization – cont. case
• Uniform:
• What does this mean?
Histogram equalization – disc. case
• Spreads the intensity values to cover the whole gray scale (improved/increased contrast)
• Fully automatic method, very easy to implement:
Histogram equalization – disc. case
Notice something??
Demo of equalization in Mathematica
Original image
Original histogram
Transformation function T(r)
“Equalised” image
“Equalised” histogram
End of part 1
• And now we deserve a break!