You are on page 1of 140

UNIT – II

1/95
IMAGE PRE-PROCESSING
TECHNIQUES

Text Books:
 Digital Image Processing – Gonzalez & Woods, 3rd Edition

2/95
CONTENTS
 IMAGE ENHANCEMENT
 Spatial Domain Methods
• Histogram Processing
• Fundamentals of Spatial Filtering
• Smoothing Spatial Filters
• Sharpening Spatial Filters
 Frequency Domain Methods
• Basics of Filtering in Frequency Domain
• Image Smoothing
• Image Sharpening
• Selective Filtering

3/95
CONTENTS (Contd…)

 IMAGE SEGMENTATION
• Segmentation Concepts
• Point Detection
• Line Detection
• Edge Detection
• Thresholding
• Region Based Segmentation

4/95
CONTENTS (Contd…)
 IMAGE COMPRESSION
• Fundamentals
• Coding Redundancy
• Spatial & Temporal Redundancy
• Compression Methods –
 Huffman Coding
 Arithmetic Coding
 LZW Coding
 Run Length Coding
 Bit Plane Coding
 Transform Coding
 Predictive Coding
 Lossy & Lossless Coding
 Wavelet Coding
• JPEG Standards

5/95
 The principle objective of Image Enhancement is to process
an image so that the result is more suitable than the original
image for specific application
 Image Enhancement approaches fall into 2 broad categories
1. Spatial Domain
2. Frequency Domain
Spatial Domain refers to the image plane itself & approaches
are based on direct manipulation of pixels in an image
Frequency Domain refers to modifying Fourier Transform of
an image

6/95
HISTOGRAM PROCESSING
 The Histogram of a digital image with intensity levels in the
range (0, L-1) is a discrete function h(rk) = nk, where rk is the

kth intensity value & nk is the no. of pixels in the image with

intensity rk
 The Normalized Histogram can be obtained by dividing each
of its components by the total no. of pixels in the image i.e.,
MN, where M is the no. of rows and N is no. of columns in
the image
 Normalized Histogram is given by – p(rk) = nk/MN
Contd …
7/95
 Histograms are simple to calculate in software and also lend
themselves to economic hardware implementations. Thus
making a popular tool for real time image processing
 The Histogram Processing for intensity transformations can
be explained by the fig – 1
 The left side of the figure is the image with four different
intensity characteristics – Dark,
Light,
Low Contrast
High Contrast
Contd …
8/95
4 Basic Image Types & Corresponding HistogramsContd …
9/95
 The right side of the figure shows the Histogram of the
corresponding images on the left
 The horizontal axis if each histogram plot corresponds to
the intensity values i.e., rk
 The vertical axis of each histogram plot corresponds to the
values of h(rk) = nk or p(rk) = nk/MN, if the values are
normalized
 Thus the histogram can be graphically viewed as plots of
h(rk) = nk versus rk or p(rk) = nk/MN versus rk

Contd …
10/95
 In dark image, components of the histogram are concentrated
on the lower side of the intensity scale
 The components of the histogram of light image are biased
towards the high side of the intensity scale
 An image with low contrast has a narrow histogram located
typically towards the middle of the intensity scale
 The components of the histogram in the high contrast image
cover a wide range of intensity scale

Contd …
11/95
Histogram Equalization
 Consider an Image with continuous intensity values
 Let, r be the intensity values of the image to be processed
 The range of r is (0, L-1) with r = 0 representing black and r
= L-1 representing white
 For satisfying these conditions, the transformation is of the
form – S = T(r), 0 ≤ r ≤ L-1
 The transformation or intensity mappings produce an output
intensity level S for each pixel in the input image with the
intensity r
Contd …
12/95
 The transformation must satisfy two conditions –
1. T(r) is monotonically increasing function in the interval
0 ≤ r ≤ L-1
2. 0 ≤ T(r) ≤ L-1 for 0 ≤ r ≤ L-1
Monotonically Increasing Function: If T(r2) ≥ T(r1) for r2 > r1
 Condition – 1 guarantees the O/P intensity values will never
