cos426.jpg (39279 bytes)

Computer Graphics, Spring 2008

Assignment 1: Image Processing

Due on Wednesday, Feb 20 at 11:59 PM

Art Contest Results


In this assignment you will create a simple image processing program. The operations that you implement will mostly be filters that take an input image, process the image, and produce an output image.

Getting Started

You should use the following skeleton code ( as a starting point for your assignment. We provide you with several files, but you should mainly change R2Image.cpp. We provide several test images with the skeleton code, however any JPEG, PPM, or 24-bit BMP image should work.

After you copy the provided files to your directory, the first thing to do is compile the program. If you are developing on a Windows machine and have Visual Studio .NET 2005 installed, use the provided project files to build the program. If you are developing on a Mac machine, type make in the assignment1 directory. In either case, an executable called imgpro (or imgpro.exe ) will be created.

Please use either the Visual Studio 2005 or Macintosh make build environments.

How the Program Works

The user interface for this assignment was kept as simple as possible, so you can concentrate on the image processing issues. The program runs on the command line. It reads an image from a file (the first program argument) and writes an image to a file (the second program argument). In between, it processes the image using the filters specified by subsequent command line arguments. For example, to increase the brightness of the image in.bmp by 10%, and save the result in the image out.bmp, you would type:
% imgpro in.bmp out.bmp -brightness 1.1
The brightness filter has already been implemented in R2Image, so you can use the above command line for testing.

For each available image filter there may be one or more optional parameters (e.g., brightness takes a factor). To see the complete list of filters and their parameters, type:
% imgpro -help
If you specify more than one filter on the command line, they are applied in the order that they are found. For example,
% imgpro in.bmp out.bmp -contrast 0.8 -scale 0.5 0.5
would first decrease the contrast of the input image by 20%, and then scale down the result by 50% in both x and y directions. Of course, you are welcome to create your own filters and add program arguments for them by editing imgpro.cpp. However, please do not change the program arguments for the filters already provided.

What You Have to Do

The assignment is worth 20 points. The following is a list of features that you may implement (listed roughly from easiest to hardest). The number in front of the feature corresponds to how many points the feature is worth. The features in bold face are required. The other ones are optional. For each group of features (e.g., Per-pixel Operations), a minimum and maximum number of possible points is listed -- you will only get credit for features implemented within each section up to the maximum listed. Refer to the examples web page for more details on the implementation of each filter and example output images.

By implementing all the required features, you get 10 points. There are many ways to get more points:

For images or movies that you submit, you also have to submit the sequence of commands used to created them, otherwise they will not be considered valid.

It is possible to get more than 20 points. However, after 20 points, each point is divided by 2, and after 22 points, each point is divided by 4. If your raw score is 19, your final score will be 19. If the raw score is 23, you'll get 21.25. For a raw score of 26, you'll get 22.

Extra credit points cannot replace the required features (bold items). Your final score will be calculated by adding 10 to the number of extra credit points you achieve, applying the above formula for diminishing returns, and then subtracting the number of required points that you missed.

What to Submit

You should submit one archive (zip or tar file) containing:

The writeup should be a HTML document called assignment1.html which may include other documents or pictures. It should be brief, describing what you have implemented, what works and what doesn't, how you created the composite image, how you created the art contest images, and instructions on how to run the fun filters you have implemented.

We will not attempt to grade assignments which do not build in Visual Studio 2005 or Mac OS X.

NOTE: Please convert your art contest and writeup images to JPEG format before submitting them (to save space). You can use your program with no filters to do the conversion (e.g., imgpro in.bmp out.jpg).

Should you choose to create a video of your morph there are many options for video encoders available, however we have found that FFMPEG works well and runs on both Windows and linux. MEncoder is another option.

Always remember the late policy and the collaboration policy.


A few hints: