HW #2

ECE 178 WINTER 2003

DUE: January 24, 2003

READING: Chapter 2.5

* You do not need to submit solutions for problems marked with *. Clearly state any assumptions you make in solving the problems.

1. Problem 2.11*

2. Problem 2.15*

3. Problem 2.19

4. Show that there are only three regular polygons with which the plane can be tiled, namely (a) the equilateral triangle, (b) the square, and (c) the hexagon. By tiling we mean covering without gaps or overlapping.

5. Compute the linear convolution of the following two signals X and h. (underline indicates the origin)

(a)

  

 

(b) X = [1 2 3], h = [4 5 6]

(c)

 

6. This is programming assignment. You may work with other students (in groups of no more than 4 students per group) on this MATLAB assignment but you are required submit your own individual reports (and indicate the group members in your report).

This MATLAB project is from the text book web site, http://www.imageprocessingbook.com/teaching/laboratory_projects.htm, and is copied here for convenience. The following corresponds to Project 02-01 on the text web.

Image Printing Program Based on Halftoning 

The following figure shows ten shades of gray approximated by dot patterns.  Each gray level is represented by a 3 x 3 pattern of black and white dots.  A 3 x 3 area full of black dots is the approximation to gray-level black, or 0.  Similarly, a 3 x 3 area of white dots represents gray level 9, or white.  The other dot patterns are approximations to gray levels in between these two extremes.  A gray-level printing scheme based on dots patterns such as these is called "halftoning."  Note that each pixel in an input image will correspond to 3 x 3 pixels on the printed image, so spatial resolution will be reduced to 33% of the original in both the vertical and horizontal direction.  Size scaling as required in (a) may further reduce resolution, depending on the size of the input image.

(a) Write a halftoning computer program for printing gray-scale images based on the dot patterns just discussed.  Your program must be able to scale the size of an input image so that it does not exceed the area available in a sheet of size 8.5 x 11 inches (21.6 x 27.9 cm).  Your program must also scale the gray levels of the input image to span the full halftoning range.

(b) Write a program to generate a test pattern image consisting of a gray scale wedge of size 256 x 256, whose first column is all 0's, the next column is all 1's, and so on, with the last column being 255's.  Print this image using your gray-scale printing program.

(c) Print book Figs. 2.22(a) through (c) using your gray-scale printing program.  Do your results agree with the conclusions arrived at in the text in pgs. 61-62 and Fig. 2.23?  Explain. You will need to download Figs. 2.22(a) through (c).