Project 2: Fun with Filters and Frequencies

Evan Huang

Part 1: Fun with Filters

1.1: Finite Different Operator

I found the gradient magnitude by convolving the image with horizontal and vertical filters to get the magnitudes of the partial derivates. The magnitude of the gradient can then be found using the l2 norm.

Original Gradient Magnitude Edge Image
cameraman gradient magnitude edge map

1.2: DoG Filters

Blurring the image helped reduce some noise in the image and thickened the edges. Using a DoG can reduce the computational demand by only requiring one convolution after precomputing the DoG.

Blurred Edge Image Edge Image w/ DoG
cameraman edge map from blurred edge map using dog

Part 2: Fun with Frequencies

2.1 Image Sharpening

Sharpening was achieved by subtracting the blurred image from the original and adding it back to the original with a weight.

Original Blurred Sharpened
taj taj blurred taj sharpened

This can be simplified by using the unsharp mask filter, only requiring 1 convolution. This is done by convolving the image with (1+alpha)e-alpha(g), where e is the unit impulse and g is a gaussian kernel.

Original Sharpened
concert concert sharpened

Sharpening was then used on blurry images to "re-sharpen" images. The effect is subtle in this example, but it can especially be seen in the "road work ahead" sign.

Original Blurred Sharpened
street street blurred street sharpened

2.2 Hybrid Images

I made two hybrid images by mixing low and high frequencies of different images. The first is a hybrid of Superman with Clark Kent. The second is a hybrid of my friend's cat and my dog.

Low-pass Image High-pass Image Hybrid Image
superman clark kent superman clark kent
circle aki aki circle

FFT Visualizations for cat/dog hybrid:

(Circle is the cat, Aki is the dog. )

circle fft aki fft
circle blurred fft aki high pass fft
hybrid fft

Failed:

I also tried making a hybrid of a Samsung and iPhone, but there aren't enough distinguishing visual features to clearly differentiate the two at different distances.

Low-pass Image High-pass Image Hybrid Image
samsung iphone iphone samsung

Multi-Resolution Blending

2.3 Gaussian and Laplacian Stacks

I made Laplacian stacks for pictures of an orange and apple, along with their blended stack. This uses a simple step function as a mask.

Apple Stack Orange Stack Blended Stack
apple stack 0 orange stack 0 oraple layer 0
apple stack 1 orange stack 1 oraple layer 1
apple stack 2 orange stack 2 oraple layer 2
apple stack 3 orange stack 3 oraple layer 3
apple stack 4 orange stack 4 oraple layer 4
apple stack 5 orange stack 5 oraple layer 5

2.4 Multiresolution Blending

Oraple result:

oraple

The oraple worked very well. I also made a few more multiresolution blended images using irregular masks. The masks were constructed by using a Sobel edge detection filter and then flood filling certain areas of the edge map.

Image 1 Image 2 Mask Result
gojo smash gojo mask gojo smash
Gojo in Smash
gudetama left gudetama right double gudetama mask double gudetama
Double Gudetama
gudetama totoro gudetama totoro mask gudetama totoro
Totoro in Gudetama's Shell

Laplacian and Blended Stacks for Gojo in Smash:

Gojo Stack Smash Stack Blended Stack
gojo stack 0 smash stack 0 gojo_smash stack 0
gojo stack 1 smash stack 1 gojo_smash stack 1
gojo stack 2 smash stack 2 gojo_smash stack 2
gojo stack 3 smash stack 3 gojo_smash stack 3
gojo stack 4 smash stack 4 gojo_smash stack 4
gojo stack 5 smash stack 5 gojo_smash stack 5