L1 - Image Enhancement Spatial Intensity Transformation
L1 - Image Enhancement Spatial Intensity Transformation
Intensity Transformation
Some figures are provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Enhancement
• Objectives
– It makes an image more suitable for specific, problem-
oriented applications than the original.
– It is often for human perception; the viewer is the ultimate
judge of how well a particular works.
g(x,y) = T[ f(x,y) ]
Image g ( x,y )
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
f1(x,y)
g(x,y) = T[ f1(x,y), f2(x,y), …, fn(x,y)]
f2(x,y)
fn(x,y)
Image g ( x,y )
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Gray-level transformation
• Simplest form of T
– neighborhood is 1 x 1 (one pixel)
• Notation: s = T(r)
– r, s denote the gray levels of f(x,y) and g(x,y) for
any point (x,y), respectively
Examples of T(r)
s s
T(r)
T(r)
m m
0 r 0 r
Darker Lighter Darker Lighter
L-1
T(r)
s
0
r
L-1
s = T(r) = (L-1)-r
Darkening
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Log Transformations
L-1 s = c log(1 + r)
T(r)
s (c is some scale-factor)
(intensity rescaling maybe needed for s
to fit s into the range [0, L-1])
The image becomes brighter
0 r L-1 and details are more visible.
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Power-Law (Gamma) Transformations
produce brighter image
s cr
where c and are γ decreases
positive constants.
Intensity rescaling
may be needed for
s to fit s into the
range [0, L-1].
γ increases
Also, known as
gamma ( )
produce darker image
correction.
Examples: http://www.cambridgeincolour.com/tutorials/photoshop-curves.htm
Power-Law (Gamma) Transformations
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Original
image γ = 0.6
γ=4 γ=5
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Intensity normalization
photo s = r
s = T[r] s
0 0
Ratio 8 bits
Contrast stretching by
a piecewise linear
transformation
function
Output image
If r1 rmin s1 0
r2 rmax s2 L 1
then intensity levels are stretched to the
full intensity range [0, L – 1].
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Contrast Stretching
A low-contrast image
If r1 r2 s1 0 s2 L 1
then the image is thresholded and a
binary image is produced.
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Windowing (or Gray Level Slicing)
L-1
Operating with a “window”
T(r) of gray levels ri to r(i+x)
s
This function highlights the
intensity levels between the
ri r(i+x) range
0 r L-1
L-1
L-1 L-1
T(r)
s
s T(r) s T(r)
ri r(i+x)
ri r(i+x)
ri r(i+x)
0 r L-1
0 r L-1 0 r L-1
Properties of T(r)
•No-inverse due to
• From r to s, ambiguity
T(r) •Does not preserve
one-to-one mapping gray level ordering
• From s to r, •For non-inverse
one-to-many mapping transformation, it is
not a one-to-one
mapping and is
0 one-to-many mapping.
0 r
Bit-Plane Slicing
• Pixel values are integers composed of bits
• 8 bits give the values between 0 and 255
• Each bit contributes to the entire image appearance
• Each bit can be viewed as a one-bit image
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Bit-Plane Slicing
• Plane 8 1-bit image is the highest-order bit, most-significant bit
• Decomposing an image into bit planes helps analyzing the image properties
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Bit-Plane Slicing
• An image can be reconstructed by combining different
bit planes
• The nth bit plane times is added to the
reconstructed image to form the grey scale image
• If there are n bits, the constructed image has image
intensity levels.
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com