In this contest we provide two tools. The first to generate test cases from images, and the second to visualize your solution.
Files
Blur.class -- test generator
Tester.jar -- tester
examples.tar -- examples
contact.html -- thumbnails of more tests
examples.tgz -- NEW updated examples
Test Generator
This program reads an image and produces a number of low resolution, blurred
copies of that image. It places the copies in the same directory as the
original, with "_0", "_1", ... appended to the filename before the prefix. To
use it, simply copy Blur.class to your machine, and run
the following in the directory you downloaded it to.
java -Xmx512M Blur <file> -D <D> -N <N> -SD <SD>
The -D and -N parameters are optional and will be randomly generated based on
the filename if you omit them. Note that this can be very slow for large
images.
Test Runner
As in past contests, you must write a program that communicates its input and
output via stdin and stdout. The parameter N, along with the input parameters
(W, H, retW, retH, D, and input) will
be given to you on standard in, delimited by spaces, with N first followed by
the other parameters in order. The int array, input will simply be given
one element at a time (you know its length as W*H*N). Once you have read your
parameters, your should simply output retW*retH integers,
separated by whitespace (make sure you flush stdout). Anything you print to
standard error will show up in the console.
To run the tool, you should run:
java -Xmx512M -jar Tester.jar
There are a number of optional parameters:
- -exec executable -- specify the executable
- -novis -- run without the visualization
- -D D -- set D
- -width w -- set the window width to w
- -height h -- set the window height to h
- -file f -- set the image file to f
- -debug d -- set the debug level (0(least),1 or 2 (most))
- -go -- start running immediately (requires -exec)
When you start up the program will try to read "example.png" by default (unless
you specify a different file). It will also try to read "example_0.png",
"example_1.png", .... When you run your program, it will pass the parameters
and wait for your return. Once it has received your image, it will attempt to
align your image with the original. Once this is done, your score (relative to
the baseline) will appear in the console. You may toggle your image on and off
with the checkbox. You may also view the difference between your image and the
original once the alignment is finished. You can click and drag to pan the
image, and use the mouse wheel to zoom also.
The parameter for a test are all determined from the sizes of the images. The
only one which you can change is the D parameter. If you didn't specify D while
generating images, or you are testing the examples provided, you need not
specify D in the Tester tool. You only need to specify it if you generated your
own images with your own value of D.
Final Notes
- Java users: if you get something java.lang.NoClassDefFoundError
SuperResolution, it means that you've correctly set the path to Java, but
Java can't find your class. Among other things, you can try setting the
command to something like "PATH1\java -cp PATH2 SuperResolution", where
PATH2 is the location of your class file.
- Please note that, while we will do our best to make the workings of the
visualizer as clear as possible, it is impossible for us to help everyone
debug their code to make it work with the visualization tool. If you do
think you have discovered a bug, please email lbackstrom@topcoder.com or
post the bug to the forums. The more details you provide, the more likely
you are to be helped quickly. Please to NOT post code to the forums, as that
is against the rules, and you will be disqualified.