CS194-26 Project 2 - Yin Deng

Part 1: Fun with Filters

Part 1.1: Finite Difference Operator

When calculating gradient magnitude:

  1. Find partial derivatives with respect to x.
  2. Find partial derivatives with respect to y.
  3. For each pixel on the image, the gradient magnitude is equal to the square root of the sum of squares of partial derivatives with respect to x and squares of partial derivatives with respect to y.

Original image:

Original cameraman

Partial derivatives:

Cameraman vertical edges
Cameraman horizontal edges

Binarized gradient magnitude (threshold = 0.05):

Cameraman gradient magnitude

Part 1.2: Derivative of Gaussian Filter

First apply Gaussian filter, then find derivatives

We notice that the final result has considerably less noise compared to 1.1.

Blurred image:

Blurred cameraman

Partial Derivatives:

Blurred vertical edges
Blurred horizontal edges

Binarized gradient magnitude (threshold = 0.05):

Blurred gradient magnitude

Find derivatives of Gaussian Filter

We notice that finding derivatives of Gaussian filters first and then applying them produces roughly the same result as applying the Gaussian filters first and then finding derivatives.

Original image:

Original cameraman

Gaussian Filter Partial Derivatives:

Gaussian filter derivative with respect to x
Gaussian filter derivative with respect to y

Partial Derivatives:

Blurred vertical edges
Blurred horizontal edges

Binarized gradient magnitude (threshold = 0.05):

Blurred gradient magnitude

Part 2: Fund with Frequencies!

Part 2.1: Image "Sharpening"

Taj original vs sharpened (alpha = 5):

Original taj
Sharpened taj

Face original vs sharpened (alpha = 20):

Original face
Sharpened face

Tree original vs blurred vs sharpened (alpha = 10):

Original tree
Blurred tree
Sharpened blurred tree

Part 2.2: Hybrid Images

Input images:

Original Lebron James
Original Anthony Davis

Low pass and high pass:

Low-pass Lebron James
High-pass Anthony Davis

Hybrid image:

Hybrid image

Input images Fourier transformation:

Original Lebron James Fourier transformation
Original Anthony Davis Fourier transformation

Low pass and high pass Fourier transformation:

Low-pass Lebron James Fourier transformation
High-pass Anthony Davis Fourier transformation

Hybrid image Fourier transformation:

Hybrid image Fourier transformation

More examples:

LeGoat:

Original goat
Original Lebron James
LeGoat

BasketCer:

Original basketball
Original soccer
BasketCer

Failed hybrid: The given inputs are not suitable for two reasons. First of all, characters' shapes are very different from each other, so it is difficult to create a hybrid image that's visually pleasing. Second, one character has one eye, and the other character has two eyes, so it is difficult to align them properly.

Original barley
Original spike
Failed hybrid

Part 2.3: Gaussian and Laplacian Stacks

Oraple

Part 2.4: Multiresolution Blending

Iron America

Face on sun

Face on sky

The process of creating the oraple was very interesting. In the process, I had to debug my code and tune some of the parameters, so it was really satisfying to see it working at the end.