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

Image processing

DIP

Uploaded by

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

Image processing

DIP

Uploaded by

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

:::

DigitalImage Procéssing 3.59


(2) Lowpass Filter
Afilter that attenuates ie. weakens high frequencies and passes low
is calleda low pass filter.In an image, frequencies
(a) Low frequencies in the Fourier transform correspond to the gray level
appearance over smooth areas.
(6) High frequencies correspond to detail such as edges and noise.
Therefore, a lowpass filtered image would have less sharp detail than the
original image, as the high frequencies are removed. This image will appear
Smoother than the original.
(3) High pass filter
A fiter that attenuates low frequencies and passes high frequencies is called a
'highpass filter'.
As low frequencies are removed, a high - pass filtered image would have less
gray level variations in smooth areas. But, the sharp gray-level detail such as
edges are emphasized.
Therefore, such an image will appear sharper than the original.
Similar to spatialfiltering, frequency-domain filtering is also usedfor image enhaincement in
two ways. They are
1) Smoothing and
2) Sharpening
These two are explained in the following sections.

3.15 SMOOTHING Bö FREQUENCY- DOMAIN FILTERS

Smoothing in frequency domain is the process of attenuating a specified ange of


high-frequency components in the transform of a given image. It is also known as blurring.
Need for Smoothing:
Sharp transitions in the gray levels of an image such as edges and noise are present as
high-frequency components in its Fourier transform. To remove these unwanted contènts for
some applications, smoothing is necded.
Concept
The basicprocess of frequency domain filtering is expressed as,
.60 Image Enhancement

G(u,v) =H(u,v) . F(u,v) -io- (3.92)


Where F(u, v)- Fourier transform of the input image.
H(u,v) - Filter transfer function.
Here, the main aim is to select afilter function H(u,v) which is suitable to attenuate the
igh-frequency components and results in G(u,v).
tlters Used

Lowpass filters are used for bluring in frequency domain. Three types of lowpass
Iters are given importance. They are,
Ideal Lowpass Filters (LPF)
Butterworth Lowpass Filters (BLPF)
Gaussian Lowpass Filters (GLPF)
hese filters cover the entire range of filter functions from very sharp to very smooth.
15.1 Ideal Lowpass Filter (LP)
ldeal lowpass filter is the simplest lowpass filter. It "cuts off" all the high frequency
Tmponents of the Fourier transform which are located at a distance greater than a specified
istance Do from the origin of the centered transform.
ransfer Function
The transfer function of two-dinensional ILPF is given by,
if D(u, v)sD,
--- (3.93)
0 if D(u, v)> D,
Where, Do -Specified positive quantity
D(u,v)- Distance between the. point (u, v) and the origin
of the frequency rectangle.
Vistance, D(u, y):
The distance from any point (u,v) to the center of the frequency rectangle is given by
D(u,v) = Vu' +y? ---- 3.94)
the image size is M x N,
Center of the frequency rectangular is at (u,v) - (M,. N,).
fow the distance from any point (u,v) to the center or origin of the Fourier transfom is,
Digitai Image Processing 3.61

Du,)=(-4-94 ---3.95)

Cutoff Frequency
The cutoff frcquency of ILPF is defined as the point at which the transition between
the filter function H(4, v) =land H(u, v=0 takes place.
Image Power
In three dimensional view, the function of the filter is to pass all the frequencies
which are inside acircle of radius Do and attenuate all the frequencies outside the circle.
Here, to set up standard cutoff frequencies, circles with specified amount of total
image power, Pr should be computed. The total image power is found by,
M-IN-!
P,-Pu, v) -.-(3.96)

Where, P(u,) =]F(u, v)f= R'(u, v) +I(u,v)


RJ-Real and Imaginary parts
Also, a circle with radius r andorigin at the center of the frequency rectangle would have a
percent of the total power given by,
% -(3.97)
Ringing Efect:
Ringingis an unwanted effect caused by the blurring of ILPF. The basic model of
blurring in frequency domain is,
G (u, v) =H(u, v). F(u, v)
Using convolution theorem, it is represented in the spatial domain as,
B(%, y)= h(%, y) *f(, y) --3.98)
Where f(x,y)- original image
g(x, y)-Blurred image
h(x, y) -Spatial filter function
Spatial Filter Function, h(x, y):
h(x, y) can be obtained from H(u, v) by the following steps:
() Multiply H(u, v) by (-1)y
3.62 Image Enhancement
(ii) Take inverse DFT of the result in (i)