be less than the corresponding I/P values, thus preventing
artifacts created by reversals of intensity
 Condition – 2 guarantees the range of O/P intensities is same
as the input
Contd …
13/95
 The inverse transformation is given by – r = T-1(S)
 The inverse transformation must satisfy the two conditions –
1. T(r) is strictly monotonically increasing function in the
interval 0 ≤ r ≤ L-1
2. 0 ≤ T(r) ≤ L-1 for 0 ≤ r ≤ L-1
Strictly Monotonically Increasing Function: If T(r2) > T(r1) for r2 > r1
 Condition – 1 guarantees the mappings from S back to r are
one-to-one, thus preventing the ambiguities

Contd …
14/95
 The fig – a shows a function which satisfies both conditions
of a monotonically increasing function
 It is possible for multiple values to map to a single value and
still satisfy the first two conditions

(a) Monotonically Increasing Function


Contd …
(b) Strictly Monotonically Increasing Function
15/95
 A monotonic transformation function performs one to-one or
many-to-one mapping, which is perfectly done when
mapping
from r to S
 However, the monotonically increasing function presents a
problem to recover the values of r uniquely from the mapped
values
 The inverse mapping of Sk is possible but inverse mapping of

Sq is not possible which does not help in recovering original

value of r that resulted from Sq Contd …


16/95
 The Fig – b shows strictly monotonically increasing function
which guarantees the inverse mappings to be singled values
i.e., the mapping is one-to-one in both the directions
 The intensity levels in an image may be viewed as random
variables in the interval (0, L-1)
 The fundamental descriptor of a random variable is its PDF

Contd …
17/95
(a) 4 Basic Image Types
(b) Corresponding Histogram
Equalized Images
(c) Histograms of the Images
in (b)

Contd …
18/95
 The left column in fig (a) shows four images with various
intensity characteristics i.e., dark, light, low contrast and
high
contrast
 The center column in fig (b) shows the result of performing
the histogram equalization on each of the four images
 The result of histogram equalization on dark, light and low
contrast images gives a significant improvement
 The histogram equalization on the high contrast image did
not
Contd …
have much effect because the intensities of this image already
19/95
 The right column in fig (c) shows the histograms of the
equalized images
 The histograms of the dark, light and low contrast images are
visually very similar
 This is because the images have same content, the increase in
contrast resulting from histogram equalization was enough to
render any intensity differences in the equalized images
visually indistinguishable

Contd …
20/95
 Though there is a significant contrast difference between the
original images, this example illustrates power of histogram
equalization as an adaptive contrast enhancement tool
 The fig – (b) shows transformation function used to generate
the equalized image in fig – (a)
 The transformation functions are generated by using Eq. 12
 The transformation function of the high contrast image has a
nearly linear shape, which indicates that the inputs were
mapped to nearly equal outputs

Contd …
21/95
Histogram Matching

 The Histogram Equalization automatically determines a


transformation function that seeks to produce an output
image that ha a uniform histogram
 When an automatic enhancement is desired, this is a good
approach because results from this technique are predictable
and the method is simple to implement
 The method used to generate a processed image that has a
specified histogram is called Histogram Matching

Contd …
22/95
 The Histogram Matching is also named as the Histogram
Specification
 Consider an image with continuous intensity values
 Let, r & z be the intensity values of the input & output
images
respectively
 Let, Pr(r) and Pz(z) be the continuous PDFs

 The PDF of r, Pr(r) can be estimated from the given I/P


image
 The PDF of z, Pz(z) is the specified PDF of the O/P image
Contd …
23/95
 Let, S be a random variable with the property –
S = T(r) = (L-1) ------ Eq. 1
where, w – Dummy variable of integration
 Let, z be a random variable with the property –
G(z) = (L-1) = S ------ Eq. 2
where, t – Dummy variable of integration
 From Eq. 1 and Eq. 2, we get –
S = T(r) = G(z)
Z = G-1(S) = G-1(T(r)) ------ Eq. 3

Contd …
24/95
 The transformation T(r) can be obtained from Eq. 1 if Pr(r) is
