Chapter3 Enhancement
Chapter3 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
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:
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)
H.R. Pourreza