0% found this document useful (0 votes)
12 views75 pages

Module 3

The document discusses image enhancement techniques aimed at improving image quality through various methods such as spatial and frequency domain processing. It details operations like point processing, local operations, and global operations, along with specific techniques including intensity transformations, histogram equalization, and spatial filtering. Additionally, it covers smoothing filters for noise reduction and blurring, highlighting the importance of neighborhood operations in image processing.

Uploaded by

Anjana Archu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views75 pages

Module 3

The document discusses image enhancement techniques aimed at improving image quality through various methods such as spatial and frequency domain processing. It details operations like point processing, local operations, and global operations, along with specific techniques including intensity transformations, histogram equalization, and spatial filtering. Additionally, it covers smoothing filters for noise reduction and blurring, highlighting the importance of neighborhood operations in image processing.

Uploaded by

Anjana Archu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

8/3/2022

MODULE 3

IMAGE ENHANCEMENT

Image Enhancement
 Image enhancement techniques are designed to improve the quality
of an image as perceived by human being

1
8/3/2022

Image Enhancement Techniques


• Spatial Domain Processing: Directly manipulates the pixel of a given
image for enhancement.

• Frequency Domain Processing (Transform domain method) :


Manipulates the Fourier transform of a given image for
enhancement.

Types of operations

Rectangular neighborhood

• Point/pixel operations: Output value at specific coordinates (x, y) is


dependent only on the input value at (x, y)
• Local operations: The output value at (x, y) is dependent on the input values
in the neighborhood of (x, y)
• Global operations: The output value at (x, y) is dependent on all the values in
the input image
4

2
8/3/2022

Spatial Domain Processing


1. Point Processing/ Intensity Transformation/Single
Pixel Operation

2. Spatial Filtering/Local Operation/Mask operation

Point Processing /Intensity Transform


• Simplest of image enhancement techniques
• Processing based only on intensity of individual pixels
• Given g(x,y) as the output pixel, f(x,y) as the input pixel, and T as
some transformation g(x,y) = T[f(x,y)]

3
8/3/2022

• g depends only on f at (x, y)


• T: a gray-level/intensity transformation/mapping function
• Let r = f(x, y) s = g(x, y)
• r and s represent gray levels of f and g at (x, y)
• Then s = T(r)

Basic Intensity Transformation function

• Image Negatives
• Log Transformation
• Power law transformation
• Contrast Stretching
• Gray-level Thresholding
• Bit Plane slicing

4
8/3/2022

Image Negative

S=L-1-r

Input image Negative 9

10

5
8/3/2022

11

Log Transformation

12

6
8/3/2022

• This type of mapping spreads out the lower gray levels.

13

14

7
8/3/2022

15

16

8
8/3/2022

17

18

9
8/3/2022

• The effect of gamma correction on an image: The original image was


taken to varying powers, showing that powers larger than 1 make the
shadows darker, while powers smaller than 1 make dark regions
lighter

19

20

10
8/3/2022

Digital Image Representations


• Dynamic range: Ratio of maximum measurable intensity to minimum
detectable intensity level in the system.

• Contrast: Difference between highest and lowest intensity levels in an


image.

21

22

11
8/3/2022

23

Original image
Contrast stretching
• Enhancing low contrast images

• a and b are the lowest and


highest intensity values of
a=0, b=255
representation. c=74, d=224
• c and d are the lowest and
highest pixel values currently
present in the image.

24

12
8/3/2022

Thresholding
• In hard thresholding, the pixels having intensity lower than the
Threshold are set to zero and the other pixels having intensity value
greater than threshold are set to maximum intensity value
• Thresholding used to obtain binary image from grayscale image

25

26

13
8/3/2022

Gray-level slicing or Intensity level slicing

• highlight a specific range of gray levels


• Useful for highlighting features in an image
• Two types
• Without preserving the background
• With preserving the background

27

• Without preserving background: High values for a range of interest


and low values in other areas

28

14
8/3/2022

• With preserving the background:High values for a range of interest


and original gray levels in other areas

29

Bit plane slicing

30

15
8/3/2022

• Instead of highlighting gray-level ranges, highlighting the contribution made to total image
appearance by specific bits might be desired
• For an 8 bit image, imagine that the image is composed of eight 1- bit planes, ranging from bit-plane 0
for the least significant bit to bit plane 7 for the most significant bit.
• Plane 0 contains all the lowest order bits in the bytes comprising the pixels in the image and plane 7
contains all the high order bits

