Photogrammetry & Robotics Lab
Histogram Transformations:
Histogram Equalization &
Noise Variance Equalization
Image Histogram
0 255 0 128 0 0 255 0 128 2 5 occurrencesBrightness and Contrast
ยงโฏ A transformation that changes the
mean, changes the image brightness
ยงโฏ Analogous for variance and contrast
increasing variance increases contrast
Can We Compute the
Output Histogram Knowing
the Transformation Function?
How Do Operators Affect the
Distribution of Intensities?
ยงโฏ Monotonous function
ยงโฏ Histogram of the input image:
ยงโฏ Compute the histogram of the
output image given and
Transformation of a PDF
a b h (b) b f(a) db da Distribution of b (compute!) must be the same areaEffect for Monotonous Point
Operator
ยงโฏ The gray โareaโ in the interval
is mapped to the interval
ยงโฏ So we have (โarea stays the sameโ) a b h (b) b f(a) db da
This leads to
a b h (a) h (b) a b f(a) db da we want to computeThis leads to
a b h (a) h (b) a b f(a) db da derivative ofThis leads to
a b h (a) h (b) a b f(a) db da first derivativeThis leads to
a b h (a) h (b) a b f(a) db da first derivative function should depend on b, not on aExample: Linear Function
ยงโฏ If we have the linear function
ยงโฏ with the first derivative
Example
ยงโฏ We can directly compute the output
histogram given input and the (linear) transfer function
ยงโฏ Result
ยงโฏ This corresponds to a shift by k and a
Can We Design Transformations
Such That the Resulting Image
Sometimes One Can Barely See
Anything...
... but a Change in the Intensity
Values Can Help
Histogram Equalization
How to transform the image so that all intensities are used equally often?
Histogram Equalization
ยงโฏ Goal: same number of values in
every histogram bin
defined (output)
to be
Histogram Equalization
ยงโฏ Goal: same number of values in
every histogram bin
Histogram Equalization
Histogram Equalization
ยงโฏ How to solve ?
Histogram Equalization
ยงโฏ The equation
ยงโฏ simplifies to
ยงโฏ with the cumulative .
Histogram Equalization
ยงโฏ The parameters in
ยงโฏ are typically chosen so that
ยงโฏ This maps the spectrum of intensity
Histogram Equalization
ยงโฏ Chose the parameters so that
ยงโฏ From
Histogram Equalization
ยงโฏ This results in the point operator
Continuous vs. Discrete Case
continuous (ideal world)
As โflatโ as it can get...
Effect of the Hist. Equalization
ยงโฏ Typically increases the contrast
ยงโฏ Areas of lower local contrast gain
higher contrast
ยงโฏ Distributes the intensities over the
Variants of Histogram Equal.
ยงโฏ There exist variants of HE
ยงโฏ Adaptive HE (AHE) โ performs HE in
local patches, not the whole image
ยงโฏ AHE has issues in low contrast regions
as it over-amplifies the corrections
ยงโฏ Contrast limited AHE (CLAHE) limits
this over-amplifications in homogeneous regions
Noise Variance Equalization
ยงโฏ Intensity measurements are noisy
ยงโฏ Sensor: variance of a measured
intensity depends on the intensity itself (Poisson distribution)
ยงโฏ Goal: adjust the variance of the
intensities to a fixed value
ยงโฏ Useful for statistical analysis of images
Poisson Distribution
โThe Poisson distribution is a discrete
probability distribution that expresses
the probability of a given number k
of events occurring in a fixed interval
of time and/or space if these events
occur with a known average rate and
independently of the time since the
Poisson Distribution
Distribution About the Number
of Incoming Photons
ยงโฏ Poisson distribution
ยงโฏ with
ยงโฏ : avg. number of incoming photons
per second
Properties of the Poisson Dist.
ยงโฏ Mean and variance are then
ยงโฏ and thus a standard deviation of
Variance Illustration
photon count photon count impacts the varianceNoise Variance Equalization
ยงโฏ Consider a proportional relationship
between variance and intensity
Noise Variance Equalization
ยงโฏ Consider a proportional relationship
between variance and intensity
ยงโฏ Goal: for all intensities
ยงโฏ Variance propagation yields
Noise Variance Equalization
ยงโฏ We have
ยงโฏ We can rewrite that as
Noise Variance Equalization
ยงโฏ The equation
ยงโฏ can be solved by integration to
ยงโฏ Choose to obtain
Noise Variance Equalization
ยงโฏ Thus, we set
ยงโฏ For other variables:
ยงโฏ This means
ยงโฏ Variance equalization yields a square
root function with black=black and white=while
Noise Variance Equalization
ยงโฏ Result:
ยงโฏ The square root stretches the dark
Summary
ยงโฏ Image histograms represent the
image intensity distributions
ยงโฏ Point operators to manipulate images
ยงโฏ Designing transformations such
that images have certain properties
ยงโฏ Histogram equalization to obtain a
uniform distribution of intensities
Slide Information
ยงโฏ The slides have been created by Cyrill Stachniss as part of the
photogrammetry and robotics courses.
ยงโฏ I tried to acknowledge all people from whom I used
images or videos. In case I made a mistake or missed someone, please let me know.
ยงโฏ The photogrammetry material heavily relies on the very well
written lecture notes by Wolfgang Fรถrstner and the
Photogrammetric Computer Vision book by Fรถrstner & Wrobel.
ยงโฏ Parts of the robotics material stems from the great
Probabilistic Robotics book by Thrun, Burgard and Fox.
ยงโฏ If you are a university lecturer, feel free to use the course
material. If you adapt the course material, please make sure that you keep the acknowledgements to others and please acknowledge me as well. To satisfy my own curiosity, please