Digital Image Processing
Course Code: 23ECE151
Semester: V
Course Handling Faculty: Dr. Sameera P
Syllabus
Module 2: Filtering in the Spatial and Frequency Domain
Spatial Domain
• Some Basic Intensity Transformation Functions
• Histogram Processing
• Fundamentals of Spatial Filtering
• Smoothing Spatial Filters
• Sharpening Spatial Filters
Frequency Domain
• Preliminary Concepts
• The Discrete Fourier Transform (DFT) of Two Variables
• Properties of the 2-D DFT
• Filtering in the Frequency Domain
• Image Smoothing and Image Sharpening Using Frequency Domain Filters
• Selective Filtering
BASIC INTENSITY TRANSFORMATION
FUNCTIONS
• Intensity transformations are among the simplest of all image
processing techniques.
• As noted in the previous section, we denote the values of pixels,
before and after processing, by r and s, respectively.
• These values are related by a transformation T, given by
s = T(r)
• we deal with digital quantities, values of an intensity transformation
function typically are stored in a table, and the mappings from r to s
are implemented via table lookups
• For an 8-bit image, a lookup table containing the values of T will have
256 entries
Continued
• Three basic types of functions used frequently in image processing for
intensity transformation are
1. Linear (negative and identity transformations)
2. Logarithmic (log and inverse-log transformations),
3. Power-law (nth power and nth root transformations).
Continued
1. IMAGE NEGATIVES – Transformation
• The negative of an image with intensity levels in the range [0,L-1] is
obtained by using the negative transformation function shown in
which has the form:
s = L-1-r
• Reversing the intensity levels of a digital image in this manner
produces the equivalent of a photographic negative
• This type of processing is used, for example, in enhancing white or
gray detail embedded in dark regions of an image, especially when
the black areas are dominant in size
Continued
Continued
2. LOG TRANSFORMATIONS
• The general form of the log transformation is
s = c log(1+r)
where c is a constant and it is assumed that r ≥ 0
• This transformation maps a narrow range of low intensity values in
the input into a wider range of output levels - Log
• Conversely, higher values of input levels are mapped to a narrower
range in the output – Inverse Log
• We use a transformation of this type to expand the values of dark
pixels in an image, while compressing the higher-level values
• Any curve having the general shape of the log function would
accomplish this spreading/compressing of intensity levels in an image
Continued
Continued
3. POWER-LAW (GAMMA) TRANSFORMATIONS
• Power-law transformations have the form
𝑠 = 𝑐𝑟 𝛾
where c and 𝛾 are positive constants
• Sometimes Power-law transformations is written as
𝑠 = 𝑐(𝑟 + 𝜀)𝛾
• Family of transformations can be obtained simply by varying 𝛾
• Curves generated with values of 𝛾 > 1 have exactly the opposite effect
as those generated with values of 𝛾 < 1.
• The response of many devices used for image capture, printing, and
display obey a power law
Continued
• The process used to correct these power-law response phenomena is
called gamma correction or gamma encoding.
Continued
PIECEWISE LINEAR TRANSFORMATION
FUNCTIONS
• Three Important Piecewise linear transformation functions are
1. Contrast Stretching
2. Intensity level slicing
3. Bit – plane slicing
Contrast Stretching
• Low-contrast images can result from
1. Poor illumination
2. Lack of dynamic range in the imaging sensor
3. Wrong setting of a lens aperture during image acquisition.
• Contrast stretching expands the range of intensity levels in an image so
that it spans the ideal full intensity range of the recording medium or
display device
Continued
• The locations of points (r1,s1) and (r2,s2)
control the shape of the transformation
function.
• If r1 = s1 and r2 = s2 the transformation is a
linear function that produces no changes in
intensity
• If r1 =r2 , s1 = 0, and s2 = L − 1 the
transformation becomes a thresholding
function that creates a binary image
• Intermediate values of (r1,s1) and (s2,r2)
produce various degrees of spread in the
intensity levels of the output image, thus
affecting its contrast.
• In general, r1 ≤ r2 and s1≤ s2 is assumed so
that the function is single valued and
monotonically increasing.
Continued
Intensity-Level Slicing
• Intensity-level slicing, can be implemented in several ways, but most
are variations of two basic themes
1. One approach is to display in one value (say, white) all the values in
the range of interest and in another (say, black) all other intensities.
• This transformation, produces a binary image
2. The second approach, brightens (or darkens) the desired range of
intensities, but leaves all other intensity levels in the image unchanged
Continued
Bit-Plane Slicing
• Pixel values are integers composed of bits. For example, values in a
256-level grayscale image are composed of 8 bits (one byte).
• Instead of highlighting intensity-level ranges, we could highlight the
contribution made to total image appearance by specific bits
• An 8-bit image may be considered as being composed of eight one-bit
planes, with plane 1 containing the lowest-order bit of all pixels in the
image, and plane 8 all the highest-order bits.
Continued