31

32

16
8/3/2022

Bit Plane Slicing

33

Bit Plane Slicing

34

17
8/3/2022

Histogram equalization
• Histogram
• A image histogram is the graphical representation between number of pixels and
intensity values

35

36

18
8/3/2022

Histogram Equalization
• Equalisation is a process that attempts to spread out the gray levels in
an image so that they are evenly distributed across their range
• It reassigns the brightness values of pixels based on the image
histogram

37

Procedure to perform Histogram Equalization

• Find the histogram


• Find the running sum
• Normalize the values by dividing by the total number of pixels
• Multiply the value by the maximum gray level and round
• Map the gray levels values to the results from the above step using a
one to one correspondence

38

19
8/3/2022

Spatial Filtering

39

Spatial Filtering: Basics

Origin x

Neighbourhood operations: Operate


on a larger neighbourhood of pixels
than point operations
(x, y)
Neighbourhood

Neighbourhoods are mostly a rectangle


around a central pixel

y Image f (x, y)
40
40

20
8/3/2022

Spatial Filtering: Basics


Origin x
a b c r s t
d
g
e
h
f
i
* u
x
v
y
w
z
Original Image Filter
Simple 3*3 Pixels
e 3*3 Filter
Neighbourhood
eprocessed = v*e +
r*a + s*b + t*c +
u*d + w*f +
y Image f (x, y) x*g + y*h + z*i

The above is repeated for every pixel in the original image to generate the filtered image
41
41

Spatial Filtering: Basics

Moving window (kernel) scans the


3x3 neighborhood of every pixel in
the image

Original Image

42
42

21
8/3/2022

Spatial Filtering: Basics

43
43

Spatial Filtering: Basics

44
44

22
8/3/2022

Spatial Filtering: Basics

45
45

Spatial Filtering: Basics

46
46

23
8/3/2022

• Pixels in an image are modified based on some function of the pixels


in their neighbourhood

• Spatial filtering is one of the important neighbourhood operation

• The subimage that is used in spatial filtering is called a filter, mask,


kernel, template, or window

47

• Filter term in “Digital image processing” is referred to the subimage

• The value in a filter subimage are referred as coefficients, rather than


pixels

• Spatial filtering term is the filtering operations that are performed directly
on the pixels of an image

48

24
8/3/2022

Mechanics of spatial filtering


• The process consists simply of moving the filter mask from point to
point in an image.
• At each point (x,y) the response of the filter at that point is calculated
using a predefined relationship

49

Linear spatial filtering


Pixels of image
The result is the sum of products
of the mask coefficients with the
w(-1,-1) w(-1,0) w(-1,1) corresponding pixels directly
f(x-1,y-1) f(x-1,y) f(x-1,y+1)

w(0,-1) w(0,0) w(0,1)


under the mask
f(x,y-1) f(x,y) f(x,y+1)

w(1,-1) w(1,0) w(1,1) Mask coefficients


f(x+1,y-1) f(x+1,y) f(x+1,y+1)
w(-1,-1) w(-1,0) w(-1,1)

w(0,-1) w(0,0) w(0,1)

f ( x, y )  w (  1 ,  1 ) f ( x  1 , y  1 )  w (  1 , 0 ) f ( x  1 , y )  w (  1 ,1 ) f ( x  1 , y  1 ) 
w ( 0 ,  1 ) f ( x , y  1 )  w ( 0 , 0 ) f ( x , y )  ww(1,-1)
( 0 ,1 ) f w(1,0)
( x , y w(1,1)
1) 
w ( 1 ,  1 ) f ( x  1 , y  1 )  w ( 1 , 0 ) f ( x  1 , y )  w ( 1 ,1 ) f ( x  1 , y  1 ) 50

25
8/3/2022

Smoothing Spatial Filters


• Smoothing filters are used for blurring and for noise reduction.
– Blurring is used in preprocessing steps, such as removal of small details from
an image prior to object extraction, and bridging of small gaps in lines or
curves
– Noise reduction can be accomplished by blurring

51

Type of smoothing filtering


• There are 2 way of smoothing spatial filters
• Smoothing Linear Filters
• Order-Statistics Filters

52

26
8/3/2022

Smoothing Linear Filters


• Linear spatial filter is simply the average of the pixels contained in the
neighborhood of the filter mask.
• Sometimes called “averaging filters”.
• The idea is replacing the value of every pixel in an image by the average
of the gray levels in the neighborhood defined by the filter mask.
• The low pass filter behavior removes the sharp variations leading to
blurring effect.

