Project 3: Image Stitching with Graph Cuts

Donnie Kendall (dkendall)

Algorithm

Given that a max-flow/min-cut mex was supplied, the only complicated part of the algorithm was computing the edge weights in an efficent manner in matlab. The metric that I chose for calculating edge weights was the first one given in the paper, that is:

Where s and t represent adjacent pairs of pixels. Using some matlab hackery with linear indexing a list of all pairs of adjacent pixels can be calculated very rapidly, with the actual metric calculation then being done in a single large matrix operation.

After the edge weights are caluclated, the optimal seam is found via min-flow/max-cut, and then the TA poisson blending code is used to smooth the results together as best as is possible with poisson blending.

Results

For many images the algorithm results in a very good mask. However, even with a good mask images in which the color or texture suddenly jumps between the target and source ends up look bad because of the discontinuity. This is the problem I had with all of my extra test images, and why none of them are included in the results.

Below, the first image is the calculated mask (using graph cuts), and the 2nd image is the combined image