Image processing problems, Exercises of Digital Image Processing

This document introduces problems in various image processing topics

Typology: Exercises

2019/2020
On special offer
30 Points
Discount

Limited-time offer


Uploaded on 03/03/2020

zahyung-v-lover
zahyung-v-lover 🇮🇶

5

(1)

4 documents

1 / 22

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
IMAGE PROCESSING (RRY025)
Problems
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
Discount

On special offer

Partial preview of the text

Download Image processing problems and more Exercises Digital Image Processing in PDF only on Docsity!

IMAGE PROCESSING (RRY025)

Problems

A IMAGE ENHANCEMENT PROBLEMS

  1. An image has the gray level Probability Distribution Function (PDF - or gray level his- togram normalised by number of pixels) of Pr(r) shown below left.

1 1

(^2 )

r (^) z

Pr(r) (^) Pz(z)

a) Find the pixel transformation y = g(r) such that after transformation the image has a flat PDF, i.e. which accomplishes histogram equalisation. Assume continuous variables r,y.

b) It is desired to find a transformation z = f (r) such that the transformed image will have the PDF of Pz (z) shown above right. Assume continuous quantities and determine the transformation function z = f (r).

  1. a) Two images have the same histogram. Which of the following properties must they have in common? (i) Same total power (sum of squares of pixel values) (ii) Same Entropy (sum of I ln I over all pixel values) (iii) Same degree of pixel to pixel correlation?

b) Do histogram equalisation on the following image which has 8 discrete pixel levels (0 - 7), transforming it into a histogram equalised image also with 8 discrete grey levels in the range (0-7).

1 1 1 1 1 1 1 1 0 2 5 5 5 5 2 0 0 3 2 6 7 2 3 0 0 3 3 2 2 3 3 0 0 2 3 2 2 3 3 0 0 3 2 4 4 2 4 0 0 2 6 4 4 4 2 0 1 1 1 1 1 1 1 1

b) Histogram equalisation is applied to the coin image below (A) and the result is the image (B). Why does the image look so bad, with few details visible on the coin?

c) A different algorithm is applied to (A) and produces the image (C) which enhances both the background and the coin. Describe in detail how would write such an algorithm. (Hint: Use the image histogram to select parts of the image on and off the coin).

A−Original Image B−Histogram Equalised

C−After applying algorithm

Fig 2. Image enhancement of coin image.

  1. Consider the Image ’I’ below and the filters ’F’ and ’L’

’I’ ’F’ ’L’

a) Correlate the image ’I’ with the filter ’F’ above and compute the output image (assume ’same’ correlation with zeros outside the input image and round down the output pixel values to the nearest integer)

b) Apply a 3 by 3 median filter to the same image ’I’ to produce an 3 by 3 output image, again assume zeros outside of the image.

c) The result in part b demonstrates one general advantage and one general disadvantage of the median filter as compared to the mean filter.

d) Show that correlating the Laplace operator ’L’ with the image ’I’ is equivalent (except for a proportional factor) to locally subtracting a five point local mean from each original value of the image.

  1. Consider the images shown below (A to H). Using knowledge of symmetry properties and the convolution theorem (not exact calculation of the Fourier integrals), list which images or image which have Fourier transforms, F(u,v) with the following properties.

i) The imaginary part of F(u,v) is zero at all u,v

ii) F(u,v) is purely real and positive for all u,v.

iii) F(0,0) = 0

iv) F(u,v) has circular symmetry

v) The real part of F(u,v) is zero at all u,v

x

y

x

y

x

y

x

y

x

y

x

y

x

y

x

y

x

y

 

+1 (^) -

+1 (^) +1 +

Delta Function -

A B C

D E F

G H

Notes Unless otherwise stated the shaded regions have value +1 and outside the shapes the value is 0. Image B - is the convolution of A with itself. Images E and H have regions of negative intensity. Image G is a delta function of unit area at x = xxo.

  1. If a continuous image is Nyquist sampled the discrete version contains all information about the original image, such that the original continuous image can be reconstructed perfectly by low pass imaging. On the other hand if the sampling is not sufficiently dense aliasing occurs and when we attempt to reconstruct we can obtain a completely different continuous image. The following problem illustrated these points.

Consider an input image given by the two dimensional function

f (x, y) = 2cos[2π(4x + 6y)]

which is sampled on an infinite grid of pixels with separation ∆x = 0.1 and ∆y = 0.2, in the x and y directions respectively. Note that this is less dense than required by Nyquist sampling. Consider that we anyway try to reconstruct the original continuous image from the above sampled version. To do this we form the continuous FT of the sampled image; multiply by an ideal low pass spatial filter with cutoff frequencies at half the sampling frequency in each spatial frequency axis and then inverse Fourier transform. Show in your answer what is obtained at each step in the above process, specifically;

