Project 2 Writeup

Alex Collins (aecollin)
February 17, 2010


Algorithm

This project implements the Poisson image blending algorithm for seamlessly blending a source image (i.e. a bear) into a target image (i.e. a woman swimming in a pool), when given a binary mask (which can be interactively selected by the user). The algorithm works by setting up and solving a system of linear equations, where the unknowns represent the pixels in the new composite image. Any pixels outside of the given mask are copied directly from the target image. Pixels that lie under the mask, however, are computed by setting their final value to the average of the gradients of the neighboring pixels. However, some of these neighboring pixels will also be unknown, and so enter into the system of linear equations that we must solve. Since the complete system of equations contains m*n linear equations with m*n unknowns (for a given m x n target image), there exists a unique computable solution.

Discussion of Results

I tested the algorithm on the 5 given images, as well as 5 image pairs of my own. In general, my algorithm did a good job blending the two images together. However, without using transparency, the composite image contained significant blurring around the edges of the mask. Because the target image generally contained a textured background (ie the desert background behind the airplane), this blurring became noticeable in the final image. However, once transparency was implemented and used on most of the images (the exceptions being the shark in the swimming pool, and nicholas cage's face on the mona lisa), the aforementioned blurring was eliminated for the most part.

One downside of using transparency was that in some cases (the shark in the swimming pool), is that the target image gradient may be stronger than the source image gradient through important areas in the source image (ie the main object that you are trying to blend). In this case, the blended source object will appear semi-transparent, which is undesirable (you shouldn't be able to see the bottom of a swimming pool through the body of a shark..). This problem is due to the lack of specificity and tunability of the algorithm and the masking. It might work better to use edge detection to tighten the bounds of the mask in order to avoid this problem.

Extra Credit


Transparency Comparison

Comparing image blending without transparency (left) and with transparency (right)

Other Results