(ii)Obtain the real part


(iv)Multiply the result by (-Iy*"y
Here, the nature of h(x, y) affects both blurring and ringing effects, Because,
the center component of h(x, y) is responsible for blurring and
the concentric çomponents of h(x, y) are. responsible for the ringing
characteristics of ILPF.
3.15.2 Butterworth Lowpass Filter (BLPF)
In Butterworth lowpass filter, there is no clear cutoff frequency which decides the
amount of frequencies to be passed and the amount of frequencies to be filtered.
When the amount of high frequéncy content removed decreases, the image becomes
finer in texture.

Transfer Function:
The transfer function of a BLPF with cutoff freqúency t a distance Do from the origin
is given by,

H(u, v) = (3.99)
D(u,v)
Do
Where, n- Filter order

In eqn.(3.99), when D(u,v) = Do H(u, v) = =0.5 50 %


1+(1)
This implies that 50% of the frequencies from the
maximum value is filtered.
Ringing Effect:
In BLPF, when the filter order 'n'
ringing effect should be taken into account increases, the ringing also increases. Therefore,
lower orders. The effect of ringing is showin infor fig.
higher order filters. and it can be ignored for
.a...

3.31.
!.

Digital Image Processing 3.63

(a) n=1 (b) n=2 tc} n=5 (0)n=20


" has " Here, ringing is Here, ringing has " The ringing here
inging and no not perceptible considerable is much higher
negative i.e. mild. h has effect than lower order
values Small negative filters
values

Fig. 3.31Ringing Efect of Butterworth Filters with Different rders 'n'


Therefoe, Butterworth lowpass filter oforder n'=2 is preferred because, it provides
Effective lowpass filtering and
Acceptable ringing characteristics
3.15.3 GaussiaD Lowpass Filter.(GLPF)
Transfer Function:
The transfer function of two-dimensional GLPF is given by,
H(ujy) = eDiyzo ----3.100)
Where, o -Measure of theGaussian curve spread

Ifo=D, » H(u, v)=eD'unD -- (3.101)


Where, Do -Cutoff frequency
Spatial Gaussian Filter:
A spatial Gaussian filter is obtained by taking- the inverse Fourier transform of
cqn.(3.100) and (3.101). The obtained filter will have no ringing.
3.15.4 Applications of Lowpass Filtering
Lowpass filtering is mainly used in,
64 Image Enhancetnent

() Character Recognition Transf