estimated from the input image
 The transformation function, G(z) can be obtained from Eq. 2
if Pz(z) is known

Contd …
25/95
 An image whose intensity levels have a specified PDF can be
obtained from a given image by using Eq. 1, 2 & 3 with the
following procedure –
1. Obtain Pr(r) from the I/P image and use Eq. 1 to obtain
the values of S
2. Use the specified PDF in Eq. 2 to obtain the
transformation function G(z)
3. Obtain the inverse transformation from Eq. 3, as z is
obtained from S, this process is a mapping from S to z

Contd …
26/95
4. Obtain the O/P image by first equalizing the input image
by using Eq. 1, the pixel values in this image are the S
values. For each pixel with value S in the equalized
image, perform the inverse mapping by Eq. 3 to obtain
the corresponding pixel in the O/P image. When all
pixels have been processed the PDF of the O/P image
will be equal to the specified PDF

Contd …
27/95
 The discrete form of transformation in Eq. 1 is given by –
Sk = T(rk) = (L-1)

Sk = T(rk) =
, for k = 0 to L-1 ------ Eq. 4
Where, MN – Total Number of Pixels in the Image
nj – Number of Pixels with Intensity Value rj
L – Total No. of possible Intensity Levels in image
 The discrete formulation of Eq. 2 if the specific value of Sk is
given in computing the transformation function is –
G(zq) = (L-1) pz(zi) ------ Eq. 5

Where, pz(zi)– ith value of the specified histogram


Contd …
28/95
 The inverse transformation is given by –
Zq = G-1(Sk) ------ Eq. 6
 This equation gives the value of z for each value of S, thus it
performs a mapping from S to z

Contd …
29/95
 Procedure for Histogram Matching or Histogram
Specification
is as follows –
1. Compute the histogram Pr(r) of the given image and use it
to find the histogram equalization transformation in Eq. 4.
Round the resulting values, Sk to integer range [0, L-1]
2. Compute all the values of the transformation function G
using Eq. 5 for q = 0 to L-1, where pz(zi) are the values of
the specified histogram. Round the values of G to integers
in the range [0, L-1]. Store the values of G in a tableContd …
30/95
3. For every value of Sk, k = 0 to L-1 use the stored value of

G from step – 2 to find the corresponding value of zq, so

that is G(zq) is closest to Sk and store these mappings from

S to z. When more than one value of zq satisfies the given

Sk, choose the smallest value by convention


4. Form the histogram specified image by first histogram
equalizing the input image and then mapping every
equalized pixel value, Sk of this image to the

corresponding value zq, in the histogram specified image


Contd …
using the mappings found in step – 3.
31/95
4. As in the continuous case, the intermediate step of
equalizing the input image is conceptual. It can be
skipped by combining the two transformation functions T
and G-1

Contd …
32/95
Comparison b/t Histogram Equalization and
Histogram Matching

(a) Image of Mars Moon Phobos


Taken By Global Surveyor
(b) Histogram of the Image in (a)

Contd …
33/95
 The fig – (a) shows an image of Mars Moon Phobos taken by
NASA’s Mars Global Surveyor
 The fig – (b) the histogram of fig – (a)
 The image is dominated by large, dark areas which results in
a histogram characterized by a large concentration of pixels
in the dark end of a gray scale
 At first glance, it would look like histogram equalization is a
good approach to enhance the image, so that the details in the
dark areas become more visible
 But it is not going to enhance
Contd …
34/95
(a) Transformation Function for
Histogram Equalization

(b) Histogram Equalized Image


(c) Histogram of (b)

Contd …
35/95
 The fig – (a) shows the histogram equalization transformation
obtained from the histogram in fig – (b) of previous figure
 The most relevant characteristic of this transformation
function is how fast it rises from intensity level 0 to a level
near 190
 This is caused by the large concentration of pixels in the
input
histogram having levels near 0

Contd …
36/95
 When this transformation is applied to levels of input image
to obtain a histogram equalized result, the net effect is to
map
a very narrow interval of dark pixels into the upper end of
the
gray scale of the output image
 Because numerous pixels in input image have levels precisely
