Unit 2 Image Processing
Unit 2 Image Processing
ENHANCEMENT
•Key Terms:
Enhancement is the process of manipulating an image
result is more suitable than the original for a specific
so that the
• application.
Spatial domain: It refers to the image plane itself, image
processing
methods in this category are based on direct
manipulation of pixels
in an image.
• Transform domain: Image is transformed to transform
domain
• using particular
Intensity transform,and
transformations processing being done
spatial filtering are there,
then
two main
inverse transform
principals applied
in spatial to back the spatial domain. In
domain.
transform 2
Image Enhancement
•Examples
Contrast
Enhancement
• Edge Enhancement
• Noise Filtering
•• Sharpening
Magnifying
4
Image
Enhancement
5
Point
Processing
6
Spatial
Filtering/Neighborhood
7
Global
Processing
8
Spatial Domain
Techniques
9
Image Enhancement-Spatial
• Domain
Intensity transformation works directly on individual
pixels,
where as in spatial filtering, neighborhood of every
• pixel willdomain processes based on the following
Spatial
be considered for filtering. Ex. Image Smoothening.
equation:
13
Types of Gray Level
Transformation
14
Intensity
transformation
15
Image
Negatives
• The negative of an image with intensity levels in
the
range 0, 퐿 − 1 is obtained by using the negative
transformation function here in the expression.
푠 = 퐿− 1− 푟
• Reversing the intensity levels of a digital image in
this
manner produces the equivalent of a
photographic
negative.
• This type of processing is used, for example, in 16
Image
Negatives
20
Power-Law (Gamma)
Transformations
21
22
23
24
Piece-wise
transformation
25
Piece-wise
transformation
26
Contrast
Stretching
• Low-contrast images can result from poor illumination, lack
of dynamic
range in the imaging sensor, or even the wrong setting of a
• lens
Contrast stretching expands the range of intensity levels in
anaperture
image soduring image acquisition.
that it spans the ideal full intensity range of the recording
medium or
display device.
27
Contrast
Stretching
28
Intensity-Level
•Slicing
There are
applications
in which it is of
interest
to highlight a
• specific
Some of
range of intensities
applications
these include
in
enhancing features
an
in image.
satellite imagery,
such
as masses of water,
and
enhancing flaws in
29
X-
Intensity-Level
Slicing
30
Bit-Plane
Slicing
• Pixel values are integers composed
of bits. Values in a 256-level
grayscale image are composed of 8
bits.
• Instead of highlighting intensity-
level ranges, we could highlight the
contribution made to total image
appearance by specific bits.
• An 8-bit image may be considered
as being composed of eight one-bit
planes, with plane 1 containing the
lowest-order bit of all pixels in the
image, and plane 8 all the highest-
order bits. 31
Bit-Plane
Slicing
32
Basics of Spatial
filtering
33
Basics of Spatial
filtering
34
Types of Spatial
filtering
35
Smoothing
• Smoothing is the process of reducing “sharp”
filters
in the gray levels of an
transitions
• image.
The important uses of
smoothing are,
. Removal of small details from an image
• Blurring:
extractio
before object
. Bridging
n of small gaps in lines or
curves
• Noise reduction:
. Linear or Averaging Filters
. Non-Linear or Order-Statistics
Filters
36
Smoothing by Linear
Filters
37
Smoothing by Linear
Filters
38
39
40
Applications
• Noise reduction
• Smoothing of false contours i.e outlines
• Blurring an image to highlight the objects of
interest
• Reducing irrelevant detail in the image
Drawbacks
• Edges of an image will have sharp transitions
which are
very important for the image. The smoothing
process blur
the edges which is undesired. 41
Smoothing by Non-Linear
Filters
42
43
Application
s
44
Sharpening Spatial
filters
45
Sharpening Spatial
filters
46
Sharpening Spatial
filters
• A basic definition of the first-order derivative of a one-
function f (x) is the
dimensional
difference
47
Second Order derivatives
(or)
Laplacian Operators
48
Laplacian
Operators Filter mask used to implement the
digital Laplacian
49
Laplacian
Operators
50
51
Unsharp and High Boost
•Filtering
Subtracting an unsharp (smoothed) version of an
original
image the called unsharp
image
from
• masking.
The following are the
steps:
53
Unsharp and High Boost Filtering
Example
54
First Order derivatives (or)
Gradient
Operators
55
Robert’s Cross
Operator
56
Sobel’s
Operator
57
Prewitt’s
Operator
58
Application of Gradient
Operators
59
Gradient using Sopel
Operator
60
Histogram
Processing
• The
gray
histogram of an image is a plot of the number of occurrences of
image against
levels in thethe gray-level
values.
• The histogram provides a convenient summary of the intensities in an
unablebut
image, to it
convey
is any information regarding spatial relationships
• between pixels.provides more insight about image contrast and
The histogram
brightnessImage
brightness. may be improved by modifying the histogram of
1.the
Theimage.
histogram of a dark image will be clustered towards the lower gray level.
2. The histogram of a bright image will be clustered towards higher gray level.
3. For a low-contrast image, the histogram will not be spread equally, that is, the
histogram will be narrow.
4. For a high-contrast image, the histogram will have an equal spread in the gray
level.
61
Why
Histograms?
• To reveal underexposed or over exposed
image in
objects
• sTo provide visual information for
statistical properties of
evaluating
• images
Information derived from histograms are
imagefor
useful processing
applications
62
Histogram
Example
63
Histogram
Processing
64
Histogram
Processing
• Mostly, we work with normalized histograms, which we refer to
simply as or image histograms.
histograms
• The sum of 푝푘 푟 for all values of k is always 1. The 푘
components
estimates ofofthe
푝 probabilities of intensity levels occurring in
an image. are simple to compute and are also suitable for fast
• Histograms
hardware
implementations, thus making histogram-based techniques a
• popular
Histogramtool for is related to image appearance. For example,
shape
real-time
Figure image processing.
in next
slide shows images with four basic intensity characteristics: dark,
light, low
contrast, and high contrast; the image histograms are also
shown. 65
66
67
Histogram
Equalization
68
Histogram
Equalization
69
Histogram
Equalization
70
Histogram
Equalization
71
Histogram
Equalization
72
Advantag
es
73
Uses of Histogram
Parameters
• Some statistical parameters directly obtained
histogra
from image
m:
• Moment
• Mean
• Variance and
• standard
deviation
74
Frequency Domain
Filtering
75
Frequency Domain
Filters
86
Basics of Fourier
Transform
76
Basics of Fourier
Transform
77
Basics of Fourier
Transform
78
Basics of Fourier
Transform
79
Steps in Frequency Domain
Filtering
80
Steps in Frequency Domain
Filtering
81
Steps in Frequency Domain
Filtering
82
Steps in Frequency Domain
Filtering
83
Steps in Frequency Domain
Filtering
84
Steps in Frequency Domain
Filtering
85
Frequency Domain
Filters
86
Frequency Domain
Filters
87
Ideal
LPF
88
Ideal
LPF
• (a) Perspective plot of an ideal lowpass-filter transfer function. (b) Function displayed as an image.
• (c) Radial cross section.
89
(a) Original image of size 688 × 688 pixels. (b)–(f) Results of filtering using ILPFs with cutoff
frequencies set at radii
values 10, 30, 60, 160, and 460, as shown in Fig. 4.40(b). The power removed by these filters
was 13.1, 7.2, 4.9, 2.4,
and 0.6% of the total, respectively. We used mirror padding to avoid the black borders 90
characteristic of zero padding,
Spatial
Representation
(a) Frequency domain ILPF transfer function. (b) Corresponding spatial domain kernel function. (c) Intensity profile
of a horizontal line through the center of (b).
91
Butterworth
LPF
(a) Perspective plot of a Butterworth lowpass-filter transfer function. (b) Function displayed as an
image.
(c) Radial cross sections of BLPFs of orders 1 through 4.
92
• (a) Original image of size 688 ×
688 pixels. (b)–(f) Results of
filtering using BLPFs with cutoff
frequencies at the radii shown in
Fig. and n = 2.25. We used
mirror padding to avoid the
black borders characteristic of
zero padding.
93
Spatial
Representation
95
(a) Original image of size 688
× 688 pixels. (b)–(f) Results of
filtering using GLPFs with
cutoff frequencies at the radii
shown in Fig. We used mirror
padding to avoid the black
borders characteristic of zero
padding.
96
Transfer functions of smoothing
filters
97
Sharpening
Filters
Subtracting a lowpass filter transfer function from 1 yields the
corresponding highpass filter transfer function in the frequency
domain:
98
• Top row: Perspective
plot, image, and, radial
cross section of an IHPF
transfer function.
• Middle and bottom rows:
The same sequence for
GHPF and BHPF transfer
functions.
99
100
• Top row: The
image
from Fig. filtered
with
IHPF, GHPF,
functions andD0
using
= 60 transfer
BHPF
in all cases (n = 2
for
• Second
the BHPF).
row:
Same sequence, but
using
D0 = 160.
101
SELECTIVE FILTERING
There are applications to process specific bands of frequencies or
small regions of the frequency rectangle.
Filters in the first category are called band filters.
If frequencies in the band are filtered out called a bandreject filter.
If the frequencies are passed, the filter is called a bandpass filter.
In ideal bandpass filters, frequencies within the given range are passed through
without attenuation and frequencies outside of the given range are completely
removed.
The centered Fast Fourier Transform (FFT) is filtered by the following function,
where DL is the lower bound of the frequency band, DH is the upper bound of the
frequency band, and D(u,v) is the distance between a point (u,v) in the frequency
domain and the center of the frequency rectangle:
BUTTERWORTH
This keyword to the dimension of the Butterworth filter to apply to the
frequency domain.
With a Butterworth bandpass filter, frequencies at the center of the
frequency band are unattenuated and frequencies at the edge of the
band are attenuated by a fraction of the maximum value.
The Butterworth filter does not have sharp discontinuities between
frequencies that are passed and filtered.
The default for BANDPASS_FILTER is BUTTERWORTH=1.
The centered FFT is filtered by one of the following functions,
where D0 is the center of the frequency band, W is the width of the
frequency band, D=D(u,v) is the distance between a point (u,v) in the
frequency domain and the center of the frequency rectangle, and n is
the dimension of the Butterworth filter:
GAUSSIAN
This keyword to use a Gaussian bandpass filter.
In this type of filter, the transition between unfiltered and filtered
frequencies is very smooth.
The centered FFT is filtered by one of the following functions,
Note: A low Butterworth dimension is close to Gaussian, and a high Butterworth dimension is close to Ideal.
GAUSSIAN
This keyword to use a Gaussian band reject filter.
In this type of filter, the transition between unfiltered and filtered
frequencies is very smooth.
The centered FFT is filtered by one of the following functions,
Passband region: frequency range with minimum attenuation level (typically close to 0 dB).
Reference
s:
• R.C. Gonzalez & R.E. Woods, Digital Image Processing, Addison
Wesley/Pearson education, 3rd
• edition, 2010.S Esakkirajan, T Veerakumar, Digital Image processing,
S Jayaraman,
Tata McGraw Hill,
• 1stedition, 2009.
NPTEL :: Electronics & Communication Engineering - NOC:Digital
Image Processing
139