CS 242 Fall 2009 : Assignment 5 Summary

This page last changed on Oct 03, 2008 by cramach2.

Summary of the Assignment:

We have given you a zipped file containing four BMP files(1 Lena BMP, 2 Photos taken by me in NY, and a photo given by a student) and 4 Kernel files. All are in grayscale, and have the same dimensions, DPI and size as the original Lena512 file that you had for assignments 1 to 4.

Create a Makefile to do the following tasks. In class, and to some of my students I would have mentioned that you have to write a C/C++ program to create the makefile. Ignore that;In retrospect it sounds impractical of me to assume that anyone in the real world would want to write a program to create a makefile.

Create your Makefile as you have usually being doing in this class and in your previous classes.

1. Unzip the given zipped file and create four sub-directories. The unzipping process should place 1 BMP and 1 kernel file in each sub-directory.

2. In each sub-directory, you have to run your Image convolution program using the BMP and kernel file present in that sub-directory. You have to run the following mentioned kernels on each sub-directory:

         a) Directory 1 – Emboss Filter

         b) Directory 2 – Mean Filter
     
         c) Directory 3 – Gaussian Filter
 
         d) Directory 4 – Laplacian Filter  

3. Store the output of the Image Convolution program for each sub-directory in that sub-directory itself.

4. After performing the Image convolution, all the other files except the convoluted BMP file should be cleaned from that sub-directory.

NOTE:

The catch here is that not all Kernel files are complete. Some kernel files have only 1 or 2 kernels, while some have all. You can check this out manually by unzipping our file.

Your Makefile should find a way to automatically search for the right kernel in a different subdirectory if it is not present in the current one. We DO NOT want you to say “cd <directory name>” and proceed. Instead what we want you to do is to create dependencies in your MAkefile which will enable your Make program to automatically search in other directories.

For example, after unzipping, say the following four folders (along with the BMP and Kernel) files are created:

Folder A: BMP1.bmp kernel1.xml

Folder B: BMP2.bmp kernel2.xml

Folder C: BMP3.bmp kernel3.xml

Folder D: BMP4.bmp kernel4.xml

Say you have to run your Image Convolution program (called as Convolute) with the Mean filter on Folder B. But according to Kernel2.xml, it doesnt contain the specification for the mean filter. So your Makefile should automatically search for the Mean Filter in Kernel1.xml, Kernel3.xml and Kernel4.xml. Say the Mean filter is found in Kernel1.xml. Then your Makefile should use the specification of the mean filter from kernel1.xml and use that along with BMP2.bmp for the ‘Convolute’ Program. The output – say ‘out.bmp’should be stored in Folder B. After performing this task, Folder B should be cleaned up, and only out.bmp should remain in it.

Document generated by Confluence on Feb 22, 2012 18:18

  1. No comments yet.

  1. No trackbacks yet.