COS 426 - Computer Graphics

Spring 2012

Course home Outline and lecture notes Assignments


Assignment 1: Image Processing

Due Thursday, Feb. 23, 11:59 PM

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

Download the following skeleton code: cos426_assignment1.zip. Read over 00README.txt to learn the functions of the different files and directories.

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.jpg by 10%, and save the result in the image out.jpg, you would type:

% imgpro in.jpg out.jpg -brightness 1.1

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.jpg out.jpg -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. 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 14 points. There are many ways to get more points:

It is possible to get more than 20 points. However, implementing more than 6 points worth of non-required features incurs diminishing returns: each successive point is worth 3/4 as much as the previous one. Thus, the adjusted extra credit score is computed according to the following formula:

extra credit = 3 * (1 - pow(0.75, points - 6))

Extra credit points cannot replace the required features (bold items). Your final score will be calculated by adding your score on the required features (up to 14 points) to your score on the optional features (up to 9 points, with diminishing returns past 6).


Submitting

This assignment is due Thursday, February 23, 2012 at 11:59 PM. Please see the general notes on submitting your assignments, or the same notes explained in slides, as well as the late policy and the collaboration policy.

Please submit a single .zip file named [your NetID]_cos426_assignment1.zip containing

The Dropbox link to submit your assignment is here.

writeup.html should be an HTML document demonstrating the effects of the features you have implemented. For some features (e.g., black & white), you can simply show the input and output of your program. However, for features that take an input parameter (e.g., blur), you should provide a series of images showing at least three settings of the input parameter to demonstrate that your code is working properly. You can start from the skeleton writeup.html provided with the distribution as a template -- simply add sections to that HTML file for the features you implement in the following format:

We remind you that you are expected to use good programming style at all times, including meaningful variable names, a comment or three describing what the code is doing, etc. We will test your code by running make in your src/ subdirectory, followed by make in the main assignment directory to create the output images. Please ensure that your code builds/runs in this way.


Last update 9-Feb-2012 11:44:58
smr at princeton edu