Digital Image Processing
Homework 1, Due 2015/3/25
Problem 1
Reducing the Number of Gray Levels in an Image
(a) Write a computer program capable of reducing the number of gray levels in a
image from 256 to 2, in integer powers of 2. The desired number of gray levels
needs to be a variable input to your program.
(b) Download Fig. 2.21(a) and duplicate the results shown in Fig. 2.21 of the book.
Problem 2
Zooming and Shrinking Images by Bilinear Interpolation
(a) Write a computer program capable of zooming and shrinking an image by
bilinear interpolation. The input to your program is the desired size of the resulting
image in the horizontal and vertical direction. You may ignore aliasing effects.
(b) Download Fig. 2.19(a) and use your program to shrink this image from 1024 x
1024 to 256 x 256 pixels.
(c) Use your program to zoom the image in (b) back to 1024 x 1024. Explain the
reasons for their differences.
Upload your homework to e起來-高大教學平台 .