16-726 Assignment 2

Canbo Ye (canboy)

Overview

The goal of this project is to explore the gradient-domain processing techniques and will focus on Poisson blending. In the project, I firstly start with a toy reconstruction example and then implement the Poisson blending. I apply the algorithm to several images I like to see its performance. In the end, I also try to modify the Poisson blending based on mixed gradients and show a result of it.


Toy Reconstruction Problem

I implement the toy reconstruction based on gradient domain processing following the instructions. See function toy_recon() in main_hw2.py for implementation details.

Left: the original image; Right: the reconstructed image.jpg
We could see that the reconstruction performance is good and we can hardly see the difference between the two images.


Poisson Blending

I implement the Poisson blending algorithm following the instructions. See function poisson_blend() in main_hw2.py for implementation details. I will show four blending results to evaluate its performance in the following section.

Result 1
From left to right: source image, target image, naive blending and Poisson blending.


Result 2
From top left to bottom right: source image, target image, naive blending and Poisson blending.


Result 3
From top left to bottom right: source image, target image, naive blending and Poisson blending.


Result 4 (Failure)
From top left to bottom right: source image, target image, naive blending and Poisson blending.


Analysis
From the results above, we could see that the blending performance is quite good for result 1, 2 and 3: the blending is natural and does not have too much perceptual damage to the soucre region. The blending is achieved by leading the gradients inside the source region to be similar to the gradients of the target region.
However the blending for result 4 is not that satisfying, because the boundary of the source image is notiable and the color of source region has changed a lot. I think the the reason for this failure case lies in the huge color difference between the source and target images and the surrounding area of the target region actually contains persons which should not be blurred after blending. I think this is a shortcoming of Poisson blending.


Mixed Gradients

I implement the Poisson blending algorithm based on mixed gradients. See function mixed_blend() in main_hw2.py for implementation details. I will show one blending result to evaluate its performance as follows.

Result
From top left to bottom right: source image, target image, original Poisson blending and mixed-grads Poisson blending. For better comparison, the blending results in the bottom are cropped.

Analysis
From the results above, we could see that the mixed gradients blending will change the source region to be closer to the target region. This could bring benefits when we want to emphasize the background or the source region is kind of transparent, but is also likely to make the blended image less realistic because it uses the gradient in source or target with the larger magnitude as the guide, rather than the source gradient.