in this interval, the resulting image can be light, washed out
appearance
 This is shown in fig – (b)
Contd …
37/95
 The histogram of this image is shown in fig – (c)
 In the histogram of the output image, all the intensity levels
are biased towards the upper half of the gray scale
 Because the problem with transformation function in fig – (a)
was caused by large concentration of pixels in original image
with levels near 0, a reasonable approach is to modify the
histogram of that image so that it does not have this property

Contd …
38/95
(a) Specified Histogram
(b) Transformations
(c) Enhanced Image Using
Mappings from Curve (2)
(d) Histogram of (c)

Contd …
39/95
 The fig – (a) shows a manually specified function that
preserves the general shape of original histogram, but has a
smoother transition levels in dark region of the gray scale
 Sampling this function into 256 equally spaced discrete
values produced the desired specified histogram
 Transformation function G(z) obtained from this histogram
by using Eq. is labeled transformation – 1 in fig – (b)
 Similarly, the inverse transformation from Eq. is labeled
transformation – 2 in fig – (b)

Contd …
40/95
 The enhanced image in fig – (c) was obtained by applying
transformation – 2 to the pixels of the histogram equalized
image in fig – (b)
 The improvement of the histogram specified image over the
result obtained by histogram equalization is evident by
comparing these two images
 It is of interest to note that a rather modest change in the
original histogram was all required to obtain a significant
improvement in appearance

Contd …
41/95
 The fig – (d) shows the histogram of fig – (c)
 The most distinguishing feature of this histogram is how its
low end has shifted right towards the lighter region of the
gray scale

Contd …
42/95
Local Histogram Processing

 The Histogram equalization and the Histogram Matching


are Global Histogram Processing
 The pixels are modified by a transformation function based
on the intensity distribution of an entire image
 Although global approach is suitable for overall enhancement
there are cases in which it is necessary to enhance the details
over small areas in an image

Contd …
43/95
 The number of pixels in these areas may have negligible
influence on the computation of a global transformation
whose shape does not necessarily guarantee the desired
local enhancement
 The solution is to devise transformation functions based in
the image
 The Histogram Equalization and Histogram Matching can
easily be adapted to Local Enhancement
 The procedure is to define a neighborhood and move its
center from pixel to pixel
Contd …
44/95
 At each location histogram of the points in neighborhood is
computed and either a histogram equalization or histogram
matching transformation function is obtained
 This function is used to map the intensity of pixel centered
in the neighborhood
 The center of the neighborhood region is then moved to an
adjacent pixel location and the procedure is repeated

Contd …
45/95
 Because only one row or column of the neighborhood
updating the histogram obtained in previous location with
the new data introduced at each motion step is possible
 This approach has obvious advantages over repeatedly
computing the histogram of all pixels in the neighborhood
region each time the region is moved one pixel location
 Another approach which is used to reduce computations is
to utilize non-overlapping regions, but this method
produces an undesirable blocky effect

Contd …
46/95
m pl
Exa
e

(a) Original Image


(b) Result of Global Histogram Equalization
(c) Result of Local Histogram Equalization applied to (a) using a
Neighborhood of size 3 X 3

Contd …
47/95
 The fig – (a) shows an 8 – bit 512 X 512 image that appears
to contain five black squares on a gray background
 The image is slightly noisy but the noise is imperceptible
 The fig – (b) shows result of global histogram equalization
 The histogram equalization of smooth and noisy regions
shows a significant enhancement of the noise

Contd …
48/95
 The fig – (b) does not reveal any significant details from
the
image other than a very faint hint that top left and bottom
right squares contain an object
 The fig – (c) is a significant detail contained within dark
squares can be seen
 The intensity values of these objects were too close to the
intensity of the large squares and their sizes were too small
to influence global histogram equalization significantly
enough to slow this detail
Contd …
49/95
Using Histogram Statistics for Image Enhancement

 The Histogram statistics obtained directly from an image


histogram can be used for image enhancement
 Let r denote a discrete random variable representing the
intensity values in the range [0, L-1]
 Let P(ri) denote the normalized histogram component