53

Spatial Filtering: Basics


Origin x
104 100 108 1/ 1/ 1/
9 9 9

99

95
106

90
98

85
* 1/

1/
9
1/

1/
9
1/

1/
9

9 9 9

1/
1049
1/
1009
1/
1089
Original Image Filter
Simple 3*3 1/
99 1 /9
106 1/
98
3*3 Smoothing Pixels
9 9
Neighbourhood 195
/9 190
/9 185
/9
Filter
e = 1/9*106 +
1/ *104 + 1/ *100 + 1/ *108 +
9 9 9
1/ *99 + 1/ *98 +
9 9
y Image f (x, y) 1/ *95 + 1/ *90 + 1/ *85
9 9 9
= 98.3333
The above is repeated for every pixel in the original image to generate the smoothed image
54
54

27
8/3/2022

Two 3x3 Smoothing Linear Filters(Mask)

1 1 1 1 2 1
1 1
 1 1 1  2 4 2
9 16
1 1 1 1 2 1

Standard average Weighted average


55

5x5 Smoothing Linear Filters

1 1 1 1 1

1 1 1 1 1
1 1
 1 1 1 1 1
25 ?
1 1 1 1 1

1 1 1 1 1
56

28
8/3/2022

1 2 3 2 1/9 1/9 1/9

4 2 5 1 1/9 1/9 1/9

1 2 6 3 1/9 1/9 1/9

2 6 4 7

57

1 2 3 2 1/9 1/9 1/9

4 2 5 1 1/9 1/9 1/9

1 2 6 3 1/9 1/9 1/9

2 6 4 7

58

29
8/3/2022

What happens when kernel falls outside the


image

1 2 3 2 1/9 1/9 1/9

4 2 5 1 1/9 1/9 1/9

1 2 6 3 1/9 1/9 1/9

2 6 4 7

59

First solution – zero padding


0 0 0 0 0 0

0 1 2 3 2 0 1/9 1/9 1/9

1/9 1/9 1/9


0 4 2 5 1 0

1/9 1/9 1/9


0 1 2 6 3 0

0 2 6 4 7 0

0 0 0 0 0 0

60

30
8/3/2022

First solution – zero padding


0 0 0 0 0 0

0 1 2 3 2 0 1/9 1/9 1/9

1/9 1/9 1/9


0 4 2 5 1 0

1/9 1/9 1/9


0 1 2 6 3 0

0 2 6 4 7 0

0 0 0 0 0 0

61

Result of Zero padding

1 2 3 2 1 2 2 1

4 2 5 1 1 3 3 2

1 2 6 3 2 4 4 3

2 6 4 7 1 2 3 2

62

31
8/3/2022

Second Solution– Pixel Replication


1 1 2 3 2 2

1 1 2 3 2 2 1/9 1/9 1/9

1/9 1/9 1/9


4 4 2 5 1 1

1/9 1/9 1/9


1 1 2 6 3 3

2 2 6 4 7 7

2 2 6 4 7 7

63

0 0 0 0 0 0

0 1 2 3 2 0 1/9 1/9 1/9

1/9 1/9 1/9


0 4 2 5 1 0

1/9 1/9 1/9


0 1 2 6 3 0

0 2 6 4 7 0

0 0 0 0 0 0

64

32
8/3/2022

Result of Replication

1 2 3 2 2 3 2 2

4 2 5 1 2 3 3 3

1 2 6 3 3 4 4 4

2 6 4 7 3 4 5 5

65

Result of Smoothing Linear Filters

Original Image

[3x3] [5x5] [7x7]

66

33
8/3/2022

Smoothing Linear Filters


• The general implementation for filtering an MxN image with a
weighted averaging filter of size mxn is given by the expression

a b

  w (s, t) f ( x  s, y  t)
g (x, y)  s atb
a b

 
s atb
w (s,t)

67

Original image
Smooth by 3x3 box
Size: 500x500 filter

Smooth by 5x5 box Smooth by 9x9 box


filter filter

Smooth by 35x35 box


Smooth by 15x15 box
filter
filter

Notice how detail begins to disappear


68
68

34
8/3/2022

69

Drawbacks of low pass filtering


