Fun with Frequencies!

Brian Kooperberg

Part 1.1: Sharpening

In the first part of the project we sharpened an image. To do this we find the difference or the starting image and the starting image minus a gaussian blur multiplied by a chosen alpha. This makes it so the high frequencies in our image are easier to see. We can see below that the lines of the city seem crisper.

Rotterdam Original Image Rotterdam Sharpened Sharpened Image Rotterdam Filter Filter



Part 1.2: Hybrid Images

Hybridization is done by taking the average of the high frequencies of one picture and the low frequencies of another. To find the high frequency image I took the original minus the gaussian while for the low frequencies I just used the guassian blur. The next thing I had to do was mess around with the sigma values to try and get a better result.

Tonny Vilhena Dirk Kuyt

Original images



V fft K fft

FFT of Vilhena(Original), FFT of Kuyt(Original)



Tonny Vilhena Dirk Kuyt

Vilhena(Low Pass)(Sig = 5), Kuyt(High Pass)(8)

Vilhena fft Kuyt fft

FFT of Vilhena(Low Pass), FFT of Kuyt(High Pass)

Above we can really see the drastic difference when we apply a low pass filter and then we can also notice that the high pass fft is brighter than the original.

Kuyt fft Kuyt fft

Hybrid, Hybrid FFT





So Cute





Failure


This didn't work very well because the shapes of the trophies are different so we are still able to see the wider trophy no matter how close we are to the picture.



Part 1.3: Gaussian and Laplacian Stacks

For this part, we are implementing gaussian and laplacian stacks. To implement a gaussian stack we just take the gaussian at each level since we don't want to make a pyramid (which would involve changing the size of the image). Then to find the laplacian stack we subtract the current gaussian from the gaussian of the previous level, which is also why for the 2 examples there is one more image in the gaussian stack than in the laplacian stack.
LG0 LG1 LG2 LG3 LG4 LG5

Gaussian Stack



LL0 LL1 LL2 LL3 LL4

Laplacian Stack



LG0 LG1 LG2 LG3 LG4 LG5

Gaussian Stack



LL0 LL1 LL2 LL3 LL4

Laplacian Stack

Part 1.4: Multiresolution Blending

Multiresolution blending works by blending at specific frequencies. We first take the laplacian stack of the two images we want to blend and make a mask which matches where we want the pictures to change. The mask is originally all zeros and ones (black and white). Then at each level we add the mask_gaus * im1_lap + (1-mask_gaus) * im2_lap to a cummulative image. Then once we go through all of our levels in the laplacian stack, we add the mask_gaus * im1_gaus + (1-mask_gaus) * im2_gaus of the final gaussian level (remember we have one more level in the gaussian stack than in the laplacian stack). I tried to blend a tennisball and a soccerball together. The results weren't so great. I made sure to use a large gaussian kernel. The images are almost perfectly aligned. So what was the problem?! I think the images were just way to different to start. Light green and dark blue are so different in values that the gaussian kernel was not able to blend them enough.

LL0 LL0 LL0

Apple, Orange, Appange



LL5 LL5 LL5

Shining Twins, Forest, Mask


LL5

Combination



LL5 LL5 LL5

Tennis Ball, Soccer Ball, Both



Part 2.1: Toys

In this problem we wanted to use matrices and linear algebra to find a picture which most closely matches our original picture. The way that we did this is by trying to find the minimum difference we could get for changes in the x-direction (horizontal gradient) and for changes in the y-direction(vertical gradient). Since we set up our equations like this without an additional constraint we could run into a problem where the everything is off by a constant so we also added the one pixel on the new image should be close to a pixel on the old image. In doing this we were able to recreate the picture of Buzz and Woody.

LL5 LL5

Original Picture, Recreated Picture



Part 2.2: Poisson Blending

In this problem we wanted to use Poisson blending to blend our pictures together. To do this we use the following equation: LL5 This basically tells us that we want to change the values of the pixels that we are adding to the background to make the transition smoother by finding the minimums of the gradients in all 4 directions for pixels near the boundaries.

When it's too cold outside
LL5 LL5 LL5 LL5

This is my favorite because like all of the poisson blend there is a bit of a blur around the polar bear, but with the screen behind the polar bear, it seems like the polar bear is glowing inside the room instead of out of place.

Sample Pictures
LL5
Failure
LL5 LL5 LL5

Even though I thought the resulting picture looked pretty cool we lose all the detail in Louis Armstring because the constrast in his picture is already not very much so when we adjust some of the pixels and make everything darker it becomes almost impossible to see anything past his silloute.

Shining Revisited

Poisson Blending LL5 Multiresolution Blending LL5

Some of the differences which we can see are the girls seem darker in the poisson blending compared to the multiresolution, which makes sense because poisson is finding a minimum as things transition while multiresolution just matches the mask. This also makes it so the multiresolution seems to have a sharp transition between the two images. On the other have in poisson seems to blur a bit around the transition which still feels kind of weird. I think I generally like poisson better than multiresolution, but I think when the colors are very different or important to the way one of the images looks multiresolution blending works out better.