15-663 Project 3: Gradient-Domain Fusion

By Michael Choquette (mchoquet)

Code Overview

I implemented the algorithms given in the writeup for image reconstruction, poisson blending, and mixed-gradient blending, by mapping each pixel to a column and each equation to a row and solving Av = b over the resulting sparse matrix.

Results

Image reconstruction: I successfully reconstructed the original image.

Poisson blending: I inserted a moonwalker onto a picture of the moon, a dog onto some grass, a turtle onto a street, and a pencil onto a desk. See below for results:

In this picture, I poisson-blended a stormtropper onto the moon. Note that the dark background on the source image has to be adjusted to match the light grey moon dust, so the white stormtropper becomes oversaturated.

Here I poisson-blended a dog onto some grass. The dog is white-on-green, but the background image is half green, half brown, so even though the bottom half of the dog is blended pretty well, the top half becomes light purple.

Here I poisson-blended a turtle onto the road. The turtle blends well with acceptable amounts of color change, but the texture of the source image (gravel) doesn't match the texture of the target image (smooth asphalt) very well.

My best work was in blending the pencil onto this image of wood. Both the color and texture of the two images match (even the grain of the wood is in the same direction), so the transition is fairly seamless.

Mixed Gradient Blending: I was able to successfully blend black text on a white background onto a complex backdrop (i.e. grass). While poisson blending has clear visual artifacts, the mixed-gradient blending is so good that it looks like the white pixels have been rendered as transparent: