Project 3: Graphcut Images (Writeup)

Jason Pacheco (pachecoj)

February 26, 2010


Algorithm Description

Source Image
Saliency Map
Object Mask
Background Image
Max-Flow / Graph-Cut
With Transparent Blending

The images to the right illustrate the steps of the algorithm. First a mask is defined on the source input. The default technique is to allow user input, however for some of the composition tasks (particularly the jet and the bear) I found that this gave poor results.

To get around this limitation I found that a saliency map worked well. See the section "Graduate Credit" for more details on this implementation.

We then compute an object mask from the saliency map by simply thresholding the values in the map. The results are shown to the right. This works well for source images with a particular object of interest on a relatively solid bachground. The jet image fits this category.

Next we compute the max-flow using the graph-cut algorithm provided due to Kwatra, et al.. The final result is then blended using Poisson blending with transparency. The blending step is optional and worked well for some images and less well for others. Some images are blended using default Poisson blending (e.g. no transparency), such as the bear image.

Graduate Credit

Object Saliency

As mentioned above it was noted that some of the composition tasks had poor results with this algorithm when compared to standard Poisson blending. Part of the problem was due to the algorithm being sensitive to the input mask.

After attending a talk by Lihi Zelnik-Manor on Thursday I decided to try out the spectral residual saliency algorithm due to X. Hou, L. Zhang. The technique is implemented in about 5 lines of matlab code. The results are not very robust, but after some parameter tweaking the performance was good enough for this application.

Texture Synthesis

The focus of the paper by Kwatra, et al. was more on texture and video synthesis rather than image composition. It was hypothesised that perhapse the poor composition results were a result of applying the algorithm incorrectly. To test this I chose to try doing some texture synthesis by taking an image patch and transposing it many times then performing the necessary cutting and blending as above. The results are shown below.

Results

Composition

 

Texture Synthesis