(i) Printing and Publishing Industryy and
of ideal
()Processing satellite and Aerial Images
Character Recognition
The characters of a text may be distorted or broken due to poor resolution.
Human isual system can ecognize these characters easily, but a machËne
recognition system finds difficulty for the same.
Therefore, lowpass filters are used here to fill up the small gaps by blurring.
Spatial
Printing and Publishing Industry
In printing and publishing industry, lowpass filtering is used in a same as
preprocessing steps. number of
Example:
(). Unsharp Masking
(ii). Cosmetic Processing etc.
Cosmetic processing is a pYocess done before printing
It produces a smoother and Füters U
original image. softer-looking image from a sharp T
The sharpness of the fine skin
human face can be is reduced by lines and smnall blemishes in.
this (Skin Blemishes
patches on the face or areas of ’ dark
Processing satellite and Aerial images discoloration on the skin).
Due to the sensors used for
scan lines may be present insatellite and aerial
the direction of theimage capturing, some 3.16.1 Ide
sensing of the scene. dominant
Lowpass filters are used to remove the effect of Ide
that large features are easily these scan lines by blurring so
recongnized. Transfer F
6 The
SHARPENGING BY FREQUENCY DOMAIN FILTERS
As explained,
pening in frequencysmoothing
is the process of
attenuating high frequencies. Thus.
domain is defined as the process of attenuating low frequency
ponents without disturbing the information in the Fourier transform.
........
Digital Image Processing 3.65
Transfer Function:
Sharpening is implemented by high -pass filters which perform the reverse operation
of ideal lowpass filters.
The transfer function of the highpas filters is obtained by
---- (3.102)
H,(9, v) =|-H,(4, v)
Where H, -Transfer function of the corresponding
lowpass filter.
Spatialfilter:
The procedure toobtain spatial filter representation for a frequency domain filter is
same as the smoothing filter. It is as follows:
(1). Multiply H(u, v) by (-1)* for the purpose of centering
(i). Compute inverse DFT
(ii) Take the real part of inverse DFT
(iv). Mutiply the real part by (-1y",
Filters Used:

The three important filters used for sharpening are,


Ideal Highpass Filters (THPF)
Butterworth Highpass Filters (BHPF)
Gaussian Highpass Filters (GHPF)
3.16.1 Ideal Highpass Filter (IHPF)
ldeal highpassfilter perfoms the opposite function ofideal lowpass filter.
Transfer Function:
The transfer function of two-dimensional THPF is given by,
(o if D(u, v)s D,
I if D(u, v)> D, oo (3.103)

Where, Do - Cutoff distance measurcd from the center of the frequency


rectangle
3.66 Image Enhancement

D(u, v) Distance from any point (u,v) to the center of the frequency
rectangle.

Do, )- -)+(
This transfer function forces all the frequencies inside a circle with radius Do to zero
and it passes allthe frequencies outside the circle without attenuation.
Representation of IHPE:
in
The cross section and spatial representation of an ideal highpass filter is shown
fig.3.32.

H(u,v)

1.0
A

D(u,v)

(a) Cross Section (b) Spatial representation


Fig. 3.32 ldeal Highpass Filter
Ringing effect:
Ringing results in images with distorted and thickened object boundaries ia
sharpening process.
In ideal highpass filtering, when the cutoff distance Do increases, the effect of ringing
reduces. Anyhow, it should be considered for low D, values,
3.16.2 Butterworth Highpass Filter (BHPF)
The behavior of Butterworth highpass filters is smoother than ideal highpass filter.
This means-that the images produced by BHPF are better than IHPF produced images.
Transfer Function:
The transfer function of BHPF of order 'n' is given by
..i. ..
Digital Image Processing 3.67
1
H(u, v) = 2n
---- (3.104)
Do

Where, Do - Cutoff frequency which is the distance from the


origin of the transform

Representation of BHPF:
The cros[ section and spatial representation of BHPF are shown in fig. 3.33

H(u,v)
1.0

D(u,v)

(a)Cross Section (b) Spatial Gray-level representation


Fig. 3.33 Butterworth Highpass Filter
Ringing Effect:
Even for small values of cutoff-frequency Dowith s1mall order 'n' of the filter, the
ringing effect is very less in butterworth highpass filtering. Therefore, boundaries are much
less distorted than in IHPF.
3.16.3 Gaussian Highpass Filter (GHPF)
The results produced by a Gaussian Highpass Filter are smoother than the results
produced by IHPF and BHPF.
Transfer Function:
The transfer function of the GHPF with cutoff frequency at a distance D, from the
origin is expressed as,
3.68 Image Enhancement
H(u,v) =/-eaan -3.105)

lepresentation of GHPF: :

The cross section and spatial representatin of GHPF are shown in fig. 3.34.
Hu,v)
1.0

D(u,v)
(a) Cross Section (b) Spatial Gray-level representation
Fig, 3.34 Gaussian Highpass Filters

hus, smaller objects and thin b¡rs look cleaner in the result of GHPF than other filter results.
16.4 The Laplacian in the Freqçency Domain
The use of Laplacian operator in the spatial domain is explained in section 3.11.J. This
ection deals with its use in the frequency domain.
aplacian Operator:
The Fourier transform of the Laplacian operator in two
dimension is expressed as,

--3.106)

=-(u+w)F(u, v)
F[V(»y)]=-u +w)F(u,v) --3.107)
ilter Transfer Function:
Thus, the filter used to implement this Laplacian operator in frequency domain is,
H(u,v) =-(u'+) --- (3.108)
Before taking the transfom, the origin of F(u, v) should be centered by performing the
peration
Digital Image Processing 3.69

oo(3.105) f(x, y) . (-1)*"*


This operation shifts the center of the transom from (0, v) =(0,0) t o : if the image
size is M x N.

Now the fiter function becomes,


--(3.109)

Laplacian-Filtered Image:
The filtering in frequency domain is performed by the operation,
Ha,v). F(u, ) -|(-M) +{v-Y) (0,)
"esentation
Now, the Laplacian-filtered image in the spatial domain, v'f(x,y) is obtained by
computing the inverse Fourier transform of H(u, v). F(u, v).
Iter results.

