16-726 HW 2: Gradient Domain Fusion

Jason Zhang (jasonyzhang@cmu.edu)

Gradient Domain Fusion

Part 1.1: Toy Problem

I began by recreating Buzz and Woody by solving the optimization problem that minimizes the difference between the x-gradients and y-gradients between the source and target image with the additional constraint that the top left corners must be the same color.

Using a least squares solver, I can find the set of pixel values that minimizes the objective equations, which reproduces the original image.

alt text 

Part 1.2: Poisson Blending

Now we can do more interesting things through Poisson blending. The goal is to more seamlessly embed a source image into a target image by working in the gradient domain. Here, the objective function is to preserve the gradients of the original image (first half of the objective) while also preserving the gradients along the edges of the target image (second half).

alt text 

To add my source image to my target image, I carefully crop and rescale my source image and figure out the coordinates to place it in the target image.

Results:

Here are some results:

The most beautiful sunset I've ever seen.

alt textalt text 

Jason swimming with sharks. Note that the right shark came out much better. The left shark's original image was already too blue.

alt textalt text 

JaSUN waking up the teletubbies.

alt textalt text 

A trumpkin!

alt textalt text 

Skating with penguins. Note that the lighting of the penguin doesn't match that of the skaters, and the shadows are inconsistent. Also, the snow patterns don't match.

alt textalt text 

Here's another failure due to the texture of the penguin's snow.

alt textalt text 

Original Images

alt text 
alt text 
alt text 
alt text 
alt text 
alt text 
alt text 
alt text 
alt text 
alt text 
alt text 
alt text