• Averaging operation leads to blurring of image. Blurring affects
feature localization
• Impulse noise(salt and pepper noise) will be attenuated not removed
• A single pixel with a very unrepresentative value can affect the mean
value of the pixels in the neighbourhood significantly

70

35
8/3/2022

Order-Statistic Filtering

 Output is based on order of gray levels in the masked area


 Some simple neighbourhood operations include:
 Min: Set the pixel value to the minimum in the neighbourhood
 Max: Set the pixel value to the maximum in the neighbourhood
 Median: The median value of a set of numbers is the midpoint value in that set

71
71

Order-Statistics Filters
• Order-statistics filters are nonlinear spatial filters whose response is
based on ordering (ranking)
• the pixels contained in the image area encompassed by the filter, and
then replacing the value of the center pixel with the value determined
by the ranking result.
• Best-known “median filter”

72

36
8/3/2022

Median Filtering

Sort the values


Determine the median

Median = ? 20

 Particularly effective when


 The noise pattern consists of strong impulse noise (
salt-and-pepper)

73
73

Median Filtering

74
74

37
8/3/2022

Process of Median filter

• Corp region of neighborhood


• Sort the values of the pixel in
10 15 20
our region
20 100 20 • In the MxN mask the median
is MxN div 2 +1
20 20 25

75

Process of Median filter

• Corp region of neighborhood


• Sort the values of the pixel in
10 15 20
our region
20 100 20 • In the MxN mask the median
is MxN div 2 +1
20 20 25

10, 15, 20, 20, 20, 20, 20, 25, 100

5th
76

38
8/3/2022

Sharpening Spatial Filters


• The principal objective of sharpening is to highlight fine detail in an
image

• To enhance detail that has been blurred, either in error or as an


natural effect of a particular method of image acquisition

77

• Averaging is analogous to integration, sharpening can be


accomplished by spatial differentiation
• Sharpening filters are based on first- and second-order derivatives

78

39
8/3/2022

• First derivative will be


• Zero in areas of constant intensity
• Nonzero at the onset of an intensity step or ramp
• Nonzero along ramps
• Second derivative will be
• Zero in constant areas
• Nonzero at the onset and end of an intensity step or ramp
• Zero along ramps of constant slope

79

1st Derivative
The 1st derivative of a function is given by:

f
 f ( x  1)  f ( x )
x
Its just the difference between subsequent values and
measures the rate of change of the function

80

40
8/3/2022

2nd Derivative

The 2nd derivative of a function is given by:

2 f
 f ( x  1)  f ( x  1)  2 f ( x )
 intox account the values both before and after the current value
Simply takes
2

81

2nd Derivative for Image Enhancement

The 2nd derivative is more useful for image enhancement than the 1st derivative -
Stronger response to fine detail

The first sharpening filter we will look at is the Laplacian

82

41
8/3/2022

Laplacian Filter
The Laplacian is defined as follows:

2 f 2 f
 2
f  2  2
 x  y
2 f
 f ( x  1, y )  f ( x  1, y )  2 f ( x , y )
2x

2 f
 f ( x , y  1)  f ( x , y  1)  2 f ( x , y )
2y

83

Laplacian Filter
So, the Laplacian can be given as follows:
 2
f  [ f ( x  1, y )  f ( x  1, y )
 f ( x , y  1 )  f ( x , y  1 )]
 4 f (x, y)
Can we implement it using a filter/ mask? 0 1 0

1 -4 1

0 1 0
84

42
8/3/2022

Laplacian Filter

85

Laplacian Filter
Applying the Laplacian to an image we get a new image
that highlights edges and other discontinuities

Original Laplacian Laplacian


Image Filtered Image Filtered Image
Scaled for Display 86

43
8/3/2022

Laplacian Image Enhancement

The result of a Laplacian filtering is not an enhanced


image

To generate the final enhanced image

Laplacian
Filtered Image
Scaled for Display
f ( x, y )   2 f , w5  0
g ( x, y ) 
f ( x, y )   2 f , w5  0
87

Laplacian Image Enhancement

- =
Original Laplacian Sharpened
Image Filtered Image Image

In the final sharpened image edges and fine detail are much
more obvious
88

44
8/3/2022

High Boost Filtering


• Also known as high frequency emphasis filter

• Used to retain some of the low frequency components to aid in the interpretation of an image

• High boost image = A*f(m,n) – low pass

• Where 𝐴 is the amplification factor and low pass component is the blurred version of the original
image

• High boost image = (A-1+1)*f(m,n) – low pass


