0% found this document useful (0 votes)
10 views22 pages

L1 - Image Enhancement Spatial Intensity Transformation

Uploaded by

Gary Fung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views22 pages

L1 - Image Enhancement Spatial Intensity Transformation

Uploaded by

Gary Fung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Image Enhancement in

the Spatial Domain

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.

• Two broad categories of enhancement


methods
– Spatial domain (this topic)
• Works with pixels
– Frequency domain (will be covered in the other topic)
• Works with frequencies
Spatial Domain

g(x,y) = T[ f(x,y) ]

• f(x,y) = input image


• g(x,y) = output, processed, transformed image
• T is an operator on f
– T = intensity transformation function
– T is defined over some neighborhood of (x, y), e.g.,
square or rectangular sub-image area or a point of 1x1
size
– T can be operated on a single image or a set of images.
g(x,y) = T[ f(x,y) ]

Image g ( x,y )

Input Image Output Image

T = intensity transformation function

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 )

T = intensity transformation function

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

It produces an image of lower T is a thresholding function


contrast than the original by
(1) darkening the intensity It produces a binary image with
levels above m, and an intensity threshold at m.
(2) brightening the leaves
below m in the original Low intensity levels below m
image. map to zero and high intensity
levels above m map to s.
Basic Gray Level Transforms: Inverse
or Image Negatives

L-1

T(r)
s

0
r
L-1

s = T(r) = (L-1)-r

Negatives of the images above


Brightening

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

With the help of power-law


transformation, fractures
near the vertical centre of
the spine are now made
more visible in the magnetic
resonance image.
γ = 0.4 γ = 0.3
The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Original γ=3
image

γ=4 γ=5

The figure is provided by Pearson Education, Digital Image Processing, Gonzalez & Woods, www.ImageProcessingPlace.com
Intensity normalization

r = input intensity s = output


gamma

photo s = r
s = T[r] s

r = [0 – 255] 1000 Linear mapping s = [0 - 1000]


8 bits 1000-s Max value of s = 1000
255
s 1000-0 Min value of s = 0
output a ?Final

0 0

known unknown (Final)

Ratio 8 bits

(Full range) (Full range)


Contrast Stretching
A low-contrast image

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

Output binary 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.

• One-to-one mapping T(r) •Inverse


• Increasing •Preserves gray level
s ordering (increasing)

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

You might also like