Digital Image Processing and Pattern Recognition
E1528
Spring 2024-2025
Lecture 3
Intensity Transformations and Spatial Filtering
Instructor
Dr / Ayman Soliman
➢ Contents
➢ Some Basic Gray Level Transformations
➢ Spatial domain Vs. Frequency domain
➢ Some Basic Gray Level Transformations
➢ Linear - Image Negatives
➢ Linear - Image identity
➢ Log Transformations
➢ Power-Law Transformations
2024-10-18 Dr/ Ayman Soliman 2
➢ Some Basic Gray Level Transformations
➢ The principal objective of enhancement is to process an image so that the
result is more suitable than the original image for a specific application.
➢ Image enhancement is one of the most interesting and visually appealing
areas of image processing.
Image enhancement
approaches
spatial domain frequency domain
2024-10-18 Dr/ Ayman Soliman 3
➢ Spatial domain Vs. Frequency domain
➢ The term spatial domain refers to the image plane itself, and approaches in
this category are based on direct manipulation of pixels in an image.
➢ Frequency domain processing techniques are based on modifying the
Fourier transform of an image.
➢ There is no general theory of image enhancement.
2024-10-18 Dr/ Ayman Soliman 4
➢ Background
➢ Spatial domain processes will be denoted by the expression
𝑔 𝑥, 𝑦 = 𝑇 𝑓 𝑥, 𝑦
Where 𝑓 𝑥, 𝑦 is the input image, g(x, y) is the processed image, and T is an
operator on f, defined over some neighborhood of (x, y).
In addition, T can operate on a set of input images, such as performing the
pixel-by-pixel sum of K images for noise reduction
2024-10-18 Dr/ Ayman Soliman 5
➢ Background
➢ The simplest form of T is when the neighborhood is of size 1*1 (that is, a
single pixel). In this case, g depends only on the value of f at (x, y), and T
becomes a gray-level (also called an intensity or mapping) transformation
function of the form 𝑠 = 𝑇(𝑟)
➢ where, for simplicity in notation, r and s are variables denoting,
respectively, the gray level of f(x, y) and g(x, y) at any point (x, y).
2024-10-18 Dr/ Ayman Soliman 6
➢ Some Basic Gray Level Transformations
Image Enhancement Transformations
linear logarithmic power-law
negative identity log inverse-log nth power nth root
2024-10-18 Dr/ Ayman Soliman 7
➢ Linear - Image Negatives
➢ The negative of an image with gray levels in the range [0, L-1] is obtained
by using the negative transformation shown below, which is given by the
expression 𝑠 =𝐿−1−𝑟
2024-10-18 Dr/ Ayman Soliman 8
➢ Linear - Image Negatives
➢ The original image is a digital mammogram showing a small lesion.
Although the visual content is the same in both images,
➢ Note how much easier it is to analyze the breast tissue in the negative
image in this case.
2024-10-18 Dr/ Ayman Soliman 9
➢ Linear - Image identity
➢ The identity function is the trivial case in which output intensities are
identical to input intensities.
➢ It is included in the graph only for completeness.
2024-10-18 Dr/ Ayman Soliman 10
➢ Log Transformations
➢ The general form of the log transformation is
𝑠 = 𝑐 log(1 + 𝑟)
where c is a constant, and it is assumed that r >= 0.
➢ The shape of the log curve in Fig. below shows that this transformation
maps a narrow range of low gray-level values in the input image into a
wider range of output levels.
2024-10-18 Dr/ Ayman Soliman 11
➢ Power-Law Transformations
➢ Power-law transformations have the basic form
𝑠 = 𝑐𝑟 𝛄
where c and 𝛄 are positive constants.
Sometimes this Eq. is written as 𝑠 = 𝑐(𝑟 + 𝛆)𝛄
to account for an offset (that is, a
measurable output when the input is
zero).
2024-10-18 Dr/ Ayman Soliman 12
➢ Power-Law Transformations Example
(a) Magnetic resonance (MR)
image of a fractured human
spine.
(b-d) Results of applying the
transformation in equation with
c=1 and 𝞬=0.6, 0.4 and 0.3
respectively.
2024-10-18 Dr/ Ayman Soliman 13
➢ Power-Law Transformations Example
(a) Aerial image.
(b-d) Results of applying the
transformation in equation with c=1
and 𝞬=3, 4, and 5 respectively.
2024-10-18 Dr/ Ayman Soliman 14
2024-10-18 Dr/ Ayman Soliman 15