Project 3: Gradient Domain Editing

Benjamin Choi (bengyenc@andrew.cmu.edu)

Project Description

The goal of this project is to use Poisson blending to smooth out the visually jarring change in background when an object is cut-and-paste from a source to a destination image.

This is done by minimizing the difference between gradients in the source image (within the mask specified for cutting) and the corresponding gradients in the result image, while trying to make the pixels on the edge of the mask in the result image match the corresponding pixels in the destination image.

The above optimization problem can be solved (to within some error) as a system of linear equations, so I set up a large sparse matrix and solved to get the result image.

Blending Results

The wombat example works best, since the source and destination images have a similar grass texture.

The terminator example worked poorly, because the destination image has a complicated texture with varying colors, and this texture is not replicated inside the mask (only its color intensity is approximated).

It was more difficult than I had anticipated to get a good blend: this requires source and destination images with a similar background, and this background should not have a complicated texture.

Mixed Gradients

Bells and Whistles: Color2Gray

To get the result, I converted the RGB image to the HSV color space, then applied a mixed blend to the S and V channels.