You are on page 1of 16

Gholamreza Anbarjafari, PhD

Video Lecturers on Digital Image Processing

Digital Image
Processing
Contrast Enhancement: Part I
Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Contrast Enhancement

Contrast Stretching: improves the contrast in an image


by stretching the range of intensity values to span a desired range
of values.
Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Converts to black & white

Linear Part contributes to the


contrast stretching

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Some basic grey-level


transformation functions
used for contrast
enhancement

L=2k
k: number of bits used to
represent each pixel

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Image Negatives
s= (L-1)-r
s is the pixel value of the output image and r is the pixel value of
the input image.

(left) Original digital


mammogram. (right) Negative
image obtained using the
negative transformation

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Logarithmic Transformations
s = c log ( 1 + r )
s is the pixel value of the output image and r is the pixel value of
the input image.

(left) Fourier spectrum of Barbara’s


image. (right) Result of applying the
log transformation
Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Logarithmic Transformations
s= c rγ
s is the pixel value of the output image and r is the pixel value of
the input image. (γ ≥ 0 and 0 ≤ r ≤ 1)

Plots for various values of γ (c=1)

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Logarithmic Transformations

a b
c d
(a) original image. (b) γ = 0.5 .
(c) γ = 0.3 . (d) γ = 0.7.
Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Piecewise-Linear Transformations

An example of piecewise linear


transformation function

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Piecewise-Linear Transformations
grey-level slicing Pixel values
between
[A,B] are
highlighted

Other pixel
values are
preserved

Other pixel values are darkened

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Piecewise-Linear Transformations
Bit Plane slicing

An 8-bit fractal image

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Piecewise-Linear Transformations
Bit Plane slicing
MSB

LSB

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Histogram Processing

Histogram : is the discrete function h(rk)=nk , where rk is the kth


gray level in the range of [0, L-1] and nk is the number of pixels
having gray level rk.

Normalized histogram : is p(rk)=nk/n, for k=0,1,…,L-1 and p(rk)


can be considered to give an estimate of the probability of
occurrence of ray level rk.
Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Histogram of 4 basic grey-level characteristics


4
x 10
16

14 Dark image
12

10

0 50 100 150 200 250


4
x 10

12

Bright image
10

0 50 100 150 200 250

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Histogram of 4 basic grey-level characteristics


5
x 10

2 Low contrast image


1.5

0.5

0 50 100 150 200 250


4
x 10

8
High contrast image
7

0 50 100 150 200 250

© 2002 R. C. Gonzalez & R. E. Woods


Gholamreza Anbarjafari, PhD
Video Lecturers on Digital Image Processing

Summary
 We have looked at:
 What is contrast stretching?
 What are different transformations?
 What is histogram and histogram processing?

 Next time we will talk about more on


contrast stretching by using other
techniques

You might also like