CSC 520
Digital Image Processing
Programming Assignment 01
Programming Instructions:The student will select a programming language of his/her choice. The language selected should be maintained throughout the course. All code will include proper programming structure for the language selected. The code will have copious comments.
Objective: Read, write and display Portable Graymap (PGM) images.
The PGM format that you will implement is for P2 (plain) and P5. Example of P2 format:
P2
# feep.pgm
24 7
15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
There is a newline character at the end of each of these lines.
Additonal information on the pgm format may be obtained here: http://netpbm.sourceforge.net/doc/pgm.html http://linux.about.com/library/cmd/blcmdl5_pgm.htm
Evaluation images for your system: starP2.pgm and starP5.pgm