• High boost image = (A-1)*f(m,n)+f(m,n) – low pass
= (A-1)*f(m,n) + highpass

89

Unsharp masking
• One of the techniques typically used for edge enhancement
• In this approach, smoothened version of the image is subtracted from
original image;hence, tipping the balance towards the sharper
content of the image

90

45
8/3/2022

• The procedure to perform unsharp masking is given below:


• Blur filter the image
• Subtract the result obtained from the previous step to the original image
• Multiply the result by some weighting fraction
• Add the result to the original image

91

Unsharp Masking and High Boost Filtering

Unsharp masking

High boost filtering 92

46
8/3/2022

Use of first derivatives for image enhancement: The


Gradient

• The gradient of a function f(x,y) is defined as

 f 
G x   x 
f      f 
G y   
  y 

93

Use of first derivatives for image enhancement: The


Gradient
The magnitude of this vector is given by:

 f  mag ( f )
 G  2
x  G 2
y 
1
2

1
 f  2  f 
2
 2

      
   x   y  
For practical reasons this can be simplified as:

f  Gx  G y

94

47
8/3/2022

Gradient Operators
There is some debate as to how best to calculate these gradients

Simplest Operator

f f
 ( z8  z5 ),  ( z6  z5 )
yx  xy
f  ( z8  z5 ) 2  ( z 6  z5 ) 2
 f  ( z8  z5 )  ( z6  z5 )

95

Gradient Operators
Prewitt Operator

 f  ( z 7  z 8  z 9 )  ( z1  z 2  z 3 )
 ( z 3  z 6  z 9 )  ( z1  z 4  z 7 )

-1 -1 -1 -1 0 1
f f
 0 0 0  -1 0 1
y 1 1 1
x -1 0 1
Extract horizontal edges Extract vertical edges
96

48
8/3/2022

Gradient Operators
Sobel Operator

-1 -2 -1 -1 0 1
f f
 0 0 0  -2 0 2
y 1 2 1
x -1 0 1
Extract horizontal edges Extract vertical edges

Emphasize more the current point (x direction)

 f  ( z 7  2 z 8  z 9 )  ( z1  2 z 2  z 3 )
 ( z 3  2 z 6  z 9 )  ( z1  2 z 4  z 7 )
Emphasize more the current point (y direction)
Pixel Arrangement
97

Sobel Operator: Example

An image of a contact
lens which is
enhanced in order to
make defects more
obvious

Sobel filters are typically used for edge detection

98

49
8/3/2022

Image Enhancement in the frequency domain


• Selective enhancement or suppression of frequency components is termed as
Fourier Filtering or Frequency domain filtering

• Spatial representation - describes the adjacency relationship between the pixels

• Frequency domain representation - clusters the image data according to their


frequency distribution

99

• In spatial domain, filtering is done by convolving the input image 𝑓(𝑥, 𝑦) with the
kernel h(𝑥, 𝑦)

• In frequency domain, filtering corresponds to the multiplication of the image


spectrum 𝐹(𝑘, 𝑙) by the Fourier transform of the kernel 𝐻(𝑘, 𝑙)

• Convolution in spatial domain is the same as multiplication in frequency domain

• 𝑓(𝑥,𝑦)∗ h(𝑥, 𝑦) → 𝐹(𝑘, 𝑙)𝐻(𝑘, 𝑙)

100

50
8/3/2022

Types of Frequency domain Filters


• Lowpass
– Ideal Lowpass Filters
– Butterworth Lowpass Filters
– Gaussian Lowpass Filters
• Highpass
– Ideal Highpass Filters
– Butterworth Highpass Filters
– Gaussian Highpass Filter

101

102

51
8/3/2022

103

Low Pass Filter

104

52
8/3/2022

2D ideal Low Pass Filter

105

Ringing Effect

106

53
8/3/2022

107

108

54
8/3/2022

Butterworth Low Pass filter

109

110

55
8/3/2022

• Ideal Highpass Filter - Ringing artifact is more


• Butterworth Highpass Filter - Ringing artifact is less
• Gaussian Highpass Filter - No ringing artifact

111

2D - LPF

Filtering with filters having cut-off frequencies equal to distance of radii equal to 10, 30, 60, 160 and 460,
enclosing 87, 93.1, 95.7, 97.8 and 99 % image power.

112
ILPF BLPF GLPF

56
8/3/2022

2 D HPF

Ideal

Butterworth