a) Draw with labelled axes the Fourier transform of the sampled image (Hint 1; make use of the 2D sampling function (’bed of nails’) and the convolution theorem. Hint 2; the FT of exp(− 2 πi(Ax + By)) is δ(u − A, v − B), i.e. a Dirac delta function in the Fourier domain centred on the position u = A and v = B.

b) Give the Fourier transform after it has been low-pass filtered.

c) Show that the reconstructed continuous image is given by the mathematical function 2 cos[2π(4x + y)].

d) In order to reconstruct without distortion the original image from sampled data what is the maximum sizes of ∆x and ∆y that can be used and the size of the low pass filter?

  1. Below are shown a series of images (1-6) and the log amplitudes of their Discrete Fourier transforms (A-F). Match the correct transform to each image. Give a one sentence reason for each match. Note the DFT of image 1 is hard to match so concentrate on the other images first.

Image 1 Image 2 Image 3

Image 4 Image 5 Image 6

FT Log Amp A FT Log Amp B FT Log Amp C

FT Log Amp D FT Log Amp E FT Log Amp F

C) HUMAN VISION

1a) Make a sketch of the Modulation Transform Function of the human vision system; that is a plot of the contrast sensitivity versus spatial frequency (spatial frequency filter shape).

b) The figure below illustrates the Mach band effect. Describe what the Mach band effect is and how it is explained in terms of the human MTF.

c) A magazine wishes to publish the above figure so that each gray band appears to the reader to have uniform brightness. Describe how you would process the raw image above to achieve this effect.

  1. a) The figure on the next page shows how ’Lateral Inhibition’ and other properties of the eye effects the spatial frequencies that are passed onto the brain. Beyond 20 cycles/degree there is a sharp cutoff, so that the information passed to the brain is effectively band-limited. This property is used by some image compression algorithms to allow significant compression without loss of apparent image quality.

D) COSINE AND WAVELET TRANSFORMS

  1. a) An image is to be compressed by a transform method and as a first step the image is Cosine transformed. Why does the Cosine transform concentrate more power into fewer components than the DFT?

b) The 1-D Cosine transform of a length N sequence f(x) is defined to be;

C(u) = α(u)

N∑ − 1

x=

f (x)cos[(2x + 1)uπ/ 2 N ]

where we choose α(u) =

√ 1 /N for u = 0 and α(u) =

√ 2 /N for u 6 = 0 to give a symmetrical form to the inverse cosine transform..

You wish to do a 1-D Cosine transform in a software package which only has the capability to do Discrete Fourier Transforms, carefully describe each of the steps needed to implement it.

  1. Carry out a 2D Haar wavelet transform of the 4x4 letter ’O’ image given above, using the functions below for forming Approximation, Horizontal details, Vertical details and Diagonal details. Give the 4x4 image which is the level 1 wavelet transform.

Aprox V-Details H-Details D-Details

0.25 0.25 0.25 -0.25 0.25 0.25 0.25 -0.

0.25 0.25 0.25 -0.25 -0.25 -0.25 -0.25 0.

d) Show that the level 2 wavelet transform equals the image given below.

’Haar Level 2 Wavelet Transform’

  1. a) An image compression algorithm such as JPEG uses uses ’block transforms’, what are these? Show that if each block is transformed by a ’fast’ algorithm such as the Fast Fourier Transform or Fast Cosine Transform that a 8x8 block transform of a 512x512 pixel image is almost exactly 3 times faster than transforming the whole image directly.

b) As the block size is decreased the transform becomes faster, what therefore sets the limit for the smallest useful block size for image compression? If the correlation coefficient between adjacent pixels is ρ = 0.9, why is the choice of 8 for the block size a good one?

c) Why in general does the Discrete Cosine Transform for each block produce a slightly higher degree of compression than using the Discrete Fourier Transform?

4 a) Describe the difference between lossy and non-lossy image compression. Mention one application of each type of compression

b) In Pulse Code Modulation (PCM) each pixel value of an image with a value between 0 and 127 is transmitted as a fixed length 7 bit binary number. Such an image is compressed by instead transmitting the difference between adjacent pixels on a line, the total range of differences that must be transmitted is between -127 and +127, yet it is possible to transmit a particular image without loss of information using an average of only 4.3 bits/pixel. How is this achieved? Why in general can the sequence of pixel differences in an image be compressed more than the raw pixel values?

c) To achieve even higher compression (i.e 2 bit/pixel) a lossy compression scheme is used in which differences between pixels are re-quantised before being transmitted using the schematic and quantiser illustrated below and the predictor rule u(n) = u(n − 1).

