EE 289

Homework Assignment 10
Due Dec. 9, 2010

  1. Compare the solution times for the MATLAB and the C versions of your gridsearch programs. Which is faster, and by how much?
  2. Write a MATLAB or C program to embed the image airfield.pnm into the image Renoir.ppm, and another program to extract the airfield.pnm image from the modified Renoir.ppm. It should be difficult to distinguish between the Renoir.ppm image with and without the embedded airfield.

    For information of the format of PPM and PNM files, use a web resource such as http://en.wikipedia.org/wiki/Netpbm_format

    Note that the airfield.ppm image is a grayscale with 256 gray levels. However, only 16 of these levels are used, so the first thing to do is to map the 16 used levels into a four-bit index.

    If you decide to use MATLAB, you can use the functions imread() and iimwrite() to read and write the images. You can use the functions bitand() and bitor() to do bit manipulations. It will probably be easier to write the programs in C.