Top Banner
Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr.ir. Marcel Breeuwer dr. Anna Vilanova Histogram equalization
26

Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel Breeuwer dr. Anna Vilanova

Feb 23, 2016

Download

Documents

ADEN

Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel Breeuwer dr. Anna Vilanova. Histogram equalization. Today. Definition of histogram Examples Histogram equalization: Continuous case Discrete case Examples Histogram features. Histogram definition. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Basis beeldverwerking (8D040)

dr. Andrea FusterProf.dr.ir. Marcel Breeuwerdr. Anna Vilanova

Histogram equalization

Page 2: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Today

• Definition of histogram • Examples • Histogram equalization:

• Continuous case• Discrete case

• Examples• Histogram features

Page 3: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

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

Page 4: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

rk

Histogram

MN: total number of pixels (image of dimensions MxN)

Page 5: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

What do the histograms of these images look like?

Page 6: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Bimodal histogram

Page 7: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Tri- (or more) modal histogram

Page 8: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Example histograms

Page 9: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Questions?

• Any questions so far?

Page 10: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram processing

Page 11: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram processing

Page 12: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization

• Idea: spread the intensity values to cover the whole gray scale

• Result: improved/increased contrast!☺

Page 13: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – cont. case

• Assume r is the intensity in an image with L levels:

• Histogram equalization is a mapping of the form

• with r the input gray value and s the resulting or mapped value

Page 14: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – cont. case

• Assumptions / conditions:• ① is monotonically increasing function in • ②

• Make sure output range equal to input range

Page 15: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – cont. case

• Monotonically increasing function T(r)

Page 16: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

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 distribution function is

monotonically increasing, ok!①

Page 17: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

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!

Page 18: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – cont. case

What happens when we apply the transformation function T(r) to the intensity values? – how does the histogram change?

Page 19: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – cont. case

• What is the resulting probability distribution?• From probability theory

Page 20: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – cont. case

• Uniform:

• What does this mean?

Page 21: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – disc. case

• Spreads the intensity values to cover the whole gray scale (improved/increased contrast)

• Fully automatic method, very easy to implement:

Page 22: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram equalization – disc. case

Notice something??

Page 23: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Demo of equalization in Mathematica

Original image

Original histogram

Transformation function T(r)

“Equalized” image

“Equalized” histogram

Page 24: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

• Mean

• Variance

Histogram Features

Mean: image mean intensity, measure of brightnessVariance: measure of contrast

Page 25: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

Histogram features

• Mean and variance can be used for local histogram processing… (see example 3.12 in Gonzalez and Woods)

Page 26: Basis  beeldverwerking  (8D040) dr. Andrea Fuster Prof.dr.ir . Marcel  Breeuwer dr. Anna  Vilanova

End of part 1

• And now we deserve a break!