Overview
The goal of the project is to explore the frequency and gradient domain by playing with blurry images, creating hybrid images, making gaussian and laplace stacks that helped in blending two images. The project also explores the gradient domain where we recreate the Toy Problem as well as apply Poisson Blending to blend images.
1.1 Blurring and Sharpening Images (Warm Up)
The goal was to sharpen an image of our choice by emphasizing the high frequencies of that image. The technique used was unsharp masking technique. The result was obtained by taking the difference between the original image and the filtered image. Here are some results using different values of sigma:
The Majestic Lion
Blurring
Sigma = 0
Sigma = 2
Sigma = 5
Sigma = 10
Sharpening
Sigma = 0
Sigma = 2
Sigma = 5
Sigma = 10
1.2 Hybrid images
The goal of this part was to blend two images into a hybrid image. This was achieved by blending the high frequency of one image with the low frequency of the other image. To obtain the low frequency portion of the first image, a Gaussian filter with sigma = 21 was applied to it. To obtain the high frequency portion of the second image, the difference between the original image and the filtered gaussian image was taken (Unsharp Masking Technique). Then, the two images generated with a low and high frequency are added to get a hybrid image
Black and White
Derek + Nutmeg
Derek
Nutmeg
Hybrid Derek and Nutmeg!!!
Lion + Cat (Failure!)
This example the background was too blurry and required really zooming out to see the original lion image. Additionally the white cat made the high pass filter more distinct
Lion
Cat
Hybrid Lion and Cat :(
Hugenero
John Denero
Josh Hug
Hybrid Hugenero!!!
Fourier Transforms for Hugenero
Bells and Whistles (Colorize Hybrid)
To add color to the effect, I performed the same frequency operations as the grayscale on all three channels to reflect the RGB image
Colorized Hugenero
John Denero
Josh Hug
Hybrid Hugenero!!!
1.3 Gaussian and Laplacian Stacks
In this part, the goal was to implement Gaussian and Laplacian stacks, which are almost like the image pyramids. Instead of downsampling an image like pyramids, for stacks the image is convolved with a Gaussian filter with an increasing sigma at each level. The sigma used for these stacks are (sigma = 2, 4, 8, 16, 32)
Lincoln Dali Stacks
Hugenero Stacks from 1.2
1.4 Multiresolution Blending
In this part, the goal was to blend two images across multiple bands of frequencies. This was done by first constructing the Laplacian stacks for both images 1 and 2 with 5 levels. Then the Gaussian stack of the mask image with 5 levels was constructed. Finally, the Laplacian stack (LS) of the blended image was derived. Equation was Lf = L1(Gm) - L2(1 - Gm) where Lf is the final Laplacian Stack, L1 and L2 are Laplacian stacks of the images, and Gm is the Gaussian stack of the mask.Orapple
Apple
Mask
Orange
Result!!!
Sporty
Soccer Ball
Sporty Mask
Tennis Ball
Result!!!
Bells and Whistles (Colorize)
The goal was to try and colorize the images. I took a similar approach to blending in grayscale but across different channels. Unfortunately, the image resulted in a darker intensity.Gradient Domain Fusion
This part of the project explores Gradient Domains of image processing!
2.1 Toy Problem
The goal of this part was to reconstruct an image given its gradients. In this part, we first computed the x and y gradients from the provided toy image. Then used up all the gradients plus a known pixel intensity (top-left pixel) to reconstruct our image.
Toy Image
Doggy
2.2 Poisson Blending
In this part, the goal was to blend two images given a mask. Similar to the toy problem, solved the images for the gradients and added the boundary constraints to the problem.
Penguin on your Ski Trip
Background Image
Object
Mask
Result!!!
Epic Fail
Black and White worked better
YAYYY PENGUIN SUCCESSFULLY WENT SKIINGp>
Penguins love to hike!
Black and White didn't work so well for this one since the penguin was a lot brighter than the background
Worked well blended a bit too much with background
Throw back to Multiresolution Blending
Multiresolution blending
Poisson Blending
Acknowledgements
I would like to thank the staff for giving me the opportunity to work on the project! So glad I got to do this :) Also, like to thank the several students on Piazza who answered my questions, provided skeleton code for masks, and provided clarifications. Stack Overflow is my best friend after this project :) (All questions Numpy answered lol)