William Choe Frank
CS194-26 Proj3

Fun with Frequencies and Gradients!

Part 1.1: Image Sharpening

In class, we learned that we can sharpen an image by taking the following steps. First, create a lowpass filter of an image by taking a gaussian filter of the original image. Then use that lowpass filter to create a highpass filter by subtracting the lowpass from the original image. Finally, we can sharpen our original photo by adding the highpass filter to our original image.

Mission Peak Selfie Unsharpened
Mission Peak Selfie Unsharpened
Mission Peak Selfie Sharpened
Mission Peak Selfie Sharpened

Part 1.2: Hybrid Images

In class, we learned that we can create "hyrbrid" images by combining the high frequencies of one image and low frequencies of another image. The result is a hybrid image that looks like one of the original images from up close, and the other original image from far away.

My Housemate Jacob
Jacob
A Stock Photo of a Raccoon
Raccoon
Hybrid
Hybrid

Fourier Analysis


Jacob FFT
Jacob FFT
Raccoon FFT
Raccoon FFT
Highpass FFT (of the racoon)
Highpass FFT
Lowpass FFT (of Jacob)
Lowpass FFT
Hybrid FFT
Hybrid FFT

Failure Hybrid


Me
William Choe
A Mountain
mountian
Will + Mountain
Hybrid 2

Explaination: This probably failed because I tried fusing 2 things with very different shapes (me and a mountain.) Also because I couldn't pick very good allignment points, and Doe Library was mapped to the sky of the mountain which makes the high frequency building lines always ovveride the low frequency sky lines from the mountain.

Additional Hybrid


Tennis ball
Tennis ball
Basketball
Basketball
Fuzzy hybrid ball
Hybrid 3

Part 1.3: Gaussian and Laplacian Stacks

In this part, we created Gaussian and Laplacian Stacks of the famous Lincoln-Gala photo. The Gaussian stack was achieved by repeatingly applying a Gasssian filter with sigma 2^i at each iteration of the stack. The Laplacian stack was achieved by taking the difference of consecutive Gassian filters in the Gaussian stack.

Gaussian Stack Lincoln Gala

Gaus0 Gaus1 Gaus2 Gaus3 Gaus4 Gaus5

Laplacian Stack Lincoln Gala

Lap0 Lap1 Lap2 Lap3 Lap4

Gaussian Stack Jacob Raccoon

Hybrid1 Gaus0 Hybrid1 Gaus1 Hybrid1 Gaus2 Hybrid1 Gaus3 Hybrid1 Gaus4 Hybrid1 Gaus5

Laplacian Stack Jacob Racoon

Hybrid1 Lap0 Hybrid1 Lap1 Hybrid1 Lap2 Hybrid1 Lap3 Hybrid1 Lap4

Part 1.4: Multiresolution Blending

In this part, we used a mask and Laplacian Stacks to seamlessly blend 2 images together.

Apple + Orange = Orapple?

Image 1
Apple
Image 2
Orange
Blend
Apple Orange Blend

Additional Blend

Kakashi
kakashi
Obito
obito
Kakashi + Obito
kakashi obito blend

Additional Blend with Irregular Mask

Grass
grass
Checker Pattern
checkers
Irregular Mask
irregular mask Grass + Checkers
grass checkers blend

Part 2.1: Gradient Domain Fushion - Toy Problem

In this part, and Part 2.2 we explore another way to seam blend an object into a target image. Instead of using a Laplacian stack blending technique used in Part 1.4, we will use a technique more focussed on gradients than image intensity values which is called Poisson Blending which can be formulated as a Least Squares problem.

For this part, we computed the x and y gradients of an input image, then used those gradients and one pixel intensity value to reconstruct the input image.

Original Toy Image
toy problem
Toy Image Reconstructed
toy problem reconstructed

Part 2.2: Gradient Domain Fushion - Poisson Blending

Favorite Blending

Source Image

blend1 source
Target Image

blend1 target
Naive Blend

blend1 naive
Poisson Blending
blend1
Discission: This is the best result I got from this technique and compared to the other blends this project explored, this is by far the best. I think what worked well here was that the background for the source and target image were both deserts already, so the algorithm worked even better given that.

Anotha One

Source Image

blend3 source
Target Image

blend3 target Naive Blend

blend3 naive
Poisson Blending
blend3

Failure Case

Source Image

blend2 source
Target Image

blend2 target
Naive Blend

blend2 naive
Poisson Blending
blend2
Discussion: I think this failed because I tried blending to a white background. With the high level understanding I have a gradients, this means that my source image would only get "lighter" and not drastically change its own gradient, so even though this is better than the naive paste, because of the white background you can still see very easily that this is not a good blend.

Poisson vs. Multi Res.

Poisson
poisson compare
Multi. Res.
lap compare
Discussion: If I had to pick a better blend, I would give it to Poissson, but not by much. I think these 2 methods both have trouble dealing with 3D images that represent 2D objects. Although in most other situations, like the obi wan and desert, Poisson is so much more versitle in its blends so I would personally choose Poisson other Multiresolution blending.