Assignment (2)

Image Processing Spring 2001

Due : Friday Feb. 2

 

We have discussed most of the issues related to lab (2). Please complete the lab as your next assignment. Please follow the direction given below to create the necessary files and to go through the special procedure given for submission of your results.

 

Under your main directory create a directory called, ImgProc

% mkdir ImgProc

% chmod 755 ImgProc

% cd ImgProc

 

Copy your code and the two images here and do all your work in this directory. Once your code is completed run using the procedure given below:

 

Part (1): Sampling:

 

Input : mona.pgm

OUTPUT:

for reduction by 2: mona2.pgm (note 2 in row 2 in column total 4)

reduction by 4: mona4.pgm

reduction by 8: mona8.pgm

reduction by 16: mona16.pgm

 

Input: sl00.pgm

OUTPUT:

for reduction by 2: sl002.pgm (note 2 in row 2 in column total 4)

reduction by 4: sl004.pgm

reduction by 8: sl008.pgm

reduction by 16: sl0016.pgm

==========================================================

Part (2) - Quantization:

Input: mona.pgm

OUTPUT:

for reduction by 2: mona2q.pgm

reduction by 4: mona4q.pgm

reduction by 8: mona8q.pgm

reduction by 16: mona16q.pgm

reduction by 32: mona32q.pgm

reduction by 64: mona64q.pgm

reduction by 128: mona128q.pgm

 

Input: sl00.pgm

OUTPUT:

for reduction by 2: sl002q.pgm

reduction by 4: sl004q.pgm

reduction by 8: sl008q.pgm

reduction by 16: sl0016q.pgm

reduction by 32: sl0032q.pgm

reduction by 64: sl0064q.pgm

reduction by 128: sl00128q.pgm

 

Please make sure that these are the only files you have in that directory. You also need to have your code and the two original images there. That makes the total number of files 25.

 

Once you are done with this part, type:

% cd .. (to go down one step)

% tar cvf lab2.tar ImgProc

 

This creates a tar file called; lab2.tar. Type:

% ls -la

make sure you have the file and that the file is not empty (size is not 0).

 

We want to compress this file more, that makes it easier for transfer.

We use gzip compression command. Use man gzip if you want to know what

kind of compression is used.

 

% gzip lab2.tar

 

This creates a file lab2.tar.z (or .Z).

 

Make sure you have the file. Now you can submit this file using the following command.

 

% ~rt/bin/submitImg lab2 lab2.tar.z

 

You should get a message that your submission was successful.

 

Now that you have submitted the file and you also have a compressed file, please go to the directory ImgProc and delete the .pgm files that you had created. This save a lot of disk space. You have the .tar.z file for just inn case you need the files again and you can decompress and untar to get all of them back.

 

ONCE AGAIN, SEE THE EXAMPLES THAT I HAVE GIVEN IN CLASS TO COMPLETE THE CODE.