CISC 829 - Homework 3 Programming Assignment

Bryan Youse, Yuqi Wang, Christopher Thorpe

Brief description of solution in (hopefully) plain language:
Our solution uses both OpenCV and OpenGL for rendering. First, it uses OpenCV to read in an image file and display it in its original state (fully supporting at least .PNG and .JPG images, to name a few). While this is displayed, points are randomly sampled from the image (an appropriate amount based on the percentage passed in) and treated as height values. After a key is pressed, OpenCV is again used to create a Delaunay triangulation of these points. OpenGL is then used to (with GLUT) create a new window containing a rasterization of these triangles, creating a second visualization of the original image. If the user then hits the 's' key, loop subdivision is performed on the fly using the original triangulation, creating 4 times as many triangles... these are then rasterized to show the user how much of a resolution improvement can occur using simple subdivision. See below for more details about this. The end result of this project is that an image can be represented using far fewer points, yet still be displayed just as accurately using some computational geometry knowledge.
To Address Part F. in Assignment Description
F. You can view this approach as an image super-resolution algorithm. Experiment your program on different images and discuss why it works better for certain type of images than the other.
This program works well on images with "smooth" color transitions. In other words, it doesn't work as well on images with very jagged areas/rough edges, in terms of light vs. dark intensities. The outer space image, along with the other high resolution photographs full of brights and darks included in the sample directory do not work as well as the gradients included, or the photographs which have less areas of high constrast. The gradient images actually are 100% represented perfectly by only 10% of the points... even before subdivision! This is of course due to GL's rasterization. At any rate, the subdivision greatly improves the quality of the images that don't work so well in the first place.

Our solution is available in various formats:
Runnables: (Remember, it must be run with the first argument being the image file to process)
hw3 - a pre-compiled version of our program for x86 GNU/Linux (dynamically linked with GL, GLU, GLUT, and OpenCV libs)
hw3.zip - a zipped folder with a running win32 executable build of our program inside (dynamilcally linked with included .dlls)
(if neither of these run or are otherwise unsuitable for you, please contact us)
More:
HW3.tar.gz - a gzipped tarfile containing our program's source files and a makefile for GNU/Linux (needs GL/glut/openCV libraries to build)
HW3VS.zip - a zipped folder with a Visual Studio C++ project containing our program inside (needs GL,glut,openCV libraries to build)
Source directly linked from this directory:
src/
Test images directly linked from this directory (within src, too):
src/img
Features/Instructions for using our application:
The program is run from the command line as follows:

[program-name] <image file> [% of pixels to sample]

You simply specify the greyscale image you want to process and, optionally, the percentage of pixels to treat as intensity values for the original Delaunay triangulation. The default %, as specified in the assignment, is 10.

If you are able to build the program in your environment, you can uncomment the line "#define INCREMENTAL", which is line #13 in hw3.cpp. If you build the program after saving the changes, you will be able to witness the delaunay triangles being rasterized individually (albeit very quickly). This is purely a visual aide in understanding what happens, and it was useful in the debugging stages. It is included purely for fun and has no other purpose.

Commands That's it! We hope you find our program easy to use! If there are any questions, please contact us.