CS465 Program 2: Resample
watch this space for additional helpful material.
FAQ
- 3:45 pm, 19 September 2004: How do we extract the radius in from the GUI
when applying the filter?
A: Take a look at the JTextField reference in the Filter class. It
should be fairly easy to read and parse the text field for the radius information.
- 4:45 pm, 19 September 2004: Exactly what values should we be using for the gaussian
filter?
A: Take a look at the revised handout. That should clear some things up.
- 6:45 pm, 19 September 2004: I noticed a bug in how the height and width values are read
from the GUI widgets...
A: Grab the new code. That should fix the problem. There should also
be a few more empty filter classes, making the code line up with the handout.
- 9:30 pm, 21 September 2004: I'm a bit confused on how the Gaussian should work...
A: Check out the new handout (version 3). It has more details on exactly how we want you to
implement the filter.
- 9:30 pm, 21 September 2004: It seems there are some filters with free parameters, but
without GUI widgets to grab them from the user. How do we manipulate these parameters?
A:
Look at the constructor for the basic Filter
class. You will need to do something similar in the
constructor of each class that requires free parameter input. The two in particular are the Gaussian and the
sharpening filter.
- 12:30 am, 23 September 2004: There seems to be a conflict in the due date between what the
handout says and whats on the schedule. Which is right?
A: The due date is September 30,
and the handout has been corrected.
- 12:30 am, 23 September 2004: I like tie-dyed clothing as much as the next person, but why
do my colors look psychadelic?
A: The colors are bit packed into a single integer. Each
int
in the SimpleImage
class represents all 3 color channels. The low 8 bits represent
the blue channel, the next 8 form the green channel, and the 3 set of 8 form the red channel. The high 8 bits
are unused by us, but are often used to hold the alpha channel. See ray1.Color#toInt()
or
resample.filters.Filter#toInt()
as a method of packing the bits. The unpacking procedure is similar.
- 4:30 pm, 23 September 2004: More test images have been posted. Have a look.
- 11:00 pm, 26 September 2004: A new version of the
sampling and reconstruction notes
has been posted. It corrects the missing minus sign in the B-spline
equation that was noted in the FAQ for Homework 3, which also propagated
into the Mitchell-Netravali equation; a misplaced parenthesis in the
Catmull-Rom equation that also carried over to the M-N equation; and one or
two typos elsewhere.
- 8:30 pm, 27 September 2004: I'm still confused about what exactly we need to do for
the Gauss filter. Do we use sigma and radius? Do we use a cutoff and sigma?
A: If the
instructions in the handout make sense to you right now, then stick with what you've got. Otherwise, the Gauss
filter should have 2 free parameters: radius and sigma. The radius serves to tell you how many pixels your filter
will touch for each convolution. The Gaussian function will be evaluated at radius/sigma
,
(radius - 1)/sigma
, ..., -radius/sigma
.
- 8:45 pm, 27 September 2004: I dont understand how to get these free parameters into my
Gauss and Unsharp filter.
A: Take a look at the Filter
class's only constructor.
You'll have to modify the code there, and place the resultant block of code in the constructor for the 2 Gauss
and 1 Unsharp filter constructors. The design is such that each filter has a JPanel
inside of it so
that the user can alter the necessary parameters. It is up to you to extract those parameters during each invocation
of the apply
method. Some hints: each Gauss filter has 2 free parameters, sigma and radius, and should
have two input boxes. Unsharp has 3 free parameters - radius and sigma for the underlying Gauss filter plus alpha
for the blending. Feel free to replace the JSlider
with a JTextField
for changing the
alpha parameter of the unsharp mask.
- 7:15 pm, 30 Septemeber 2004: My MN filter results still look very different from what is
posted on the web.
A: <sigh>... take a look at the new image. I found a bug in the
solution code.
Resampled Image Samples
(posted 9/27/2004, 2:45 pm)
- Office Scene, linear filtered, radius 4 here
- Office Scene, gauss filtered, radius 3, sigma 2 here
- Office Scene, unsharp filtered, alpha 2.5, radius 3, sigma 3 here
- Star Target, linear resampled, width 0.5, height 0.5 here
- CS465 Text, Mitchell-Netravali resampled, width 10, height 10 here
Cornell CS465 Fall 2004 (cs465-staff-l@cs.cornell.edu)