corresponding to value ri

Contd …
50/95
 The nth moment of r about its mean is defined as –

 The mean value of r is given by –

 The second moment is given by –

 The second moment is the intensity variance denoted by –

51/95
FUNDAMENTALS OF SPATIAL FILTERING
 Spatial Domain
 Spatial Filtering
 Spatial Domain Process
 Linear Spatial Filtering
 Non-Linear Spatial Filtering
 Correlation
 Convolution
 Vector Representation of Linear Filtering
 Generating Spatial Filter Masks
Contd …
52/95
SMOOTHING SPATIAL FILTERS
 Smoothing Linear Filters
 Example – I
 Example – II
 Order Statistic (Non-Linear) Filters
 Example – III

Contd …
53/95
p l e -
Exa m
I

Fig. 2.13 – (a) Original Image of size 500X500 Pixels Contd …


(b) – (f) Results of Smoothing with Square Averaging Filter Masks of Sizes m = 3, 5, 9, 15 and 35
54/95
pl e -
E x am
II

Fig. 2.14 – (a) Image of Size 528X485 Pixels from the Hubble Space Telescope
(b) Image Filtered with a 15X15 Averaging Mask
(c) Result of Thresholding (b)

Contd …
55/95
pl e -
E x a m
I II

Fig. 2.15 – (a) X-Ray Image of Circuit Board Corrupted by Salt & Pepper
Noise
(b) Noise Reduction with a 3X3 Averaging Mask
(c) Noise Reduction with a 3X3 Median Filter

56/95
SHARPENING SPATIAL FILTERS
 Foundation
 Example – I
 Using The Second Derivative for Image Sharpening –
 The Laplacian
 Example – II
 Unsharp Masking and High Boost Filtering
 Example – III
 Example – IV
 Using First Order Derivatives for Non-Linear Image Sharpening –
 The Gradient
 Example – V
Contd …
57/95
pl e -
E xam
I

Fig. 2.16 – Illustration of the First and Second Derivatives of a 1-D Digital Function
Representing a Section of a Horizontal Intensity Profile from an Image Contd …
58/95
pl e -
E x am
II

Fig. 2.17 – (a) Blurred Image of the North Pole of the Moon
(b) Laplacian without Scaling (c) Laplacian with Scaling
(d) Image Sharpened using the Mask I (e) Result of using the Mask II Contd …
59/95
p l e -
E xa m
III

Fig. 2.18 – 1-D Illustration of the Mechanics of Unsharp Masking


(a) Original Signal (b) Blurred Signal with Original Shown Dashed for Reference
(c) Unsharp Mask (d) Sharpened Signal obtained by adding (c) to (a) Contd …
60/95
pl e -
E xam
IV

Fig. 2.19 – (a) Original Image (b) Result of Blurring with a Gaussian Filter
(c) Unsharp Mask (d) Result of using Unsharp Masking
Contd …
(e) Result of using High Boost Filtering
61/95
pl e -
Ex am
V

Fig. 2.20 – (a) Optical Image of Contact Lens


(b) Sobel Gradient

62/95
BASICS OF FILTERING IN FREQUENCY
DOMAIN
 Characteristics of Frequency Domain
 Example – I
 Frequency Domain Filtering Fundamentals
 Example – II
 Example – III
 Example – IV
 Example – V
 Example – VI

Contd …
63/95
CONTD …

 Summary of Steps For Filtering In The Frequency Domain


 Example – VII
 Correspondence b/t Filtering in Spatial & Frequency Domain
 Example – VIII
 Example – IX
 Example – X

Contd …
64/95
pl e -
Exa m
I

Fig. 2.21 – (a) SEM Image of a Damaged Integrated Circuit


(b) Fourier Spectrum of (a)

Contd …
65/95
pl e -
E x am
II

Fig. 2.22 – Result of Filtering the Image in Fig. 2.21(a) by setting 0 the term
F(M/2, N/2) in the Fourier Transform

Contd …
66/95
p l e -
E xa m
III

Fig. 2.23 – Top Row: Frequency Domain Filters


