Computational Photography  - Project 3

Alex Limpaecher 10/1/12

 

Gradient-Domain Fusion

In this project I used gradient-domain fusion in order to stitch two images together. When pasting a source image on top of a target, there are very clear seams. One can make these seams less apparent by keeping the gradients consistent between the target and source. I solved this by using Poisson blending, which uses a least squares solver to minimize the gradients between source and target image boundary while keeping the gradients of the source image consistent.

 

Penguin-Chick

Source

CREATOR: XV Version 3.01  Rev: 3/30/93  Quality = 75, Smoothing = 0

 

Target:

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:im2.JPG

 

Direct Blend

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:penguin_rough_copy.jpg

Final Blend

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:penguin_final.jpgPenguin

 

Source

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:penguin.jpg

Target

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:im3.jpg

 

Direct Blend

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:largePenguin_rough.jpg

Final Blend

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:largePenguin_final.jpg

UFO

Source

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:UFO.jpeg

Target

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:gates2.jpeg

Direct Blend

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:UFO_blue_rough.jpgFinal Blend

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:UFO_blue_final.jpg

Pi in the Ski

On September 13th five planes flew over the bay area, painting pi in the sky. This include San Francisco:

 

Berkeley:

and Stanford:

 

Little do people know, this all started at CMU:

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:mixedBlend:mixedPi_final.jpg

 

Source Image:

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:pi-in-the-sky.jpeg

 

Target Image

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:gates2.jpeg

 


Direct Blend:

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:mixedBlend:mixedPi_rough.jpg

Zoomed in Final Blend

 

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:mixedBlend:mixedPi_final_zoom.jpg

 

Poisson Blending

Poisson blending works by changing the intensity of the source image consistent, while also making the gradient with the target image smooth

 

All the images above except for the pi in the sky were done with Poisson blending.

 

Errors seem to occur when the target image is detailed. For example in this image the penguin the hard edge on the top of the snow is clearly being blurred. The algorithm cannot do anything to preserve this hard edge.

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:penguinTree.jpg

 

UFO Test

I ran the Poisson algorithm on the UFO image on multiple locations, to see what effect it would have.

 

This is the most successful image:Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:UFO_blue_final.jpg

When placing the UFO on the cloud is was still quite successful. However you can see a color change in the UFO. However since no one has actually seen a UFO, this color change doesnŐt seem necessarily out of the ordinary.

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:UFO_white_final.jpg

Lastly I place the UFO on the border between the sky and the clouds. I thought this would break the algorithm.

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:UFO_both_final.jpg

The image looks surprisingly good.

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:UFO_both_final_zoom.jpg

Zoomed in you do see some blurring of the clouds. However this was clearly caused by the heat of the UFO that was created on re-entry into the atmosphere.

 

Mixed Gradients

For the mixed gradients example I blended skywriting on top of the CMU campus. At first I just used Poisson blending. I got the following results:

 

 

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:pi_in_the_sky_final.jpg

When you zoom in you can see some clear distortion of the clouds:

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:poisson:pi_in_the_sky_zoom.jpg

However mixed blending preserves the strongest gradient. Thus when I ran mixed gradients on it I got the following results:

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:mixedBlend:mixedPi_final.jpg

Zoomed in you can see that the clouds are preserved:

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:results:mixedBlend:mixedPi_final_zoom.jpg

 

Toy Example

Running the toy example I was able to recreate the following image with the error

: 3.1572e-06

 

Description: Macintosh HD:Users:alimpaecher:Documents:CMU:Computational Photography:Proj3:samples:toy_problem.png