COS 426: Computer Graphics Spring 2013
|
|
|
General | Syllabus | Assignments | Final Project
Assignment 1: Image Processing
Part A: C++ programming / HTML / Dropbox
Due Tuesday, Feb. 12, 11:59 PM
The purpose of this part is to ensure that you have a C++ compiler
installed and are familiar with C++, HTML, and Dropbox. Overall, assignment
1 is worth 20 points. Part A is worth 3 of the 20 points.
Task List
-
Download the following skeleton code:
cos426_assignment1.zip.
Read over the FILE STRUCTURE section in 01AREADME.txt to
learn the functions of the different files and directories.
-
Read and follow the instructions in the HOW TO PROCEED section in
01AREADME.txt. For this part of the assignment, you are
required to implement the following methods in R2Image.cpp
(point values in parentheses):
- (1/2) Brightness: Change the brightness of the image. See
Graphica Obscura.
- (1/2) Black & White: Convert to gray levels by replacing each
pixel with its luminance.
- (1/2) Gamma: Apply a
gamma correction
to the image.
- (1/2) Saturation: Change the saturation of an image. See
Graphica Obscura.
- (1/2) Contrast: Change the contrast of an image. See
Graphica Obscura.
- (1/2) Extract Channel: Leave the specified channel intact and set all others
to zero.
Part B: Image Processing
Due Thursday, Feb. 21, 11:59 PM
In this part of the assignment, you will add to the code you submitted for
part A to implement a simple image processing program. This part is worth
17 of the 20 points, with the opportunity for extra credit. 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.
This part will likely take longer than part A, so get started early.
- Linear Filtering Operations
Note: Since all the filters below are
intended to operate on linear pixel values, be sure to undo the image
gamma (by raising values to the power of 2.2) before processing, and
re-apply gamma (by raising values to the power of 1/2.2) afterwards. Use
good coding practices (modularity) and don't re-implement gamma
correction, given that you already implemented it, as specified above.
- (1) Gaussian Blur: Blur an image by convolving it with a Gaussian
low-pass filter.
- (1/3) Sharpen: Apply a linear sharpening filter to the image.
- (1/3) Edge detect: Detect edges in an image by convolving it with an
edge detection kernel.
- (1/3) Motion Blur: Apply a left-right motion blur to the image.
- Non-Linear Filtering Operations
- (1) Median Filter: Remove speckle noise using a median filter of given
width
- (2) Bilateral Filter: Smooth while preserving sharp edges in
the original. See
here.
- Resampling Operations
Note: You must provide code for point, linear, and Gaussian sampling
Clarification: You must implement three sampling methods (point,
bilinear, and Gaussian), which can be controlled by the -sampling
option prior to -scale
, -rotate
, or -fun
.
For Gaussian sampling, choose sensible Gaussian filter dimensionss. For
scaling, this requires adapting the extent of the Gaussian, for rotation
and fun, you may use a fixed size of your choosing.
- (2) Scale: Scale an image up or down by a real valued factor.
- (2) Rotate: Rotate an image by a given angle.
- (2) Fun: Warp an image using a non-linear mapping of your choice
(examples are fisheye, sine, bulge, swirl).
- Dithering Operations
- (1/3) Quantize: Change the number of bits per channel of an image, using
simple rounding.
- (2/3) Random dither: Convert an image to a given number of bits per
channel, using a random threshold.
- (2) Ordered dither: Convert an image to a given number of bits per channel,
using a 4x4 ordered dithering matrix.
- (2) Floyd-Steinberg dither: Convert an image to a given number
of bits per channel, using dithering with error diffusion.
- Miscellaneous
- (1) Composite: Compose one image with a second image using the
over operator, with a third image as a matte (alpha).
- (3) Morph: Use pairs of corresponding lines to morph a source
image into a target image using a morph parameter t. See [Beier92].
Use the provided line correspondence editor
to define the line correspondences.
- (up to 3) Nonphotorealism: Implement any non-trivial painterly filter.
For inspiration, take a look at the effects available in programs like
xv
, PhotoShop, and Image Composer, or
GIMP (e.g., impressionist, charcoal,
stained glass, etc.). The points awarded for this feature will depend on
the creativity and difficulty of the filter. At most one such filter will
receive points.
- (up to 3) Anything else: Implement any non-trivial image processing
algorithm of your own choosing, and we will give you points according to
the difficulty.
By implementing all the required features in Part B, you get 13 points. There are many
ways to get more points:
- implementing the optional features listed above;
- (1) submitting one or more images or movies for the art contest (movies
should be in
.mpeg
, .mov
or .avi
format,
animating the results of one or more filters with continuously varying parameters,
e.g. the morph);
- (2) winning the art contest.
It is possible to get more than 20 points for this assignment including Part A and B. However, implementing more than 4
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 - 4))
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 16
points) to your score on the optional features (up to 7 points, with diminishing
returns past 4).
Submitting
This assignment is due in two parts. Part A is due Tuesday, Feb. 12 at 11:59 PM.
Part B is due Thursday, Feb. 21 at 11:59 PM.
Please see these slides for details about
submitting and the assignments page for details
on the late and collaboration policies.
For each part of the assignment, please submit a single .zip file named
[your NetID]_cos426_assignment1[A or B].zip
containing the starter code with the following modifications:
- your writeup1.html, containing links to all result images
and a description of your implementation;
- your modified src/ and completed /output directory.
Please remove binaries
and object files from the source tree (i.e., leaving only source code).
To do this, run make clean or execute "Clean Solution" from the
build menu in Visual Studio. Make sure all the images can be shown properly in writeup.html
- Put your art contest works in the art/ folder and submit them with Part B.
We will test your code on Linux 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 before submitting. Your Makefile should generate
the images in the output directory that your writeup references.
Note 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.
Submit your assignments here:
part A
part B
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:
- the name of the feature on the top line,
- the input image and output image(s) on a second line,
- text listing the command(s) used to generate the output images on the following
lines, and
- (optionally) comments about what to look for in your output (including possible
problems in the implementation).
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 the main assignment directory to build the code in src/ and create
the output images. Please ensure that your code builds/runs in this way.