Digital Image Processing

Homework 1, Due 2010/3/23

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.

Fig2.21(a).bmp

 

 

Problem 2

Zooming and Shrinking Images by Bilinear Interpolation (or linear interpolation in x or in y)

(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.

Fig2.19(a).bmp

 

ftp your homework to

ftp://nukcsie@140.127.208.168/

in the directory \HW1

by the following format:

檔案名稱:hw#_學號.zip

例如:資工同學,作業4

    檔案名稱:hw4_a09755xx.zip.  (注意:檔案名稱不能有中文)

The password is given in class.