Intro to Computer Vision and Computational Photography, Fall 2021

Project 2: Fun with Filters and Frequencies

SOPHIA SONG, CS194-26-ach



Overview

In this project, the goal was to understand how filters and frequencies play a role in computational imaging.

Part 1: Fun with Filters

Part 1.1: Gradient Magnitude Approach

To produce the gradient magnitude image, I first computed the partial derivative images in the x and y directions. Then I ran np.sqrt((grad_x**2) + (grad_y**2)) on the result to obtain the gradient magnitude image.

Partial in x
Partial in y
Gradient magnitude image
Edge image

Part 1.2: Derivative of Gaussian Filter

The difference is that the the gaussian filter produces a smoother result than the difference operator as the gaussian filter kills the nosier high frequencies.

DOG Filter result
DOG Filter result

Part 2: Fun with Frequencies

Part 2.1: Image Sharpening

Progression to sharp image.

Original
Blurred
High Frequencies
Sharpened

Part 2.2: Hybrid Images

Hybrid Images

Input 1: Derek
Input 2: Nutmeg
Hybrid Image
Input 1: Biden
Input 2: Obama
Hybrid Bobama
Input 1: Zuck
Input 2: Marilyn
Hybrid Image (failed)
Hybrid Image (better)

Log Magnitude of Fourier transforms of each respective image.

Input 1: Derek
Input 2: Nutmeg
Lowpass filter
Highpass filter
Hybrid Image

Part 2.3: Gaussian and Laplacian Stacks

a
b
c
d
e
f
g
h
i
j
k
l

Above: Laplacian pyramid blending details as in Burt and Adelson 1983b. First three rows show the high, medium, and low frequency parts of the laplacian pyramid from levels 0, 2, and 4.

Part 2.4: Multi-resolution Blending

Apple
Orange
Oraple

More blending

Broccoli
Tree
Broc tree

Even more blending (irregular mask)

Moon
Lollipop
Moonpop

The most important learning

The most important learning from this project is filtering out high frequency noise with gaussian filters to obtain smoother and better-looking image outputs.