A3-RobertCarroll
From CS294-10 Visualization Fa07
Contents |
[edit] Data Domain
The data domain for this project will be digital photographs, or more generally any kind of raster graphic.
[edit] Visualization Technique
The goal of this project will be to create an interface to interactively manipulate the spacial layout of photographs. The user will be able to select an object in an image by highlighting it and move the object around. Regions not highlighted will stretch and compress to compensate for the displacement. I will base this project off of recent work presented at Siggraph called seam carving[1]. The technique works by iteratively removing or replicating connected paths of pixels from an image based on an energy function. Seam carving will be a natural fit for this project because preserves parts of the image that hold the most information, allowing the stretched and compressed regions to have as little noticeable change as possible . I also plan to implement features presented in the previous work, like image resizing and object removal.
[edit] Story Board
This storyboard shows the steps of highlighting and repositioning a selected object (or group of objects) in the scene.
[edit] Implementation
This executable and source code for this project can be found here
To use the program, the user first opens an image through the File menu. Only files in the .tga file format are accepted, but the free program Irfanview can be used for conversions. A couple of test images are included in the project directory. The user the select a portion of the image by holding down the control key, turning the cursor into a selection brush. A red mark locates the centroid of the selection. The user than clicks another point in the image giving the new location of the centroid. The seam carving can take a bit of time to run, at which time it is unresponsive.
The final implementation differs a bit from whats displayed in the storyboard because the whole image will change to accommodate the new location of the selected region. The algorithm is best suited for applications where a small adjustment in the location of some object is desired. It doesn't work well for large displacement. Cases where the amount of displacement is greater than the selections distance from an image edge may also cause bad results.
I implemented this program based on skeleton code for an "image scissors" project, since it already included most of the UI code and a partial implementation of the brush selection tool. The code I wrote is mostly in the carver.cpp file and the handle() method of ImgView.cpp. I spent about 20 hours writing the code, most of which was spent designing the seam carving "stretch" and "shrink" operations (as described in the seam carving paper) and incorporating it with the UI.

