Digital Image Processing (Chapter 3) PDF
Digital Image Processing (Chapter 3) PDF
Spatial Domain
• Image Enhancement:
– The objective of image enhancement is to process
an image so that the result is more suitable than
the original image for a specific application.
– Spatial domain refers to the image place itself.
– Frequency domain processing techniques are
based on modifying the Fourier transform of an
image.
Image Enhancement in the Spatial
Domain
• Find gray level transformation function T(r)
to obtain processed image from input image.
• g(x, y) =T[f(x, y)]
• Reasons:
– Contrast enhancement
– Visual improvement
– Image understanding
Spatial Operations
• Single pixel operations (Intensity
Transformation)
– Negative Image, contrast stretching etc.
• Neighborhood operations
– Averaging filter, median filtering etc.
• Geometric spatial transformations
– Scaling, Rotation, Translations etc.
Spatial Operations
• Single Pixel Operation (Point Processing)
– Enhancement at any point in the image depends
only on the gray level at that point.
• Neighborhood Operation (Mask processing or
Filtering)
– The values of mask (also referred to as filter,
kernel, template, window) coefficient determine
the nature of the enhance process.
Example: Single Pixel Operations
Example: Neighborhood Operations
Example: Geometric Spatial Operations
Some Basic Gray Level Transformation
Image Negatives
• s=L–1–r
– s is the output intensity value
– L is the highest intensity levels
– r is the input intensity value
• Particularly suited for enhancing white or gray detail
embedded in dark regions of an image, especially when
the black areas are dominant in size.
• Produces photographic negative.
• Some details are easier to spot if we go from black
and white to white and black.
Image Negative
Log Transformations
• s = clog(1 + r), c is constant.
• It maps a narrow range of low intensity values in the
input into a wide range of output levels.
• The opposite is true of higher values of input levels.
• It expands the values of dark pixels in an image while
compressing the higher level values.
• It compresses the dynamic range of images with large
variations in pixel values.
• The opposite is true of the inverse log
transformation.
Log Transformations
T (r) c log(1 r)
Power Law (Gamma) Transformations
• s = crγ, c and γ are both positive constants.
• With fractional values(0<γ<1) of gamma map a
narrow range of dark input values into a wider
range of output values, with the opposite being true
for higher values (γ >1)of input levels.
• Variety of devices used for image capture, printing,
and display respond according to a power law.
• Process used to correct these power law response
phenomena is called gamma correction.
Power Law (Gamma) Transformations
Power Law (Gamma) Transformations
• CRT devices have
Intensity-voltage
response functions
that are power
functions.
• They vary in exponents
from 1.8 to 2.5.
T (r ) r 1/ 2.5
r 0.4
Power Law (Gamma) Transformations
• Images that are not corrected properly look either
bleached out or too dark.
• Varying gamma changes not only intensity, but also
the ratio of red to green to blue in a color images.
te
Histogram
Histogram
Histogram
Histogram
r 0 1 2 3 4 5 6 7
h(r) 8 4 3 2 2 0 1 5
Image matrix
h(r)
Number of pixels of intensity r
0 1 2 3 4 5 6 7
Intensity values r
HISTOGRAM
and round the resulting values to the integer range [0, L-1]
2) Compute all values of the transqformation function G using
same equation G(z q ) (L 1) p z (ri ) = sq, q 0,1,2,..., L
and round values of G. i0