Intensity Transformations (Point Processing)
Intensity Transformations (Point Processing)
(Point Processing)
2
Contents
In this lecture we will look at image enhancement point
processing techniques:
⚫ What is image enhancement?
⚫ What is point processing?
⚫ Negative images
⚫ Thresholding
⚫ Logarithmic transformation
⚫ Power law transforms
⚫ Grey level slicing
⚫ Bit plane slicing 3
What Is Image Enhancement?
Image enhancement is the process of making images more
useful
The reasons for doing this include:
⚫ Highlighting interesting detail in images
⚫ Removing noise from images
⚫ Making images more visually appealing
4
Image Enhancement Examples
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Image Enhancement Examples (cont…)
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Image Enhancement Examples (cont…)
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Image Enhancement Examples (cont…)
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Spatial & Frequency Domains
There are two broad categories of image enhancement
techniques
⚫ Spatial domain techniques
⚫ Direct manipulation of image pixels
⚫ Frequency domain techniques
⚫ Manipulation of Fourier transform or wavelet transform of an image
For the moment we will concentrate on techniques that operate
in the spatial domain
9
A Note About Grey Levels
So far when we have spoken about image grey level values we
have said they are in the range [0, 255]
⚫ Where 0 is black and 255 is white
There is no reason why we have to use this range
⚫ The range [0,255] stems from display technologes
For many of the image processing operations in this lecture
grey levels are assumed to be given in the range [0.0, 1.0]
10
Basic Spatial Domain Image Enhancement
Most spatial domain enhancement
Origin x
operations can be reduced to the form
g (x, y) = T[ f (x, y)]
where f (x, y) is the input image,
g (x, y) is the processed image (x, y)
y Image f (x, y)
11
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Point Processing
The simplest spatial domain operations occur when the
neighbourhood is simply the pixel itself
In this case T is referred to as a grey level transformation
function or a point processing operation
Point processing operations take the form
s=T(r)
where s refers to the processed image pixel value and r refers
to the original image pixel value.
12
Point Processing Example:
Thresholding
Thresholding transformations are particularly useful for
segmentation in which we want to isolate an object of interest
from a background
13
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Point Processing Example:
Thresholding (cont…)
Original Image Enhanced Image x
x
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Intensity Transformations
15
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Basic Grey Level Transformations
There are many different kinds of grey level transformations
Three of the most
common are shown
here
⚫ Linear
⚫ Negative/Identity
⚫ Logarithmic
⚫ Log/Inverse log
⚫ Power law
⚫ nth power/nth root
16
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Image Negatives
Negative images are useful for enhancing white or grey detail
embedded in dark regions of an image
⚫ Note how much clearer the tissue is in the negative image of the
mammogram below
Original Negative
s = 1.0 - r
Image Image
17
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Image Negatives (cont…)
Original Image Enhanced Image x
x
s = intensitymax - r
18
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Image Negatives (cont…)
Image Negatives
s=L–1–r
19
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Logarithmic Transformations
The general form of the log transformation is
s = c * log(1 + r)
The log transformation maps a narrow range of low input grey
level values into a wider range of output values
The inverse log transformation performs the opposite
transformation
20
Logarithmic Transformations (cont…)
Log functions are particularly useful when the input grey level
values may have an extremely large range of values
In the following example the Fourier transform of an image is
put through a log transform to reveal more detail
s = log(1 + r)
21
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Logarithmic Transformations (cont…)
Original Image Enhanced Image x
x
s = log(1 + r)
We usually set c to 1.
Grey levels must be in the range [0.0, 1.0]
22
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Transformations
Power law transformations have the following form
s=c*rγ
Map a narrow range of dark input values
into a wider range of output values or vice
versa
Varying γ gives a whole family of curves
23
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Transformations (cont…)
Original Image Enhanced Image x
x
s=rγ
We usually set c to 1.
Grey levels must be in the range [0.0, 1.0]
24
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Example
25
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Example (cont…)
γ = 0.6
1
Transformed Intensities
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Old Intensities
26
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Example (cont…)
γ = 0.4
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
27
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Example (cont…)
γ = 0.3
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
28
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Example (cont…)
The images to the right show a
magnetic resonance (MR) image
s = r 0.6
of a fractured human spine
Different curves highlight different
detail
s = r 0.4
29
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Example
30
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Example (cont…)
γ = 5.0
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
31
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Power Law Transformations (cont…)
An aerial photo of a runway is
shown
s = r 3.0
This time power law transforms
are used to darken the image
s = r 4.0
Different curves highlight
different detail
32
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Gamma Correction
Many of you might be familiar with
gamma correction of computer monitors
Problem is that display devices do
not respond linearly to different
intensities
Can be corrected using a log transform
33
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Piecewise Linear Transformation Functions
34
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Piecewise-Linear Transformation (cont…)
35
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Piecewise-Linear Transformation (cont…)
36
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Bit Plane Slicing
Often by isolating particular bits of the pixel values in an image
we can highlight interesting aspects of that image
⚫ Higher-order bits usually contain most of the significant visual
information
⚫ Lower-order bits contain
subtle details
37
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Bit Plane Slicing (cont…)
[10000000] [01000000]
[00100000] [00001000]
[00000100] [00000001]
38
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Bit-Plane Slicing (cont…)
39
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Bit-Plane Slicing (cont…)
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Average image
Let g(x,y) denote a corrupted image by adding noise η(x,y) to a
noiseless image f(x,y):
g ( x, y ) = f ( x, y ) + ( x, y )
The noise has zero mean value
E [ zi ] = 0
E[ zi z j ] = 0
41
Average image (cont...)
The noise effect is reduced by averaging a set of K noisy
images. The new image is K
1
g ( x, y) = gi ( x, y)
K i =1
The intensities at each pixel of the new image new image may
be viewed as random variables.
The mean value and the standard deviation of the new image
show that the effect of noise is reduced.
42
Average image (cont...)
1 K
1 K
E g ( x, y ) = E gi ( x, y ) = E gi ( x, y )
K i =1 K i =1
1 K
= E f ( x , y ) + i ( x, y )
K i =1
1 K 1 K
= E f ( x, y ) + E i ( x, y )
K i =1 K i =1
1
= Kf ( x, y ) + 1 K 0 = f ( x, y )
K K
43
Average image (cont...)
Similarly, the standard deviation of the new image is
( ) (
= E g ( x, y ) − E g ( x , y ) )
2
g ( x, y )
2 1
= ( x, y )
44
Average image (cont...)
45
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Average image (cont...)
46
Adapted from Gonzalez, Rafael C. Digital image processing. Pearson education India, 2009.
Summary
We have looked at different kinds of point processing image
enhancement
Next time we will start to look at histogram processing methods.
47