15-663 Project #3: Gradient-Domain Fusion

Zhizhong Li

Overview

This project blends a source patch image with a target background image, by (attempting) simultaneously preserving the pixel values of the target around the patch, and the gradient inside the patch (and possibly the gradient in the target image).

Approach

The method used in this project is exactly the same as suggested in the handout. Note that the energy function is similar but not equivalent to what is presented in the lecture. In this assignment the one in the handout is used, preserving the gradient instead of the Laplacian. This produces similar but not identical result than the lecture version.
 
The toy example can be viewed as Poisson blending with mask with all ones except the top-left corner. And also ignore the equations relying on the outside of the source and target image.

Bells & Whistles

I implemented the Color2gray, regarding it as a mixed gradient image recovery problem, where the gradient used at each pixel shall be the largest (in terms of absolute value) among the gradient in the saturation channel and the intensity channel. The hue channel is discarded due to its instability. The mask used is all ones except at the image boundary (outermost rectangle, 1 px wide).

Results

The results on some images found online (and the provided images) are shown here.
 
And then, the mixed gradient result for the second one follows.
 
And last, the result of the Color2Gray trial.

Poisson Blending and Mixed Gradient

Figure 1: Such moon much bright wow. Top to bottom: source, target, cut & paste, blend.
 
 
 
 
 
Figure 2: CMU Penguinwalk. Top to bottom: source, target, cut & paste, blend.
 
 
 
 
 
Figure 3: Failure case. The doge face does not blend so well due to the difference in pattern around the boundary, and the obvious difference in color.
 
 
 
 
 
Figure 4: Mixed gradient result for Figure 2. See Figure 2 for the source, target and cut and paste images.
 
 
Note that in the mixed gradient result the cloud around the penguin is preserved better than the simpler Poisson Blending.

Extra content

The result for the Color2Gray extension is here.
 
Figure 5: Result of Color2Gray. Note that the hue channel is ignored.