Bottom Row: Corresponding Filtered Images obtained using Eq. 6,
a = 0.85 is used in (c) to obtain (f)

Contd …
67/95
pl e -
E xam
IV

Fig. 2.24 – (a) A Simple Image


(b) Result of Blurring with a Gaussian LPF without Padding
(c) Result of LPF with Padding

Contd …
68/95
pl e -
Ex am
V

Fig. 2.25 – 2-D Image Periodicity Inherent in using the DFT


(a) Periodicity Without Image Padding
(b) Periodicity after Padding With 0s (Black)
The Dashed areas in the center correspond to the Image in Fig. 2.24(a)

Contd …
69/95
pl e -
Exa m
VI

Fig. 2.26 – (a) Original Filter Specified in the Frequency Domain


(b) Spatial Representation Obtained by Computing the IDFT of (a)
(c) Result of Padding (b) to twice its Length Contd …
(d) Corresponding Filter in Frequency Domain Obtained by Computing DFT of (c)
70/95
pl e -
Exa m
VII

Fig. 2.27 – (a) Image Resulting from Multiplying by 0.5 the Phase Angle
and then Computing the IDFT
(b) The Result of Multiplying the Phase by 0.25.
The Spectrum was not changed in either of the two cases

Contd …
71/95
p l e -
Exam
VIII

Fig. 2.28 – (a) An M X N image, f (b) Padded Image, fp of Size P X Q


(c) Result of Multiplying fp by (-1)x+y (d) Spectrum of Fp
(e) Centered Gaussian Low Pass Filter, H of Size P X Q (f) Spectrum of the Product HF p
(g) gp, the Product of (-1)x+y and the Real Part of IDFT of HFp
(h) Final Result, g, Obtained by cropping the First M Rows and N Columns of g p
Contd …
72/95
pl e -
Exa m
XI

Fig. 2.29 – (a) Image of a Building


(b) Its Spectrum

Contd …
73/95
pl e -
Ex am
X

Fig. 2.30 – (a) A Spatial Mask and Perspective Plot of its Corresponding Frequency
Domain Filter (b) Filter Shown as an Image
(c) Result of Filtering Fig. 2.29(a) in the Frequency Domain with the Filter in (b)
(d) Result of Filtering the Same Image with the Spatial Filter in (a)

74/95
IMAGE SMOOTHING
USING FREQUENCY DOMAIN FILTERS
 Types of Filters

 Ideal LPF
 Example – I

 Example – II
 Example – III
 Example – IV

 Butterworth LPF
 Example – V

 Example – VI
 Example – VII

 Gaussian LPF
 Example – VIII
 Example – IX

Contd …
75/95
pl e -
Ex am
I

Fig. 2.31 – (a) Perspective Plot of an Ideal Low Pass Filter Transfer Function
(b) Filter Displayed as an Image
(c) Filter Radial Cross Section

Contd …
76/95
pl e -
E x am
II

Fig. 2.32 – (a) Test Pattern of size 688 X 688 Pixels


(b) Its Fourier Spectrum

Contd …
77/95
pl e -
E x a m
I II

Fig. 2.33 – (a) Original Image


(b) – (f) Results of Filtering using ILPFs with Cutoff Frequencies Set to Radii
Values 10, 30, 60, 160 and 460 as shown in 2.32(b)
Contd …
78/95
pl e -
E xam
IV

Fig. 2.34 – (a) Representation in the Spatial Domain of an ILPF of Radius 5


and Size 1000 X 1000
(b) Intensity Profile of a Horizontal Line Passing Trough the Center of Image

Contd …
79/95
pl e -
Ex am
V

Fig. 2.35 – (a) Perspective Plot of a Butterworth LPF Transfer Function


(b) Filter Displayed as an Image
(c) Filter Radial Cross Sections of Orders 1 through 4

Contd …
80/95
pl e -
Exa m
VI

Fig. 2.36 – (a) Original Image


(b) – (f) – Results of Filtering using BLPFs of Order 2 with Cutoff Frequencies
at the Radii Shown in Fig. 2.32
Contd …
81/95
p l e -
Exam
VII

