Project 3: Fun with Frequencies and Gradients!

Daniel Zheng - cs194-26-acj

1.1: Warmup

Using the unsharp mask filter, the high frequencies of an image are intensified, which results in a sharper image. The unsharpened raccoon is on the left, and the sharpened raccoon is on the right.

I used a 21x21 Gaussian kernel with an alpha value of 0.5

1.2: Hybrid Images

Hybrid images are static images that change as a function of the viewing distance. Close up, the high frequency dominates, but far away the low frequency appears. This can be simulated by zooming the browser window in and out.

For the below images, I used 81x81 Gaussian kernels.

Pizza (low frequency) + Moon (high frequency) (Pizoon)

The sigma for pizza was 9, and the sigma for the moon was 20.

Duck (low frequency) + Rabbit (high frequency) (Dabbit)

The sigma for the duck was 4, and the sigma for the rabbit was 10.

Below is the Fourier analysis of the duck + rabbit picture.
Duck input (left) and rabbit input (right):

Filtered duck (left) and filtered rabbit (right):

Hybrid image:

Nicolas Cage (low frequency) + Fabio (high frequency) (Fabio Cage)

The sigma for Nick Cage was 7, and the sigma for Fabio was 12.

The Nick Cage/Fabio mashup was a failure. Even looking from far away, it is difficult to tell that the image is Nicolas Cage. This seems to arise because the faces of Nicolas Cage and Fabio are too similar, and it is very difficult to tell the difference between the two handsome men.

1.3: Gaussian and Laplacian Stacks

Gaussian and Laplacian stacks are like their pyramid counterparts, but every image in the stack remains the same size.

For the below images, I used 81x81 Gaussian kernels. For the Gaussian stack, I started with a sigma value of 2, and doubled it for every subsequent layer in the stack.

Gaussian and Laplacian stacks for Dali's Lincoln painting

Original Lincoln painting

Gaussians

Laplacians

Gaussian and Laplacian stacks for Duck + Rabbit

Gaussians

Laplacians

1.4: Multiresolution blending

Multiresolution blending computes a gentle seam between two images at various frequency bands, resulting in an overall gentle transition.

For the below images, I used 81x81 Gaussian kernels. For the Gaussian stack, I started with a sigma value of 2, and doubled it for every subsequent layer in the stack.

Oraple (Orange + Apple)

Moozza (Moon + Pizza)

Rockshington (Rock + George Washington)

Below are the masks used for creating Rockshington, as well as the layers of the Laplacian stack.

Mask used:

Laplacian layers:

2.1: Toy Problem

In the toy example, we solve a simplified version of the full Poisson blending equation. In the toy example, we only use the first part of the equation: where the gradients of the target image inside the boundaries should try to match the gradients of the source image as closely as possible. By also adding the condition that the two top left corners of the images should be the same color, this naturally means that the target (reconstructed) image should match the source image.

Below we have the source image on the left and the reconstructed image on the right. As you can see, they look the same.

2.2: Poisson Blending

Unfortunately, I ran out of time to do 2.2 so there's nothing here.