Gaussian

113

Homomorphic Filtering

114

57
8/3/2022

• The illumination reflectance model can be used to improve the


quality of image that has been acquired under poor illumination

115

• An image f(x, y) can be expressed as the product of illumination and reflectance components:

• Equation above cannot be used directly to operate separately on the frequency components of
illumination and reflectance because the Fourier transform of the product of two functions is not
separable; in other words,

• where Fi (u, v) and Fr (u, v) are the Fourier transforms of ln i(x, y) and ln r(x, y), respectively
116

58
8/3/2022

• If we process Z (u, v) by means of a filter function H (u, v) then, from

117

118

59
8/3/2022

• Applying mask to a filter is also called convolving image with mask.


• In image processing by convolving image with mask we are
performing the 2D correlation
• Actual 2D convolution is done using mirrored kernels (ie flipping the
rows and then flipping the columns)

119

2 D convolution

120

60
8/3/2022

• In image processing most of the mask are symmetric. That is why we


are saying convolving image with mask/filter

121

122

61
IMAGE ENHANCEMENT IN FREQUENCY DOMAIN

 Selective enhancement or suppression of frequency components is termed as Fourier Filtering or


Frequency domain filtering
 Frequency domain representation - clusters the image data according to their frequency distribution
 In spatial domain, filtering is done by convolving the input image 𝑓(𝑥, 𝑦) with the kernel h(𝑥, 𝑦)
 In frequency domain, filtering corresponds to the multiplication of the image spectrum 𝐹(𝑘, 𝑙) by the
Fourier transform of the kernel 𝐻(𝑘, 𝑙)
 Convolution in spatial domain is the same as multiplication in frequency domain
 Low frequency components of Fourier Transform are responsible for general gray level appearance.
High frequency components of Fourier transform are responsible for detail information of an image

Types of Frequency domain Filters


• Lowpass
– Ideal Lowpass Filters
– Butterworth Lowpass Filters
– Gaussian Lowpass Filters
• Highpass
– Ideal Highpass Filters
– Butterworth Highpass Filters
– Gaussian Highpass Filter

IDEAL LOW-PASS FILTER:


Cuts off all high-frequency components at a distance greater than a certain distance from
origin (cutoff frequency).

Fig: ideal low pass filter 3-D view and 2-D view and line graph
Effect of different cutoff frequencies:
As the cutoff frequency decreases,
 image becomes more blurred
 Noise becomes increases
 Analogous to larger spatial filter sizes

Why is there ringing?

 The Ideal LPF has sharp cutoffs or discontinuities which cause ringing.
 The ILPF has a sinc function behaviour in the Spatial Domain.
 The center of lobe is the cause for blurring but the outer smaller lobes cause ringing.
 We want to achieve blurring with little ringing.

BUTTERWORTH LOW-PASS FILTER(BLPF):


Transfor funtion of a Butterworth lowpass filter (BLPF) of order n, and with cutoff frequency at
a distance D0 from the origin, is defined as

-
Transfer function does not have sharp discontinuity establishing cutoff between passed and
filtered [Link] off frequency D0 defines point at which H(u,v) = 0.5

Fig. (a) perspective plot of a Butterworth lowpass-filter transfer function. (b) Filter displayed
as an image. (c)Filter radial cross sections of order 1 through 4.

Unlike the ILPF, the BLPF transfer function does not have a sharp discontinuity that gives a
clear cutoff between passed and filtered frequencies. In BLPFA smooth transition in blurring as a
function of increasing cutoff frequency. Moreover, no ringing is visible in any of the images processed
with this particular BLPF, a fact attributed to the filter‟s smooth transition between low and high
frequencies.
GAUSSIAN LOWPASS FILTERS (GLPF):

The form of these filters in two dimensions is given by

 This transfer function is smooth , like Butterworth filter.


 Gaussian in frequency domain remains a Gaussian in spatial domain
 Advantage: No ringing artifacts.
Where D0 is the cutoff frequency. When D(u,v) = D0, the GLPF is down to 0.607 of its maximum value.
This means that a spatial Gaussian filter, obtained by computing the IDFT of above equation., will have
no ringing. Fig..shows a perspective plot, image display and radial cross sections of a GLPF function.

IMAGE SHARPENING USING FREQUENCY DOMAIN FILTERS (High Pass filters):


