You are on page 1of 3

NATIONAL INSTITUTE OF TECHNOLOGY, HAMIRPUR

Department of Electronics and Communication Engineering


EC-743: Digital Image Processing and Pattern recognition (IInd Semester 2018-19)
Assignment 2

1. Intensity Transformation

a) Write a function to decompose a given grayscale image with intensity levels in [0, L − 1]
into its bit planes. (Assume L is a power of 2).

b) Take an 8-bit grayscale image and display its 8 bit planes using the program developed
in (a).

c) Reconstruct the original image by using bit planes 3 to 8. Comment briefly on your
observations.

d) Reconstruct the original image by using bit planes 1 to 7. Comment briefly on your
observations.

2. Histogram Matching (Specification)

a) Write your own histogram specification function which takes two gray scale images
as inputs (a reference and a target image), and transforms the target image such that the
probability density function of the transformed image matches the PDF of the reference
(specified) image.

b) Take a dark image as target image and a good contrast image as reference image and
apply the histogram matching function developed in (a) on these images. Comment briefly
on your observations.

3. Spatial domain Filtering

a) Write your own function to perform spatial filtering of an M × N image with a linear
spatial filter with mask of size m × n). (Assume m = 2a + 1 and n = 2b + 1.

b) Compute the composite mask for the unsharp masking operation and implement it
using the function developed in (a). (Assume a 5x5 Gaussian filter with σ = 4 is used to blur
the image.

c) Compute the composite mask for the high boost filtering operation and implement it
using the function developed in (a).
d) Take Fig. 3.40(a) in [1] and enhance it using unsharp masking and high boost filtering.

4. Two dimensional Discrete Fourier Transform

a) Take any grayscale image and compute its Fourier transform. Display the centered
Fourier spectrum and phase angle array as images.

b) Translate the image in horizontal direction and show the corresponding Fourier spec-
trum and phase angle array of the translated image.

c) Rotate the image by any angle and show the corresponding Fourier spectrum and phase
angle array of the rotated image.

d) Reconstruct the image (inverse Fourier transform) by using only the Fourier spectrum
i.e. setting the phase angle φ(u, v) = 0.

e) Reconstruct the image by using only the phase angle array i.e. setting the Fourier
spectrum |F (u, v)| = 1.
Comment briefly on your observations in each case.

5. Filtering in the Frequency domain

a) Write a function to implement an ideal low pass filter specified by the equation 4.81 [1]
and show its perspective plot.

b) Write a function to implement a Gaussian low pass filter specified by the equation 4.87
[1] and show its perspective plot.

c) Take the image in Fig. 4.42(a) [1] and show the results of filtering the image with filter
developed in (a) for different cutoff frequencies. Comment briefly on your observations.

d) Take the image in Fig. 4.42(a) [1] and show the results of filtering the image with filter
developed in (b) for different cutoff frequencies. Comment briefly on your observations
Bibliography

[1] Rafael C. gonzalez, Richard E. Woods Digital Image Processing. third edition, Prentice Hall,
2016.

You might also like