CS 194-26: Project 2

By Ana Cismaru

Part 1: Fun with Filters

Filters have many usages including extracting edges, blurring, sharpening, etc. In this first part (1.1) we used the [1, -1] and [[1], [-1]] vectors to extract the horizontal and vertical edges of an image of a camera man. We then calculated the gradient magnitude by taking the square root of the sum of the sqaures of the vertical and horizontal edge images. Finally, we set a threshold of 0.28 (determined experimentally) to binarize the image.)

Vertical Edges (Dx)
Horizontal Edges (Dy)
Magnitude of Gradient
Binarized Gradient

We can improve our results by using the Derivative of the Gaussian to smooth the image prior to taking the derivatives. We notice that by using a derivative of Gaussian Filter, we are able to extract smoother and more continuous edges. This can both be done with two convolutions (dx, dy) or by combining the two into a single convolution with the gaussian.

Vertical Edges (Dx)
Horizontal Edges (Dy)
Magnitude of Gradient
Binarized Gradient
Derivative of Gaussian Image
Binarized Edges (similar to before)

Part 2: Fun with Frequencies

2.1 Sharpening

First we used a Laplacian filter to sharpen images. The Laplacian is the different between the original image and the image convolved with a Gaussian.

Original Taj
Sharpened with Alpha=0.5
Sharpened with Alpha=0.7
Sharpened with Alpha=1
Sharpened with Alpha=2
Original Blurry David
lSharpened with Alpha=0.5
Sharpened with Alpha=0.7
Sharpened with Alpha=1
Sharpened with Alpha=2
Original Violinist
lSharpened with Alpha=0.5
Sharpened with Alpha=0.7
Sharpened with Alpha=1
Sharpened with Alpha=2

2.2 Hybrid Images

By exploiting how our eyes process high and low frequencies at different distances, we can create hybrid images. The gist of the algorithm relies on superimposing a high frequency filtered image over a low frequency filtered image. These images can be derived using the gaussian and laplacian filters. We can also extend this algorithm to colored images by applying it to every channel and stacking the results.

Image 1
Image 1 Fourier
Image 2
Image 2 Fourier
Low Frequency Image
Low Frequency Image Fourier
High Frequency Image
High Frequency Image Fourier
Hybrid Image Close
Hybrid Image Far
Hybrid Image Fourier
Hybrid Image in Color Close
Hybrid Image in Color Far
Alien Catcus Hybrid Close
Alien Catcus Hybrid Far
Failed Corgi Bread Hybrid Close
Failed Corgi Bread Hybrid Far

MultiResolution Blending

We can seamlessly blend images by creating the laplacian stacks, masking the image at every stack level, and blending the image at every stack. Afterwards, we can sum the each level of the stack together to obtain the full blended picture.

Grayscale Oraple
Laplacian Stack of the Oraple (Levels 1,2,4)
A blursed mega professor
The Campanile takes over Stanfurd (not the cleaneast at the top due to the different colors :( )

Most Important Thing Learned in Project

The most important/coolest thing I learned in this project is the power of separating images into different frequency levels and how optics/biology relates to that. I really enjoyed getting to learn why the Mona Lisa looks like she is both smiling and serious and both looking at you and looking sideways.