UNIT- III
IMAGE ENHANCEMENT
1 a) Define image enhancement and point operations in image [L1][CO3] [6M]
enhancement?
Image Enhancement:
Image-enhancement techniques are designed to improve the quality of an
image as perceived by a human being. Image enhancement can be
performed both in the spatial as well as in the frequency domain.
Enhancement methods are application specific and are often developed
empirically. Image enhancement techniques emphasize specific image
features to improve the visual perception of an image.
Image-enhancement techniques can be classified into two broad categories
as
(1) spatial domain method, and
(2) transform domain method.
spatial domain method:
The spatial domain method operates directly on pixels, whereas the
transform domain method operates on the Fourier transform of an image
and then transforms it back to the spatial domain. Elementary enhancement
techniques are histogram-based because they are simple, fast, and with
them acceptable results for some applications can be achieved.
The spatial domain technique deals with the manipulation of pixel values.
The spatial domain technique can be broadly classified into
(i) point operation,
(ii) mask operation, and
(iii) global operation.
point operation
In point operation, each pixel is modified by an equation that is not
dependent on other pixel values. The point operation is illustrated in below
Fig.
The point operation is represented by
g (m, n) = T [ f (m, n)]
In point operation, T operates on one pixel, or there exists a one-to-one
mapping between the input image f (m, n) and the output image g (m, n). 5
Fig. point operation
FFfFig.2
b) Illustrate the contrast stretching in image enhancement with suitable [L2][CO3] [6M]
example.
One of the simplest piecewise linear functions is a contrast-stretching
transformation. Low-contrast images can result from poor
illumination, lack of dynamic range in the imaging sensor, or even the
wrong setting of a lens aperture during image acquisition. Contrast
stretching is a process that expands the range of intensity levels in an
image so that it spans the full intensity range of the recording medium
or display device.
Figure shows a typical transformation used for contrast stretching.
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 levels.
• If r1 = r2, s1 = 0 and s2 = L- 1, the transformation becomes a
thresholding function that creates a binary image, as illustrated
in Fig Intermediate values of (r1, s1) and (r2, s2) 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.
This condition preserves the order of intensity levels, thus preventing
the creation of intensity artifacts in the processed image.
Three ways of representation of image
• 8-bit image with low contrast.
• The result of contrast stretching, obtained by setting (r₁, S1) =
(rmin, 0) and (r2, s2) = (rmax, L- 1), where rmin and Imax denote
the minimum and maximum intensity levels in the image,
respectively. Thus, the transformation function stretched the
levels linearly from their original range to the full range [0, L -
1].
• Finally, the result of using the thresholding function defined
previously, with (r1, s1) = (m, 0) and (r2, s2) = (m, L - 1),
where m is the mean intensity level in the image.
The original image on which these results are based is a scanning
electron microscope image of pollen, magnified approximately 700
times.
2 a) Define negative image transformation and illustrate with suitable [L1][CO3] [6M]
example.
The negative of an image with intensity levels in the range [0,L−1] is
obtained using the negative transformation. The expression for this
transformation is given by
s=L−1−r
. This process reverses the intensity levels, creating the equivalent of a
photographic negative. This type of processing is particularly useful for
enhancing white or gray details found within dark regions of an image.
b) Explain the Intensity level slicing operation and bit extraction [L2][CO3] [6M]
operation in image enhancement with suitable example.
Intensity level slicing
Highlighting a specific range of intensities in an image often is of
interest. Applications slicing, can be implemented in several ways,
but most are variations of two basic themes. 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,
shown in Fig. (a), produces a binary image. The second approach,
based on the transformation in Fig. (b), brightens (or darkens) the
desired range of intensities but leaves all other intensity levels in the
image unchanged. include enhancing features such as masses of water
in satellite imagery and enhancing flaws in X-ray images. The
process, often called intensity-level.
Bit Extraction Operation
Pixels are digital numbers composed of bits. For example, the
intensity of each pixel in a 256-level gray-scale image is composed of
8 bits (i.e.. one byte). Instead of highlighting intensity-level ranges,
we could highlight the contribution made to total image appearance
by specific bits. As Fig illustrates, an 8-bit image may be considered
as being composed of eight 1-bit planes, with plane containing the
lowest-order bit of all pixels in the image and plane 8 all the highest-
order bits.
3 a) Define histogram and draw the histogram four basic image types. [L1][CO3] [6M]
Histogram
The histogram of an image is a plot of the number of occurrences of gray
levels in the image against the gray-level values. The histogram provides a
convenient summary of the intensities in an image, but it is unable to
convey any information regarding spatial relationships between pixels. The
histogram provides more insight about image contrast and brightness.
The histogram of a digital image with intensity levels in the range [0, L - 1]
is a discrete function h(rk) = nk, where r is the kth intensity value and n is
the number of pixels in the image with intensity r. It is common practice to
normalize a histogram by dividing each of its components by the total
number of pixels in the image, denoted by the product MN, where, as
usual, M and N are the row and column dimensions of the image. Thus, a
normalized histogram is given by p(r) = n/MN, for k = 0, 1, 2,..., L - 1.
Loosely speaking, p(r) is an estimate of the probability of occurrence of
intensity level r in an image. The sum of all components of a normalized
histogram is equal to 1.
Histogram Four Basic Image Types
b) Explain the procedure for histogram process and uses of histogram. [L2][CO3] [6M]
Procedure to Perform Histogram Equalisation
Histogram equalization is done by performing the following steps:
1. Find the running sum of the histogram values.
2. Normalize the values from Step (1) by dividing by the total number of
pixels.
3. Multiply the values from Step (2) by the maximum gray-level value and
round.
4. Map the gray level values to the results from Step (3) using a one-to-one
correspondence.
Histogram Equalization
Consider for a moment continuous intensity values and let the variable r
denote the intensities of an image to be processed. As usual, we assume
that r is in the range [O, L - 1], with r = 0 representing black and r = L - 1
representing white. For r satisfying these conditions, we focus attention on
transformations (intensity mappings) of the form
s = T(r) 0≤r< L -1
that produce an output intensity level s for every pixel in the input image
having intensity r. We assume that:
(a) T(r) is a monotonically increasing function in the interval 0≤r< L -1
And
(b) 0≤ T(r) ≤ L - 1 for0≤r< L -1. In some formulations to be discussed
later, we use the inverse
r = T-1(s) 0 ≤s≤L-1
(c) T(r) is a strictly monotonically increasing function in the interval
0≤r< L -1
4 a) Discuss the mechanics of spatial filtering with suitable diagram. [L2][CO3] [6M]
Spatial filter consists of
(1) a neighborhood, (typically a small rectangle), and
(2) a predefined operation that is performed on the image pixels
encompassed by the neighborhood.
Filtering creates a new pixel with coordinates equal to the coordinates of
the center of the neighborhood, and whose value is the result of the
filtering operation. A processed (filtered) image is generated as the center
of the filter visits each pixel in the input image. If the operation performed
on the image pixels is linear, then the filter is called a linear spatial filter.
Otherwise, the filter is nonlinear.
Figure illustrates the mechanics of linear spatial filtering using a 3 ×3
neighborhood. At any point (x, y) in the image, the response, g(x, y), of
the filter is the sum of products of the filter coefficients and the image
pixels encompassed by the filter:
g(x, y) = w(-1,-1)f(x — 1, y — 1) + w(-1, 0)f(x - 1, y) + w(0,0)f(x, y) +
... + w(1, 1)f(x + 1, y + 1)
Observe that the center coefficient of the filter, w(0, 0), aligns with the
pixel at location (x, y). For a mask of size m×n, we assume that m = 2a +
1 and n = 2b + 1, where a and b are positive integers. This means that our
focus in the following discussion is on filters of odd size, with the smallest
being of size 3 x 3. In general, linear spatial filtering of an image of size
M × N with a filter of size M × N is given by the expression:
where x and y are varied so that each pixel in w visits every pixel in f.
b) Illustrate the smoothing spatial filters along with the required [L2][CO3] [6M]
expressions.
Smoothing Linear Filters
The output (response) of a smoothing, linear spatial filter is simply the
average of the pixels contained in the neighborhood of the filter mask.
These filters sometimes are called averaging filters. They also are referred
to a lowpass filters.
The idea behind smoothing filters is straightforward. By replacing the value
of every pixel in an image by the average of the intensity levels in the
neighborhood defined by the filter mask, this process results in an image
with reduced "sharp" transitions in intensities. Because random noise
typically consists of sharp transitions in intensity levels, the most obvious
application of smoothing is noise reduction. However, edges (which almost
always are desirable features of an image) also are characterized by sharp
intensity transitions, so averaging filters have the undesirable side effect
that they blur edges.
Figure shows two 3 x 3 smoothing filters Use of the first filter yields the
standard average of the pixels under the mask. This can best be seen by
substituting the coefficients of the mask into Eq. which is the average of
the intensity levels of the pixels in the 3 x 3 neighbor-hood defined by the
mask, as discussed earlier.
Note that, instead of being 1/9, the general implementation for filtering an
MN image with a weighted averaging filter of size mxn is m and n odd is
given by the expression
The parameters in this equation are as defined in Eq .As before, it is
understood that the complete filtered image is obtained by applying Eq. for
x = 0, 1, 2 M - 1 and y = 0, 1, 2 ,...,N-1
5 a) Illustrate the sharpening spatial filters along with the required [L2][CO3] [6M]
expressions.
A basic definition of the first-order derivative of a one-dimensional
function 𝑓(𝑥) is the difference
𝜕f/𝜕x=f(x+1)−f(x)
We used a partial derivative here in order to keep the notation the same as
when we consider an image function of two variables, 𝑓(𝑥,𝑦), at which
time we will be dealing with partial derivatives along the two spatial axes.
When there is only one variable in the function; the same is true for the
second derivative. We define the second-order derivative of 𝑓(𝑥) as the
difference
Laplacian Definition: The Laplacian operator, a simple isotropic
derivative operator for a function (image) 𝑓(𝑥,𝑦)of two variables, is defined
as:
• Discrete Formulations for Second Derivatives:
o In the x-direction, the discrete form of the second derivative is:
•
• In the y-direction, the discrete form of the second derivative is:
The image displays the formula for the discrete Laplacian of two variables,
represented as ∇2f(x,y).
Fig: Filter mask, with neighbor and diagonal
b) Define the image enhancement in frequency domain and give the [L1][CO3] [6M]
expression.
Image enhancement in frequency domain
Frequency refers to the rate of repetition of some periodic event. In image
processing, spatial frequency refers to the variation of image brightness
with its position in space. A varying signal can be transformed into a series
of simple periodic variations. The Fourier transform decomposes a signal
into a set of sine waves of different characteristics like frequency and phase
This selective enhancement or suppression of frequency components is
termed Fourier filtering or frequency domain filtering. The spatial
representation of image data describes the adjacency relationship between
the pixels. On the other hand, the frequency domain representation clusters
the image data according to their frequency distribution.
In frequency domain filtering, the image data is dissected into various
spectral bands, where each band depicts a specific range of details within
the image. The process of selective frequency inclusion or exclusion is
termed frequency domain filtering.
If filtering in spatial domain is done by convolving the input image f (m, n)
with the filter kernel h (m, n),
Filtering in spatial domain = f (m, n) ∗ h (m, n)
In the frequency domain, filtering corresponds to the multiplication of the
image spectrum by the Fourier transform of the filter kernel, which is
referred to as the frequency response of the filter
Filtering in the frequency domain = F (k, l) × H (k, l)
Here, F (k, l) is the spectrum of the input image and H (k, l) is the spectrum
of the filter kernel. Thus, frequency domain filtering is accomplished by
taking the Fourier transform of the image and the Fourier transform of the
kernel, multiplying the two Fourier transforms, and taking the inverse
Fourier transform of the result.
6 a) Discuss the smoothing filters in frequency domain along with the [L2][CO3] [6M]
required expressions.
Smoothing Filters In Frequency Domain:
Edges and other sharp intensity transitions (such as noise) in an image
contribute significantly to the high-frequency content of its Fourier
transform. Hence, smoothing (blurring) is achieved in the frequency
domain by high-frequency attenuation; that is, by lowpass filtering. In
this section, we consider three types of lowpass filters: ideal,
Butterworth, and Gaussian. These three categories cover the range
from very sharp (ideal) to very smooth (Gaussian) filtering. H(u, v),
are understood to be discrete functions of size P X Q; that is, the
discrete frequency variables are in the range u=0,1,2,...,P-1 and
v=0,1,2,...,Q-1.
[Link] Lowpass Filters:
A 2-D lowpass filter that passes without attenuation all frequencies
within a circle of radius D₀ from the origin and "cuts off" all
frequencies outside this circle is called an ideal lowpass filter (ILPF);
it is specified by the function
where D₀ is a positive constant and D(u, v) is the distance between a point
(u, v) in the frequency domain and the center of the frequency
rectangle; that is,
where, as before, P and Q are the padded sizes from Eqs. Figure Fig.
(a) shows the filter displayed as an image ,as that all frequencies on or
inside a circle of radius D₀ are passed
Fig (a) Fig (b)
The ideal lowpass filter is radially symmetric about the origin, as Fig.
(b) shows filter radial cross section. Rotating the cross section by
360° yields the filter in 2-D. For an ILPF cross section, the point of
transition between H(u,v)=1 and H(u,v)=0 is called the cutoff
frequency
Butterworth lowpass filter (BLPF)
The transfer function of a Butterworth lowpass filter (BLPF) of order 𝑛,and
with cutoff frequency at a distance D0 from the origin, is defined as
Fig (a) Fig(b)
Fig (a) Filter displayed as an image. (d) Filter radial cross sections of
orders 1 through 4.
where 𝐷(𝑢,𝑣)= √𝑢2 − v2 is the distance from the origin in the frequency
domain.
b) Explain the sharpening filters in frequency domain along with the [L2][CO3] [6M]
required expressions.
Sharpening Filters In Frequency Domain:
An image can be smoothed by attenuating the high-frequency components
of its Fourier transform. Because edges and other abrupt changes in
intensities are associated with high-frequency components, image
sharpening can be achieved in the frequency domain by high pass filtering,
which attenuates the low-frequency components without disturbing high
frequency information in the Fourier transform. All filter functions, 𝐻(𝑢,𝑣)
, are understood to be discrete functions of size 𝑃×𝑄 that is, the discrete
frequency variables are in the range u=0,1,2,…, 𝑃−1 and v=0,1,2,…,Q−1.
A high pass filter is obtained from a given lowpass filter using the equation
Ideal High pass Filters
A 2-D ideal high pass filter (IHPF) is defined as
Fig Cross section Ideal High pass filter
Butterworth High pass Filter (BHPF)
The image defines a 2-D Butterworth Highpass Filter (BHPF) of order 'n'
and cutoff frequency 'D₀'. The filter, denoted as 𝐻(𝑢,𝑣) is mathematically
expressed as
• (𝑢,) represents the transfer function of the filter in the frequency domain,
where u and v are frequency variables.
• is the cutoff frequency, which determines the point where the filter starts
attenuating frequencies.
• is the order of the filter, influencing the steepness of the filter's transition
band.
• where 𝐷(𝑢,𝑣)= √𝑢2 − v2 is the distance from the origin in the frequency
domain.
7 a) Define the following terms: Saturation, Hue and Brightness. [L1][CO3] [6M]
Saturation
• Saturation describes the intensity or purity of a color.
• A highly saturated color looks vivid and rich, while a low-saturation
color looks more washed out or grayish.
• Saturation indicates how much gray is mixed with the hue.
Hue
• Hue refers to the color itself—basically, what we usually call
"color," such as red, blue, green, yellow, etc.
• It is determined by the wavelength of light and represents the
position on the color spectrum.
Brightness (sometimes called Value or Lightness)
• Brightness refers to how light or dark a color appears.
• It measures the amount of light emitted or reflected by a color.
• High brightness means the color looks closer to white; low
brightness means it looks closer to black.
b) Draw the CIE chromaticity diagram and mention its significance. [L1][CO3] [6M]
Significance:
• Universal Color Representation: It provides a standardized way to
specify colors independent of devices (monitors, printers, etc.).
• Color Matching: It helps in color matching by showing how colors mix.
Any color inside the diagram can be represented as a combination of colors
on the boundary.
• Color Gamut: The diagram helps visualize the gamut of different
devices or systems by outlining the colors they can reproduce.
• Human Vision Basis: It is based on human color perception, so it aligns
closely with how we see colors.
• Color Quality Control: Widely used in industries like lighting, printing,
and display manufacturing to control and specify color accurately.
CIE chromaticity diagram:
8 a) Define the following terms: Radiance, Luminance and Brightness. [L1][CO3] [6M]
Radiance:
Radiance is the measure of the amount of light energy (or electromagnetic
radiation) emitted, reflected, or transmitted by a surface, per unit area, per
unit solid angle, and per unit wavelength or frequency.
• Units: Watts per square meter per steradian (W/m²·sr).
• Radiance is used in optics, computer graphics, and colorimetry to
quantify actual light intensity from sources or surfaces.
Luminance:
Luminance is the photometric equivalent of radiance, measuring the
amount of visible light emitted or reflected from a surface in a particular
direction, weighted by the human eye’s sensitivity to different wavelengths.
• Units: Candelas per square meter (cd/m²)
• It is used to Important in lighting design, display technology, and
image processing for assessing how bright a surface will appear.
Brightness
• Brightness is a subjective perception of how light or bright a color
or surface appears to an observer.
• It depends on the observer’s perception, context, adaptation, and
surroundings.
• In color image processing, brightness often refers to the "lightness"
or intensity component of a color model (e.g., in HSB or HSL
models).
b) Give the importance of the Color Models and explain the RGB models. [L2][CO3] [6M]
Importance of the Color Models:
• The purpose of a color model (also called color space or color system) is
to facilitate the specification of colors in some standard, generally
accepted way.
• In essence, a color model is a specification of a coordinate system and a
subspace within that system where each color is represented by a single
point.
• Colour models provide a standard way to specify a particular colour by
defining a 3D coordinate system, and a subspace that contains all
constructible colours within a particular model. A
• ny colour can be specified using a model. Each colour model is oriented
towards a specific software or image-processing application.
RGB models.
In an RGB colour model, the three primary colours red, green and blue form the
axis of the cube which is illustrated in Fig (a). Each point in the cube represents a
specific colour. This model is good for setting the electron gun for a CRT. Images
represented in the RGB color model consist of three component images, one for
each primary color. When fed into an RGB monitor, these three images combine
on the screen to produce a composite color image, as explained in Section 6.1.
The number of bits used to represent each pixel in RGB space is called the pixel
depth. Consider an RGB image in which each of the red, green, and blue images is
an 8-bit image. Under these conditions each RGB color pixel [that is, a triplet of
values (R, G, B)] is said to have a depth of 24 bits (3 image planes times the
number of bits per plane). The term full-color image is used often to denote a 24-
bit RGB color image. The total number of colors in a 24-bit RGB image is (28)3 =
16,777,216. Fig (b)shows the 24-bit RGB color cube corresponding to the diagram
in Fig. (a)
Fig (a) RGB colour model Fig(b) RGB colour cube
Limitations of the RGB Model:
The limitations of the RGB model are summarised below:
(i) The RGB colour coordinates are device dependent.
(ii) The RGB model is not perceptually uniform.
(iii) It is difficult to relate this model to colour appearance because
its basis is to device signals and not display luminance values
9 a) Write brief notes on CMY and CMYK color models. [L1][CO3] [6M]
CMY and CMYK color models:
Printers produce an image by reflective light, which is basically a subtractive
process. Printers commonly employ the CMY model. The CMY model cube is
illustrated in Fig. (b). The conversion between RGB and CMY is done as follows
C=1-R
M=1-G
Y=1-B
CMY is a subtractive colour model. From Fig. (a), it is obvious that
Magenta = White – Green
Cyan = White – Red
Yellow = White –Blue
Fig(a) CMY Colour model Fig(b) CMY colour cube
The equal amounts of the pigment primaries, cyan, magenta, and yellow
should produce black. In practice, combining these colors for printing
produces a muddy-looking black. So, in order to produce true black (which
is the predominant color in printing), a fourth color, black, is added, giving
rise to the CMYK color model. Thus, when publishers talk about "four-
color printing," they are referring to the three colors of the CMY color
model plus black.
b) Explain the method of converting colors from RGB to HSI. [L2][CO3] [6M]
Method of converting colors from RGB to HIS:
HSI stands for Hue, Saturation and Intensity. Hue represents dominant colour as
perceived by an observer. It is an attribute associated with the dominant
wavelength. Saturation refers to the relative purity or the amount of white light
mixed with a hue. Intensity reflects the brightness. HSI decouples the intensity
information from the colour, while hue and saturation correspond to human
perception, thus making this representation very useful for developing image-
processing algorithms. HIS colour space is a popular colour space because it is
based on human colour perception. The conversion from RGB space to HSI
space is given below
Fig Cylindrical representation of HIS colour model
The HIS colour model can be considered as a cylin der, where the coordinates r,
θ, and z are saturation, hue and intensity respectively. The cylindrical
representation of the HIS colour model is illustrated in above Fig
10 a) Illustrate the method of converting colors from HSI to RGB. [L2][CO3] [6M]
Given values of HSI in the interval [0, 1], we now want to find the corresponding
RGB values in the same range. The applicable equations depend on the values of
H. There are three sectors of interest, corresponding to the 120° intervals in the
separation of primaries .We begin by multiplying H by 360°, which returns the
hue to its original range of [0°, 360°].
RG sector (0° ≤ H < 120°): When H is in this sector, the RGB components are
given by the equations
B = I(1 -S)
S cosH
𝑹 = 𝑰 [𝟏 + ]
cos(60 − H)
And G=3I-(R+B)
GB sector (120° ≤ H < 240°): If the given value of H is in this sector, we first
subtract 120° from it
H =H - 120°
Then the RGB components are
R = I(1 -S)
𝐒 𝐜𝐨𝐬𝐇
G = 𝑰 [𝟏 + ]
𝐜𝐨𝐬(𝟔𝟎 − 𝐇)
And B=3I-(R+B)
BR sector (240° ≤ H ≤ 360°): Finally, if H is in this range, we subtract 240° from
it:
H =H - 240°
Then the RGB components are
G = I(1 -S)
𝐒 𝐜𝐨𝐬𝐇
B = 𝑰 [𝟏 + ]
𝐜𝐨𝐬(𝟔𝟎 − 𝐇)
And R=3I-(R+B)
b) Draw the functional block diagram of pseudo colour processing and [L1][CO3] [6M]
explain each block.
Pseudo color (also called false color) image processing consists of assigning
colors to gray values based on a specified criterion. The term pseudo or false
color is used to differentiate the process of assigning colors to monochrome
images from the processes associated with true color images, The principal
use of pseudo color is for human visualization and interpretation of gray-
scale events in an image or sequence of images. As noted at the beginning
of this chapter, one of the principal motivations for using color is the fact
that humans can discern thousands of color shades and intensities, compared
to only two dozen or so shades of gray.
Functional block diagram of pseudo colour processing:
Other types of transformations are more general and thus are capable of
achieving a wider range of pseudo color enhancement results than the
simple slicing technique discussed in the preceding section. An approach
that is particularly attractive is shown in below Fig. Basically, the idea
underlying this approach is to perform three independent transformations on
the intensity of any input pixel. The three results are then fed separately into
the red, green, and blue channels of a color television monitor. This method
produces a composite image whose color content is modulated by the nature
of the transformation
Fig Functional block diagram of pseudo colour processing
Red transformation:
This block takes the input intensity image f(x,y) and applies a specific
transformation function to its intensity values to generate the red
component image fR(x,y)
Green transformation:
Similar to the red transformation, this block processes the input intensity
image f(x,y) with a distinct transformation function to produce the green
component image fG(x,y)
Blue transformation:
This block also takes the input intensity image f(x,y) and applies a unique
transformation function to its intensity values to create the blue component
image fB(x,y)
These three independently transformed component images fR(x,y) , fG(x,y)
, and fB(x,y) are then combined to form the final pseudo-color image.