Complete by Class 2
Computer Accounts
Get a WPI computer account at the CCC workstation room at the top of the main stiars in Fuller Labs or by e-mail to system@wpi.edu.
Get a CS account by e-mail to system@cs.wpi.edu. Be sure you've arranged the WPI account first since your login name and password will be duplicated. Afterwards, you can change your two passwords independently - just use the UNIX passwd command.
Image Processing Program Shell
Write a program (or programs) which reads an image, processes it, and writes an output image file. Prompt the user for the input/output file names. Use C, C++, or Java and use the standard file format. Hand in your program(s) in class.
Solution
This is only one possible solution. Mileage may vary.
See the new and improved software utilities in the software library The program consists of the following common modules. The software is available by following the links below:
img.h
the usual definitions. This is used in all
other program files.
img.c
- utility functions for managing image structs
and functions for reading and writing image files in the standard
format.
Note: gif
versions of the images are here.
There are four versions of main()
, corresponding to the
four programming assignments.
hw01a.c
- rotate an image 90° clockwise hw01b.c
- invert an image hw01c.c
- blur an image using averaging in a 2x2 pixel
neighborhood hw01d.c
- reduce image size to half using averaging in
a 2x2 pixel neighborhood The image leonardo1 was used in all four examples, but the code works properly with grayscale images, too.
Note that these are classical C
programs except that structs
are used for images. That makes it straightforward to transform this code
into C++
.