An image can be smoothed by attenuating the high-frequency components of its Fourier
transform. Because edges and other abrupt changes in intensities are associated with high-frequency
components, image sharpening can be achieved in the frequency domain by high pass filtering, which
attenuates the low-frequency components without disturbing high- frequency information in the Fourier
transform.

 When low-pass filter attenuated frequencies, high-pass filter passes them

 When high-pass filter attenuates frequencies, low-pass filter passes them. A high pass filter is
obtained from a given low pass filter using the equation.
H hp (u,v) = 1- Hlp (u,v)
Where Hlp (u,v) is the transfer function of the low-pass filter. That is when the low- pass filter attenuates
frequencies, the high-pass filter passed them, and vice-versa.

Fig.. shows typical 3-D plots, image representations and cross sections for these filters. The
Butter-worth filter represents a transition between the sharpness of the ideal filter and the broad
smoothness of the Gaussian filter.
Fig: Top row: Perspective plot, image representation, and cross section of a typical ideal high-
pass filter. Middle and bottom rows: The same sequence for typical butter-worth and Gaussian high-pass
filters.
Ideal high-pass filter:
A 2-D ideal high-pass filter (IHPF) is defined as
H (u,v) = 0, if D(u,v) ≤ D0
= 1, if D(u,v) ˃ D0

The IHPF is the opposite of the ILPF in the sense that it sets to zero all frequencies inside a circle of
radius D0 while passing, without attenuation, all frequencies outside the circle. As in case of the
ILPF, the IHPF is not physically realizable.
Butter-worth high-pass filters:
A 2-D Butter-worth high-pass filter (BHPF) of order n and cutoff frequency D0 is defined as

Butter-worth high-pass filter to behave smoother than IHPFs.

Gaussian High pass filters:


The transfer function of the Gaussian high-pass filter(GHPF) with cutoff frequency locus at a
distance D0 from the center of the frequency rectangle is given by

• Ideal Highpass Filter - Ringing artifact is more


• Butterworth Highpass Filter - Ringing artifact is less
• Gaussian Highpass Filter - No ringing artifac
Solved Examples

1. Suggest a suitable filter that will reduce the impact of salt-and-pepper noise at the same time it
preserves the edges in the image.
The filter that will reduce the impact of salt-and-pepper noise with minimum blurring is a median filter.

2. Suggest a suitable filter that could minimise the impact of ‘Gaussian noise’?
Gaussian filter is an optimum filter that could reduce the impact of Gaussian noise.

3. Compute the median value of the marked pixel

4. Compute the value of the marked pixel if it smoothened by 3 X 3 box filter


5. Compute the median value of the marked pixels
6. Justify the statement “Median Filter is effective tool to minimize salt-and-pepper noise”
7. Filter the image using 3 X 3 neighbourhood averaging by assuming (a) Zero padding (b) Pixel
Replication
Similarly find the average value of all pixels

8. Find the value of marked pixel after 5 X 5 median filter


9. Find the value of marked pixel after 3 X 3 median filter

Consider 3 x 3 neighbourhood around marked pixel. Arranging pixels in ascending order 0 0 0 1 1 1 2 2 3


The median value is 1

10. If all the pixels in an image are shuffled, will there be any change in the histogram. Justify your
answer.

11. Can two different images have the same histogram? Justify your answer
Yes, there is a possibility that two different images can have the same histogram. For example, the
histograms of the original image and the flipped image are taken. Since the values of the pixels are not
affected by a ‘flipping’ operation, the histogram of the original image is the same as the histogram of the
flipped image. Even though the original and flipped images are different, their histograms remain the same.
From this illustration, it is obvious that two different images can have the same histogram.

12. What will we obtain if the arithmetic mean filter is applied to an image again and again? What will
happen if we use the median filter instead?
Iterative arithmetic mean filtering will ultimately blur the whole image with constant gray level. On the
other hand, iterative median filtering will only change once after the first round of filtering, and will remain
stable from that moment on which is invariant to the filter.

13. Two images have the same histogram. Which of the following properties must they have in
common? (i) Same total power (ii) Same entropy (iii) Same interpixel covariance function
The total power and entropy must be the same when two images have the same histogram, because the total
power and entropy depend only on the pixel values and not on the order they are arranged in the image.
The interpixel covariance function is not necessarily the same when two images have the same histogram.

14. Are convolutional filters linear? Justify your answer.


A convolutional mask operation provides a result that is a weighted sum of the values of a pixel and its
neighbours. Hence, convolutional filters are linear.

You might also like