Unit 2
Unit 2
Unit 2
INTRODUCTION: Process an image so that the result is more suitable than the original
image for a specific application.
Spatial domain refers to the image plane itself and are based on the direct manipulation of
pixels in an image.
Frequency domain processing techniques are based on modifying the Fourier transform of
an image.
Image enhancement techniques are based on gray level transformation functions.
where, f(x,y) is the input image and g(x,y) is the processed image,
T is an operator on f, defined over some neighbourhood of (x,y)
Square or Rectangular sub image area centred at (x,y) is used as a neighbourhood about a
point (x,y).
Here, T is a gray level transformation function of the form:
s = T(r)
where, r and s – denote the gray levels of f(x,y) and g(x,y) at any point (x,y).
1. IMAGE NEGATIVES: The negative of an image with gray levels in the range[0,L-1] is
obtained using negative transformations and the expression is:
s = L-1- r
This type of processing is particularly suited for enhancing white or gray detail embedded in
dark regions of an image, especially when the black area is dominant in size.
Unit 2 - Image enhancement in Spatial domain:
| |
Fig1 is the original image and fig2 is the result of the image negative where the dark region
of the image gets converted into the light region. i.e. binary 1 becomes binary 0 and vice
versa.
The curve generated with the value of γ>1 has exactly the opposite effect as those generated
with γ<1.
By convention, the exponent in the power law equation is referred to as gamma. The process
used to correct this power law response is called gamma correction.
Images that are not corrected properly can look either bleached out or too dark.
Histogram Processing Techniques: The histogram of a digital image with gray levels in the
range[0, L-1] is a discrete function,
h(rk) = nk
th
where, rk is the k gray level & nk is number of pixels in the image having gray level
rk
Histogram is normalized by dividing each of its values by the total no. of pixels in the image
denoted by ‘n’.
Thus normalized histogram is given by,
P(rk) = nk/n
where, k = 0,1,2,….L-1
Histograms are the basis for numerous spatial domain processing techniques.
Histogram manipulation is used effectively for image enhancement, also quite useful in other
image processing applications viz image compression & segmentation.
Spatial Filtering: Spatial Filtering technique is used directly on pixels of an image. Mask is
usually considered to be added in size so that it has specific center pixel. This mask is moved
on the image such that the center of the mask traverses all image pixels.
There are two types:
1. Linear Spatial Filter: Linear spatial filter is simply the average of the pixels contained in
the neighborhood of the filter mask. The idea is replacing the value of every pixel in an image
by the average of the grey levels in the neighborhood define by the filter mask.
(i) Averaging filter: It is used in reduction of the detail in image. All coefficients are equal.
Unit 2 - Image enhancement in Spatial domain:
(ii) Weighted averaging filter: In this, pixels are multiplied by different coefficients. Center
pixel is multiplied by a higher value than average filter.
2. Non-linear Spatial Filter: It is based on the ordering the pixels contained in the image
area encompassed by the filter. It replaces the value of the center pixel with the value
determined by the ranking result. Edges are better preserved in this filtering.
(i) Minimum filter: 0th percentile filter is the minimum filter. The value of the center is
replaced by the smallest value in the window.
(ii) Maximum filter: 100th percentile filter is the maximum filter. The value of the center is
replaced by the largest value in the window.
(iii) Median filter: Each pixel in the image is considered. First neighboring pixels are sorted
and original values of the pixel is replaced by the median of the list.
Low pass filtering: Low pass filter is the type of frequency domain filter that is used for
smoothing the image. It attenuates the high frequency components and preserves the low
frequency components.
High pass filtering: High pass filter is the type of frequency domain filter that is used for
sharpening the image. It attenuates the low frequency components and preserves the high
frequency components.