Fig. 2.37 – (a) – (d) Spatial Representation of BLPFs of Order 1, 2, 5 and 20


& Corresponding Intensity Profiles Through the Center of the Filters

Contd …
82/95
pl e -
Exam
VIII

Fig. 2.38 – (a) Perspective Plot of GLPF Transfer Function


(b) Filter Displayed as an Image
(c) Filter Radial Cross Sections for Various Values of D0

Contd …
83/95
pl e -
E xam
IX

Fig. 2.39 – (a) Original Image


(b) – (f) – Results of Filtering using GLPFs with Cutoff Frequencies at the
Radii Shown in Fig. 2.32

84/95
IMAGE SHARPENING
USING FREQUENCY DOMAIN FILTERS
 Types of Filters
 Ideal HPF
 Example – I
 Example – II
 Example – III
 Butterworth HPF
 Example – IV
 Example – V
 Gaussian HPF
 Example – VI

Contd …
85/95
pl e -
Exa m
I

Fig. 2.43 – Top Row: Perspective Plot, Image Representation and Cross
Section of a Typical Ideal High Pass Filter
Middle & Bottom Rows: The Same Sequence for BHPFs and GHPFs
Contd …
86/95
pl e -
E x am
II

Fig. 2.44 – Spatial Representation of Typical (a) Ideal (b) Butterworth


(c) Gaussian Frequency Domain HPFs and Corresponding Intensity Profiles
through their Centers

Contd …
87/95
pl e -
E x a m
I II

Fig. 2.45 – Results of High Pass Filtering the Images in Fig. 2.32(a) using an
IHPF with D0 = 30, 60 and 160

Contd …
88/95
pl e -
E xam
IV

Fig. 2.46 – Results of High Pass Filtering the Image in Fig. 2.32(a) using a
BHPF of Order 2 with D0 = 30, 60 and 160, Corresponding to the Circles in
Fig. 2.32(b)
These Results are Much Smoother than Those Obtained with an IHPF

Contd …
89/95
pl e -
Ex am
V

Fig. 2.47 – Results of High Pass Filtering the Image in Fig. 2.32(a) using a
GHPF with D0 = 30, 60 and 160 & Corresponding to the Circles in Fig.
2.32(b)
Compare with Fig. 2.45 and Fig. 2.46

Contd …
90/95
pl e -
Exa m
VI

Fig. 2.48 – (a) Thumb Print


(b) Result of High Pass Filtering (a)
(c) Result of Thresholding (b)

91/95
SELECTIVE FILTERING
 Band Reject & Band Pass Filters
 Notch Filters

Contd …
92/95
pl e -
Ex am
I

Fig. 2.49 – (a) Band Reject Gaussian Filter


(b) Corresponding Band Pass Filter
The Thin Black Border in (a) was added for Clarity, It is Not Part of the Data

Contd …
93/95
pl e -
E x am
II

Fig. 2.50 – (a) Sampled News Paper Image Showing a Moiré Pattern (b) Spectrum
Contd …
(c) Butterworth Notch Reject Filter Multiplied by the Fourier Transform (d) Filtered Image
94/95
pl e -
E x a m
I II

Fig. 2.51 – (a) 674 X 674 Image of Saturn Rings Showing Nearly Periodic Interference
(b) Spectrum: The Burst of Energy in Vertical Axis near Origin Correspond to Interference Pattern
(c) A Vertical Notch Reject Filter (d) Result of Filtering

95/95
IMAGE SEGMENTATION FUNDAMENTALS
 Segmentation
 5 – Conditions
 Edge Based Segmentation
 Region Based Segmentation
 Example
mp l
Exa
e

Fig. 2.52 – (a) Image Containing a Region of Constant Intensity


(b) Image Showing the Boundary of the Inner Region
Obtained from Intensity Discontinuities
(c) Result of Segmenting the Image into Two Regions
(d) Image Containing a Textured Region
(e) Result of Edge Computations
(f) Result of Segmentation Based on Region Properties