3.11.1. This The result will be equivalent to,


-(3.110)

sed as, Enhanced Images


Finally, the enhanced image is obtained by subtracting the Laplacian from the
----(3.106) original image.
i.e. g(x, y)= f(x, y)- f(x, y) ---(3.111)
Similar to the use of a single mask in spatial domain, a single filter is used in
the frequency domain to get the enhanced. image. The filter is
--3.107) -o(3.112).

ain is, In this case, an inverse transform opèration is performed to get the enhanced
image as,
-(3.108)
-(3.113)
orming the.
3.70 Image Enhancement

3.16.5 Enhancing the Filtered Images


A major drawback in high pass filtering i_ that the highpass fiters eliminate the zero
frequency component in the Fourier transform of the images. This will reduce average
background intensity of the images to near black.
To overcome this problem, three processes are used. They are known as,
(1) Unsharp Masking
(2) High-Boost Filtering
3) High - Frequency Emphasis Filtering
(1) Unsharp Masking
image
Unsharp masking is the process of producing a sharp image by subtracting an
and its blurred version.

It can be represented as,


Lowpass filtered
fOriginal Highpass filtered]
(or) version
image Blurred version

f(x, y) - f,(x, y) = ,(x,y) ---3.114)

Filter Transfer Function


The filter used to implement unsharp masking in the frequency' domain is found as
below.
Taking the Fourier transform of eqn. (3.114) gives,
f,(0, v) = F(u, v) F,(u,v) ---(3.115)

Substituting F,(u, v) = H, (u,v). F(u, v) gives,


E,(0, v) =F(u, v) -H,(0,v). F(u, v)
-[1-H,(u,v). F(u, v)]
Where, H-Transfer function of a lowpass filter.
. The filter to implement unsharp masking is
H, (u, v) =| -H,(u, v) --3.136)
Digital Image Processing:
(2) High-Boost Filtering
High-boost filtering is a generalized method of unsharp masking.
Concept:
High-boost filtering is ba_ed on the concept that "increasing the contribution mac
the original image to the filtered image would enhance the overall result".
It isobtained by multiplying f(x, y) by a constant 'A' in eqn. (3.114)
,(x,y) =Af(x, y) -f,(x, y), A>1 .-(3.
The contribution of the image to the overall enhancement can be further increased as belo

f (x,y) =(A-1)f(x,) +f(x, y)- f, (x, y)


Using eqn.(3.114) here gives,
f(4)= (A-I)f(<,y) +f,(x, y) ----3.1
When A=1’ High-boost filtering in eqn.(3.118) reduces to normal highpass filterir
Filter Trànsfer Function:
The filter used to implement high-boost filtering in frequency domain is
Hsa(4, v) = (A- 1) +Ha(u, v), A>1
To Get fasy):
The procedure to get the high-boostfiltered inage fis(x,y}in the spatial domain is
(im) Multiply Hat4, v) and F(u, v)
(iv) Compute inverse DFT
(v) Take the real part
(vi) Multiply the resuit by (-1*
(3) High-frequency Emphasis Fltering
As the name states, high-frequency emphasis filtering is the process of increasin;
contributiòn made by high. frequency components of an image to the overall r
enhancement.
Flter Transfer Function:
The two steps folowed in this process are
15
72 Image Enhancement

) Multiply a highpass filter function H, (u, v) by a constant 'b'


(G) Addan offset 'a' so that the zero frequency term is not removed by the filter.
us, the transfer function of high-frequency emphasis filtering is,
H(u, v)=a+b.H,(u, v), a>0; b>a --3.120)
:re,

When b>l » High frequencies are given importance as the name states
When a = (A-1) and b=l ’ it is reduced to high-boost filtering
pical ranges of 'a' and 'bare: a s 0.25 to 0.5,
ba15 to 2.0

You might also like