Part 2: Gradient Domain Fusion

The purpose of this part of the project is to use the Poisson blending method to blend a source image into a target background.

Part 2.1 Toy Problem

In this first subpart, we are simply forumlating the gradient domain optimization problem in such a way that we reconstruct the original image. Here are the results, with the original on the left and the result on the right.

../_images/toy_problem.png ../_images/toy_problem_result.png

We are successful, since the original and reconstructed images are the same.

Part 2.2 Poisson Blending

In this part of the project, the goal is to blend an object from a source image into the target image. This is done using gradient domain blending, by solving a linear least squares problem to minimize the squared error in the gradients of the synthesized image when compared with the source image.

Results

For this set of results, we will compare the naive method of simply copying pixels over with the Poisson Blending method.

Very Large Teletubbies in Windows XP

Here, we put Teletubbies into the Windows XP background. They are disturbingly large. One thing we had to do for this particular image was to align the horizon of the two images, so that the ground and sky line up in the two images. In addition, I had to cut out Dipsy, because he was a little too far away from the other 3 and there were plants in the background between him and the other Teletubbies. That’s mostly OK, since Dipsy is the least likeable of the 4.

../_images/telexp-naive.jpg ../_images/telexp-poisson.jpg

The original family portrait:

../_images/teletubbies.jpg

A Plane in the Sky

Here is an example of a plane flying over Arches National Park.

../_images/plane_arch-naive.jpg ../_images/plane_arch-poisson.jpg

Penguins on the Sand (Failure Case)

A lot of people like the beach. So we tried to put penguins on the beach. The results are not great, because the penguins just turned into the color of the sand. But the results are still arguably better than the naive (left).

../_images/penguin_beach-naive.jpg ../_images/penguin_beach-poisson.jpg

The reason for this failure is that gradient domain smoothing disregards constants, since it is just optimizing over the image gradients. As a result the colors in the synthesized image can come out looking rather strange, like in this case.

Revising an Old Friend

Let us compare the Poisson blending technique to the Laplacian blending technique from the first part of the project. On the left, we have the Laplacian blended image, and on the right, we have the Poisson blended image.

../_images/bananacucumber.jpg ../_images/bc-poisson.jpg

We can see that in this case, the Laplacian blended image look nicer, likely because the two objects are very different in color, so the Gaussian blur at their intersection allows for a much smoother transition when compared with the results of the optimization problem that yielded the Poisson blended image.

However, one thing to note is that the Gaussian blending does cause some visual artifacts that turn the white background in the area close to the intersection a little bit green due to the blurring.

We would expect the Laplacian blending technique to work better for images like these where the colors are drastically different between the two images, whereas the Poisson blended result would look nice in situations where the source image has a similar background to the target background.