95/95
DETECTION OF DISCONTINUITIES
 Introduction
 Point Detection
 Example – I
 Line Detection
 Example – II
 Example – III
 Edge Detection
 Example – IV
 Example – V
 Example – VI
CONTD …
 Basic Edge Detection
 Example – VII
 Gradient Operators
 Example – VIII
 Example – IX
 Example – X
 Example – XI
p le -
Exam
I

Fig. 2.54 – (a) Point Detection Mask


(b) X-Ray Image of Turbine Blade with a Porosity, The Porosity Contains
a Single Black Pixel
(c) Result of Convolving the Mask with the Image
(d) Result of Using Eq. Showing a Single Point

95/95
p le -
Exam
II

Fig. 2.55 – (a) Original Image


(b) Laplacian Image, The Magnified Section Shows the Positive or Negative Double
Line Effect Characteristic of the Laplacian
(c) Absolute Value of the Laplacian (d) Positive Value of the Laplacian
95/95
l e -
mp
Exa
III

Fig. 2.56 – (a) Image of a Wire Bond Template


(b) Result of Processing With the +45 0 Line Detector Mask
(c) Zoomed View of the Top Left Region of (b)
(d) Zoomed View of the Bottom Right Region of (b)
(e) The Image in (b) with all Negative Values Set to Zero
(f) All Points Whose Values Satisfied the Condition g ≥ T, Where g is the Image in (e) 95/95
l e -
mp
Exa
IV

Fig. 2.57 – (a) Ideal Representation of Step


(b) Ideal Representation of Ramp
(c) Ideal Representation of Roof Edge & Corresponding Intensity Profiles

95/95
l e -
Ex amp
V

Fig. 2.58 – A 1508 X 1970 Image Showing (Zoomed) Actual Ramp (Bottom, Left),
Step (Top, Right) and Roof Edge Profiles
The Profiles are from Dark to Light in the Areas Indicated by the Short Line Segments
Shown in the Small Circles
The Ramp and Step Profiles Span 9 Pixels and 2 Pixels Respectively
The Base of the Roof Edge is 3 Pixels

95/95
l e -
a mp
Ex
VI

Fig. 2.59 – (a) Two Regions of Constant Intensity


Separated by an Ideal Vertical Ramp Edge
(b) Detail Near the Edge,
Showing a Horizontal Intensity Profile,
Together with Its First and Second Derivatives

95/95
l e -
am p
Ex
VII

Fig. 2.61 – Using the Gradient to Determine Edge Strength


and Direction at a Point
Note that the Edge is Perpendicular to the Direction of the Gradient Vector at
that Point where the Gradient is computed. Each Square in the Figure
represents one Pixel

95/95
l e -
m p
x a
E I
I I
V

Fig. 2.64 – (a) Original Image of Size 834 X 1114 Pixels with Intensity Values
Scaled to the Range [0, 1]
(b) Mod of │gx│, The Component of the Gradient in the x – Direction,
obtained Using the Sobel Mask (c)│gy│
(d) The gradient Image, Mod of │gx│ + │gy│

95/95
l e -
a mp
Ex
IX

Fig. 2.65 – Gradient Angle Image


Areas of Constant Intensity in this Image Indicate that
the Direction of the Gradient Vector is the same
at all the Pixel Locations in those Regions

95/95
l e -
am p
Ex
X

Fig. 2.66 – Same Sequence as in Fig. 2.62,


but with the Original Image Smoothed
Using a 5 X 5 Averaging Filter Prior to Edge Detection

95/95
l e -
a mp
Ex
XI

Fig. 2.67 – Diagonal Edge Detection


(a) Result of Using the Mask
(b) Result of Using the Mask

95/95
l e -
mp
Exa
XII

Fig. 2.68 – (a) Threshold Version of the Image in Fig. 2.62(d) with the
Threshold Selected as 33% of the Highest Value in the Image; This Threshold
is high enough to Eliminate Most of the Brick Edges in the Gradient Image
(b) Threshold Version of the Image in Fig. 2.64(d), Obtained Using a
Threshold Equal to 33% of the Highest Value in that Image

95/95

You might also like