Project 2 CS 194-26 UC Berkeley -- Nitzan Orr

Part 1: Fun with Filters

For the first part of this project I calculated the gradient magnitude of the image, and created a new image showing that gradient. Calculating the gradient in the X (left-right) direction involved convolving the image with the filter [1, -1], and for the Y direction, the image was convolved with the filter [[1], [-1]] -- a column vector. X gradients are greatest when there is a large change between 2 pixels lying on the same row, and Y gradients are greatest when there is a large change between 2 pixels lying on the same column. The end effect is that large x gradients show edges that are generally vertical, delineating the boundary between two side-by-side neighboring pixels which are different. The same is true for y gradients but for generally horizontal boundaries or edges. Calculating the gradient magnitude requires taking the sum of squares of the x and y gradients to calculate the intensity at each pixel.

Original, Dx, Dy, and magnitude images:

Now, the edge image. Threshold = 0.19

1.2 Now we’ll first apply a gaussian and try again! The blurred version of the image has cleaner gradients and edges, as high frequency noise has been removed by the low-pass gaussian filter

Gaussian, blurred Image

DX, DY

Magnitude, and edge with threshold = 0.11

Now, we combine the gaussian and derivative filter to create a DoG filter:

DxG, DyG

Magnitude, and edge

Looks the same as before!

Part 1.3: Image Straightening

Histograms show amount of pixels corresponding to an edge with a certain angle between 0 and 180. I picked the image that has the most vertical and horizontal edges.

Failure Case:

Part 2: Fun with Frequencies!

Part 2.1

Sharpening two images. Getting sharper and sharper. This is done by adding more and more of the high frequency component to the original image.

Blurred first, and then sharpened...not the same!

The coolest thing in this assignment was this...that I can create a sharpening filter that can simply be convolved with an image without needing multiple steps.

Part 2.2 Hybrid Images

1. Hybrid Image. This works by blending the high frequencies of one photo with the low frequencies of another photo

2. Windows background + Minecraft Version of Windows Background

3. Failure case because the shapes don't match well, and the panda has few high frequency pixels on its white face

4. The Tegros!

FFT Analysis of Tegros:

Efros and Tiger inputs

Low freq Efros, High Freq Tiger

Hybrid Tegros

Part 2.3: Gaussian and Laplacian Stacks

Gaussian Stack -- stack of images with a gaussian filter applied progressively on each image

Laplacian Stack (stacks in the 3 channels RGB are combined for this visualization). Laplacian stack is made taking the bands of frequencies between images in the gaussian stack.

Analysis of Tegros, my favorite!

Gaussian stack

Laplacian Stack of Tegros

Part 2.4 Multiresolution Blending

Blended orange and apple

Blended moon and pizza


Laplacian stack on result of moon pizza

Laplacian stack on masked moon input

Laplacian stack on masked pizza input

Irregular mask blending

The other coolest thing about this project is that I was able to complete it even though it seemed nearly impossible at the beginning.