0% found this document useful (0 votes)
7 views

Chapter3 Enhancement

Contrast stretching and histogram equalization are techniques to enhance low contrast images by expanding the dynamic range of pixel intensities. Contrast stretching linearly maps intensity values to span the full display range, while histogram equalization non-linearly distributes pixels uniformly across intensities. Spatial techniques like low-pass filtering blur images to reduce noise, while high-pass filtering and unsharp masking enhance edges to reduce blurring. Frequency domain filtering involves applying ideal low-pass or high-pass filters to attenuate high or low frequencies respectively, sharpening or smoothing the image.

Uploaded by

asmaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Chapter3 Enhancement

Contrast stretching and histogram equalization are techniques to enhance low contrast images by expanding the dynamic range of pixel intensities. Contrast stretching linearly maps intensity values to span the full display range, while histogram equalization non-linearly distributes pixels uniformly across intensities. Spatial techniques like low-pass filtering blur images to reduce noise, while high-pass filtering and unsharp masking enhance edges to reduce blurring. Frequency domain filtering involves applying ideal low-pass or high-pass filters to attenuate high or low frequencies respectively, sharpening or smoothing the image.

Uploaded by

asmaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Image Enhancement

Contrast Stretching
❑ Low contrast images occur often due to poor or non uniform lighting
conditions, or due to nonlinearity, or small dynamic range of the imaging
sensor.
❑ Purpose of contrast stretching is to process such images so that the
dynamic range of the image will be very high, so that different details in
the objects present in the image will be clearly visible.
❑ Contrast stretching process expands dynamic range of intensity levels in
an image so that it spans the full intensity range of the recording medium or
display devices
Histogram
Histogram Processing
• Histogram
h(rk ) = nk
– where is the rk kth gray level and is the n
k
number of pixels in the image having gray level
– Normalized histogram rk

p (rk ) = nk / n
Histogram Equalization
Image enhancement-part1

Spatial Frequency
enhancement enhancement
Spatial image enhancement

❑Spatial low-pass , high-pass and band-pass


❑Median filtering
❑Un-sharp masking
❑Directional smoothing
Spatial Filtering
I J
g (m, n) =   w(i, j ) f (m − i, n − j )
i =− I j =− J

2D FIR filtering
▪ Mask filtering: convolution of
the image with a 2D mask
▪ Applications to image
enhancement:
• Smoothing: low pass
▪ Data-dependent nonlinear
• Sharpening: high pass filters
– Local histogram
– Order statistic filters
• Medium filter
• The output (response) of a smoothing, linear spatial filter is
simply the average of the pixels contained in the
neighbourhood of the mask. These filters sometimes are called
averaging filters. they also are referred to a lowpass filters.
Low-pass filtering
❑Low-pass filtering of an image is a spatial
averaging operation
❑It produces an output image which is a smooth
version of original image
❑It is useful in removing noise which appears as
sharp bright points
❑Low-pass filtering leads to blurring image
Uniform filtering
❑ The most popular masks for lowpass filtering are masks with
all their coefficients positive and equal to each other as for
example the mask shown below. Moreover, they sum upto1 in
order to maintain the mean of the image.
High pass filtering
❑ High pass filtering passes high frequencies, in which
low frequencies are attenuated.
❑ It is used to edge enhancement
❑ It is used for image de-blurring
Averaging filtering
Each pixel is replaced by weighted average of
its neighborhood pixels, resulting image is the
low pass filtered image and the output image is:

W is a suitable chosen neighborhood around the pixel location (m,n)


A(k,1) is the filter weight
Unsharp masking
• A sharp image can be obtained by high pass
filtering a blurred image
• Subtracting blurred image from original image
Leads to the sharpening of the image.
Unsharp masking
Directional smoothing
Low-pass filters result in blurring image and
edges are blurred by averaging, spatial averages
are calculated as:
Median Filtering
Input pixel is replaced by median of the pixels
contained in the neighborhood

Where W is chosen neighborhood

Useful in removing impulsive


noise (salt-and-pepper noise)
without smoothing the rest of
the image.
Properties of median filtering
Contrast Streching
Sharpening Spatial Filters

• Sharpening spatial filters seek to highlight fine


detail
• Remove blurring from images
• Highlight edges

• Sharpening filters are based on spatial


differentiation
Enhancement in frequency domain
Convolution
convolution theorem establishes a correspondence
between filtering in the spatial and frequency domains
as shown in the following table.

Spatial domain Frequency domain


Average filter Gaussian lowpass filter
Laplacian Gaussian high pass filter

The convolution theorem links filters in both domains (spatial and frequency)
❑ a low-pass filter is a filter that attenuates high frequencies while
``passing'' low frequencies.
❑ Low frequencies correspond to the slowly varying components
of an image (e.g., uniform background);
❑ a high-pass filter is a filter that attenuates low frequencies while
``passing'' high frequencies.
❑ High frequencies correspond to the sharply varying components
of an image (e.g., edges).
However, filters in the spatial domain have smaller masks than
those in the frequency domain. That is, one can first specify a filter
in the frequency domain, take its inverse Fourier transform, and
then use the resulting filter in the spatial domain as a guide for
constructing smaller spatial filter masks!
Convolution
g(t) = k(t)*h(t)
k(t) h(t) g(t)
G(f) = K(f)H(f)

* is a convolution operator and not multiplication


M −1
1
g ( t ) = k ( t ) * h( t ) =
M
 k (t − m)h(m)
m= 0
k(t)
h(t)
3
2
1
1
t t
-1 1 2 3
Convolution theorem
• It states that convolution in spatial domain is
equivalent to multiplication in frequency
domain.
• Enhancement in frequency domain is achieved
By high-pass, low-pass and band-pass filtering of
the original image.

Low Pass Filter attenuate High Pass Filter


high frequencies while attenuate low frequencies
“passing” low frequencies. while “passing” high
frequencies.
Low-pass (LP) in frequency domain
• An ideal low-pass filter transfer function in 2D
is given by:
Smoothing
Frequency
Domain, Ideal
Low-pass Filters
Butterworth filter
• Butterworth filter transfer function has a
smooth transition from pass band to cutoff
band and when

Transfer function of Butterworth low-pass filter of order n is


Sharpening
Frequency
Domain, Ideal
High-pass
Filters
Homomorphic filter
• Image f(x,y) may be characterized by two
components (1) amount of source light
• (2)amount of light reflected by objects
• These portions are called illumination and
reflectance components and denoted by i(x,y)
And r(x,y)
We combine multiplication of i(x,y) and r(x,y) to
give a function f(x,y)
Homomorphic Filtering
Homomorphic Filtering

H.R. Pourreza

You might also like