For the following input sequence u(n) = 101, 110 , 107 , 108 , 105 , 102 what is the output se- quence u′(n)? Assume the first pixel value is transmitted directly without error so that u′(1) = u(1)). Tabulate the values of u(n), u(n), e(n), e′(n) and u′(n), for each n.

PredictorPredictor

Quantiser

Predictor

Transmitter Receiver

u(n) (^) e(n)

u(n)-

e’(n) (^) u’(n)

e’(n)

-6 -5 -4 -3 -2 -1 1 2 3 4 5 6

1

2

3

4

5

6

e(n)

d) A DPCM system using the same quantiser and predictor rule can significantly reduce the errors in transmission while maintaining the same transmission rate of 2bit/pixel. What would the output sequence be using such a system for the input sequence given in c)?

F) IMAGE RESTORATION PROBLEMS

  1. An input image g(x, y) is blurred by convolution by a blurring function h(x, y) and then has random noise n(x, y) added. Give a mathematical expression for the resulting image f (x, y). Describe how to restore the image using the Inverse Fourier filter, i.e. how to estimate g(x, y) given f (x, y) and knowing h(x, y). Give an expression for the noise distribution n′(x, y) in the restored image.

b) An alternative restoration filter is the Wiener Fourier filter. Give the mathematical ex- pression for this filter as a function of spatial frequency, carefully defining all the quantities. Name one advantage and two disadvantages of the Weiner filter over the Inverse filter.

c) A weather satellite is launched into geostationary orbit so it looks down over the same part of the Earth. Unfortunately after launch it is found to be rapidly spinning on its axis so that images taken with even the shortest exposure are rotationally blurred. Describe a system to restore the images and save the mission.

  1. State for the following image distortions whether the distortion is linear or non-linear and whether the point spread function is space-invariant or not.

i) A photograph taken through the front window of a car moving at constant velocity on a flat road. ii) A telephoto image of a distant object taken out of the side window of a jeep moving on a bumpy dirt road. iii) A image of one of Saturns moons taken from an accelerating space probe, where the velocity and acceleration vectors are parallel to each other and perpendicular to to vector between space probe and moon. iv) A photograph taken by a digital camera with a maximum readout value so that all pixels greater than Io in I(x, y) equal Io in I′(x, y). v) An image effected by multiplicative noise so that I′(x, y) = I(x, y)n(x, y) where the ele- ments of n(x, y) are drawn from a random distribution. vi) An image rotated 180◦.

  1. A sampled image I(m,n) is distorted by convolution with either the space invariant point functions h 1 or the function h 2 where.

h 1 = δ(m, n) + δ(m − 1 , n) + δ(m + 1, n) + δ(m, n − 1) + δ(m, n + 1)

and h 2 = 5δ(m, n) + δ(m − 1 , n) + δ(m + 1, n) + δ(m, n − 1) + δ(m, n + 1)

What are the ’Optical Transfer Functions’ of these two convolving functions?. Assuming that the distorted images also contain random additive noise then in one image the distortion can be effectively removed using an Inverse Fourier filter, while the other requires the Pseudo- Inverse filter. Which image must use the Pseudo Inverse filter and why?

  1. A particular image is drawn from a set of images having spectral power density S(u,v). This image has been distorted by convolution, described by multiplication of the image Fourier transform by the Optical Transfer Function H(u,v). White noise is also added with spectral density N(u,v). S(u,0), N(u,0) and H(u,0) are shown in the figure below. Sketch on a copy of this figure the inverse and Wiener filter to be applied in order to restore the image.

S(u,0) N(u,0) (^) H(u,0)

-u (^) +u +u +u

  1. Consider the problem of restoring images blurred by image motion.

a) Consider an image moving at a speed s past a camera whose exposure time is ∆t. What is the Point Spread Function, and the Optical Transfer Function? Why is the Inverse Fourier filter unsuitable for restoring this image if there is any additive random noise?

b) Calculate the appropriate Wiener filter to apply to the above problem. Assume that the additive noise in the Fourier domain is white with power spectral density s∆t while typical undistorted images have power spectral density 1/u where u is the spatial frequency. What is the Wiener filter value at u = 1/(s∆t)?

c) Consider a camera taking a picture of the front of a house out of a car side window. If the car is at rest at the start of an exposure of length ∆t but accelerates so that x(t) = at^2 /2, what is the Point Spread Function in the distorted image? The resulting Optical Transfer function differs in two important ways from the one obtained in the case of uniform motion, what are they?

d) A photograph is taken out of a side window of a car driving at a constant 40km/hour down Gibraltargatan towards Chalmers. Why in general is it not possible to use Inverse or Wiener filters to restore the blurring in this image?