21AD1603_UNIT__II_IMAGE_ENHANCEMENT[1]
21AD1603_UNIT__II_IMAGE_ENHANCEMENT[1]
21AD1603_UNIT__II_IMAGE_ENHANCEMENT[1]
Image enhancement approaches fall into two broad categories: spatial domain methods and
frequency domain methods. 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. Enhancing an image provides better contrast and a more detailed image as compare to
non-enhanced image. Image enhancement has very good applications. It is used to enhance
medical images, images captured in remote sensing, images from satellite etc. The term spatial
domain refers to the aggregate of pixels composing an image. Spatial domain methods are
procedures that operate directly on these pixels. Spatial domain processes will be denoted by
the expression.
g(x,y) = T[f(x,y)]
where f(x, y) 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).
The principal approach in defining a neighborhood about a point (x, y) is to use a square or
rectangular sub image area centered at (x, y), Fig. shows. The center of the sub image is moved
from pixel to pixel starting, say, at the top left corner. The operator T is applied at each location
(x, y) to yield the output, g, at that location. The process utilizes only the pixels in the area of
the image spanned by the neighborhood.
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
s=T(r)
where r is the pixels of the input image and s is the pixels of the output image. T is a
transformation function that maps each value of r to each value of s.
For example, if T(r) has the form shown in Fig. 2.2(a), the effect of this transformation would
be to produce an image of higher contrast than the original by darkening the levels below m
and brightening the levels above m in the original image. In this technique, known as contrast
stretching, the values of r below m are compressed by the transformation function into a narrow
range of s, toward black. The opposite effect takes place for values of r above m.
In the limiting case shown in Fig. 2.2(b), T(r) produces a two-level (binary) image. A mapping
of this form is called a thresholding function.
One of the principal approaches in this formulation is based on the use of so-called masks
(also referred to as filters, kernels, templates, or windows). Basically, a mask is a small (say,
3*3) 2-D array, in which the values of the mask coefficients determine the nature of the
process, such as image sharpening. Enhancement techniques based on this type of approach
often are referred to as mask processing or filtering.
LINEAR TRANSFORMATION:
Linear transformation includes simple identity and negative transformation.
Identity transition is shown by a straight line. In this transition, each value of the input image
is directly mapped to each other value of output image. That results in the same input image
and output image. And hence is called identity transformation. It has been shown below:
The transformation function is assumed to fulfill two condition T(r) is single valued and
monotonically increasing in the internal 0<T(r)<1 for 0<r<1.The transformation function
should be single valued so that the inverse transformations should exist. Monotonically
increasing condition preserves the increasing order from black to white in the output image.
The second conditions guarantee that the output gray levels will be in the same range as the
input levels. The gray levels of the image may be viewed as random variables in the interval
[0.1]. The most fundamental descriptor of a random variable is its probability density function
(PDF) Pr(r) and Ps(s) denote the probability density functions of random variables r and s
respectively. Basic results from an elementary probability theory states that if Pr(r) and Tr are
known and T-1(s) satisfies conditions (a), then the probability density function Ps(s) of the
transformed variable is given by the formula
Thus, the PDF of the transformed variable s is the determined by the gray levels PDF of the
input image and by the chosen transformations function.
A transformation function of a particular importance in image processing
The sum of products of the mask coefficient with the corresponding pixel directly under the
mask.
The coefficient w (0,0) coincides with image value f(x,y) indicating that mask it centered at
(x,y) when the computation of sum of products takes place. For a mask of size MxN we
assume m=2a+1 and n=2b+1, where a and b are nonnegative integers. It shows that all the
masks are of add size.
In the general liner filtering of an image of size f of size M*N with a filter mask of size m*m
is given by the expression
The original value of the pixel is included in the computation of the median. Median filters are
quite popular because, for certain types of random noise, they provide excellent noise-reduction
capabilities, with considerably less blurring than linear smoothing filters of similar size.
Median filters are particularly effective in the presence of both bipolar and unipolar impulse
noise. In fact, the median filter yields excellent results for images corrupted by this type of
noise.
Max and min filters
Although the median filter is by far the order-statistics filter most used in image processing. it
is by no means the only one. The median represents the 50th percentile of a ranked set of
numbers, but the reader will recall from basic statistics that ranking lends itself to many other
possibilities. For example, using the 100th perccntile results in the so-called max filter given
by:
This filter is useful for finding the brightest points in an image. Also, because pepper noise
has very low values, it is reduced by this filter as a result of the max selection process in the
subimage area S. The 0th percentile filter is the Min filter.
SHARPENING SPATIAL FILTERS
The principal objective of sharpening is to highlight fine details in an image or to enhance
details that have been blurred either in error or as a natural effect of particular method for image
acquisition.
The applications of image sharpening range from electronic printing and medical imaging to
industrial inspection and autonomous guidance in military systems.
As smoothing can be achieved by integration, sharpening can be achieved by spatial
differentiation. The strength of response of derivative operator is proportional to the degree of
discontinuity of the image at that point at which the operator is applied. Thus image
differentiation enhances edges and other discontinuities and deemphasizes the areas with slow
varying grey levels.
It is a common practice to approximate the magnitude of the gradient by using absolute
values instead of square and square roots.
A basic definition of a first order derivative of a one dimensional function f(x) is the difference.
The equation can be represented using any one of the following masks
Laplacian highlights gray-level discontinuities in an image and deemphasize the regions of
slow varying gray levels. This makes the background a black image. The background texture
can be recovered by adding the original and Laplacian images.
For example:
The strength of the response of a derivative operator is propositional to the degree of
discontinuity of the image at that point at which the operator is applied. Thus image
differentiation enhances eddies and other discontinuities and deemphasizes areas with slowly
varying gray levels.
The derivative of a digital function is defined in terms of differences. Any first derivative
definition
(1) Must be zero in flat segments (areas of constant gray level values)
(2) Must be nonzero at the onset of a gray level step or ramp
(3) Must be nonzero along ramps.
Any second derivative definition
(1) Must be zero in flat areas
(2) Must be nonzero at the onset and end of a gray level step or ramp
(3) Must be zero along ramps of constant slope.
It is common practice to approximate the magnitude of the gradient by using also lute values
instead or squares and square roots
BASIS OF FILTERING IN FREQUENCY DOMAIN
Basic steps of filtering in frequency Domain
i) Multiply the input image by (-1) X+Y to centre the transform
ii) Compute F(u,v), Fourier Transform of the image
iii) Multiply f(u,v) by a filter function H(u,v)
iv) Compute the inverse DFT of Result of (iii)
v) Obtain the real part of result of (iv)
vi) Multiply the result in (v) by (-1)x=y
H(u,v) called a filter because it suppresses certain frequencies from the image while leaving
others unchanged.
FILTERS
SMOOTHING FREQUENCY DOMAIN FILTERS
Edges and other sharp transition of the gray levels of an image contribute significantly to the
high frequency contents of its Fourier transformation. Hence smoothing is achieved in the
frequency domain by attenuation a specified range of high frequency components in the
transform of a given image.
Basic model of filtering in the frequency domain is
G(u,v) = H(u,v)F(u,v)
F(u,v) - Fourier transform of the image to be smoothed
Objective is to find out a filter function H (u,v) that yields G (u,v) by attenuating the high
frequency component of F (u,v).
There are three types of low pass filters
1. Ideal
2. Butterworth
3. Gaussian
IDEAL LOW PASS FILTER
It is the simplest of all the three filters
It cuts of all high frequency component of the Fourier transform that are at a distance
greater that a specified distance D0 form the origin of the transform.
It is called a two – dimensional ideal low pass filter (ILPF) and has the transfer
function
Where D0 is a specified nonnegative quantity and D(u,v) is the distance from point (u,v) to
the center of frequency rectangle
If the size of image is M*N, filter will also be of the same size so center of the frequency
rectangle (u,v) = (M/2, N/2) because of center transform
Because it is ideal case. So all frequency inside the circle are passed without any attenuation
whereas all frequency outside the circle are completely attenuated.
For an ideal low pass filter cross section, the point of transition between H (u,v) =1 and H
(u,v)=0 is called of the “cut of frequency”
One way to establish a set of standard cut of frequency locus is to compute circle that include
specified amount of total image Power Pt
u=0,1,2,3,4,..,,,,,,,,,,,,,,,, N-1.
If transform has been centered a circle of radius r with origin at the center of the frequency
For R = 5 = 92 % most blurred image because all sharp details are removed
R = 15 = 94.6 %
R = 30 = 96.4 %
Fig: Ideal Low Pass Filter 3-D view and 2-D view and line graph
BUTTERWORTH LOW PASS FILTER
It has a parameter called the filter order.
For high values of filter order it approaches the form of the ideal filter whereas for low filter
order values it reach Gaussian filter. It may be viewed as a transition between two extremes.
The transfer function of a Butterworth low pass filter (BLPF) of order n with cut off frequency
at distance Do from the origin is defined as
Where:
D(u,v)- the distance of point (u,v) from the center of the transform
HOMOMORPHIC FILTERING
Homomorphic filters are widely used in image processing for compensating the effect of no
uniform illumination in an image. Pixel intensities in an image represent the light reflected
from the corresponding points in the objects. As per as image model, image f(z,y) may be
characterized by two components:
(1) the amount of source light incident on the scene being viewed, and
(2) the amount of light reflected by the objects in the scene. These portions of light are called
the illumination and reflectance components, and are denoted i (x , y) and r ( x , y)
respectively. The functions i (x , y) and r ( x , y) combine multiplicatively to give the image
function
f ( x , y): f ( x , y) = i ( x , y).r(x, y)
where 0 < i ( x , y ) < a and 0 < r( x , y ) < 1.
Homomorphic filters are used in such situations where the image is subjected to the
multiplicative interference or noise as depicted in Eq. It cannot easily use the above product to
operate separately on the frequency components of illumination and reflection because the
Fourier transform of f(x, y) is not separable; that is F[f(x,y)) not equal to F[i(x, y)].F[r(x, y)].
Separate the two components by taking the logarithm of the two sides
ln f(x,y) = ln i(x, y) + ln r(x, y).
Taking Fourier transforms on both sides,
F[ln f(x,y)} = F[ln i(x, y)} + F[ln r(x, y)]. that is, F(x,y) = I(x,y) + R(x,y), where F, I and R
are the Fourier transforms ln f(x,y),ln i(x, y), and ln r(x, y) respectively.
The function F represents the Fourier transform of the sum of two images: a low-frequency
illumination image and a high-frequency reflectance image. If we now apply a filter with a
transfer function that suppresses low- frequency components and enhances high-frequency
components, then we can suppress the illumination component and enhance the reflectance
component. Taking the inverse transform of F (x, y) and then anti-logarithm, we get
f’ ( x , y) = i’ ( x , y) + r’(x, y)