ECE 563 Assignment 2
Images for this assignment may be downloaded from
impro2.zip.
- Generate a grayscale image of the function sinc(x)^4 * sinc(y)^4 over the domain
-10 < (x, y) < 10 and scale the pixel values logarithmically to show the secondary maxima
(see example).
- Do problems 2.11 through 2.17 from the textbook.
- Do problems 9.1 through 9.10 from the textbook.
- Use morphological erosion to remove the teeth in the image
gear_tooth.jpg. Vary the size of the structuring element. For
each case show the number of erosions used and the final images.
Measure the percentage of pixels removed compared to the original
image.
- Use morphological operations and the connected-components Matlab functions to find the number
of dowel rods in
dowels.tif.

- Derive formulas for the mean and standard deviation of a uniform [0..1] random image.
Compare these results to the measured mean and standard deviation for the uniform random image
from the first assignment.
- Calculate the entropy H of several grayscale images, including the
uniform random image generated on the first assignment. Entropy is defined as

where M is the number of gray levels and pk is the
probability associated with gray level k.
Note that a base-2 logarithm is used conventionally.
See the file entropy.m in the handout. See p 424-426 of the
textbook.
- Take a grayscale image and calculate its entropy. Now mask off successive
bits, starting from the least significant and plot the entropy as a function of
bits in the image.
A bit mask of the upper 6 bits can be generated from
mask = uint8(hex2dec('fc'));
out = bitand(inp,mask);
where inp is the input image and out is the output image.
The input should be uint8.
The sequence of masks should be hex 'fe' (7 bits), 'fc' (6 bits),
'f8' (5 bits), 'f0' (4 bits), etc. You might also try the masking in reverse
order, which ties into the next exercise.
- Take a grayscale image and calculate the entropy associated with each
bitplane. A bitplane is generated by masking with a single bit, e.g. hex '20'.
Plot the entropy vs. bitplane index.
Maintained by John Loomis,
last updated 12 Jan 2004