Project 2

Fun with Filters and Frequencies!

Author: Skylar Sarabia

Part 1: Fun with Filters

Part 1.1: Finite Difference Operator

Gradient magnitude image formula: $$ dx = \begin{bmatrix}1 & -1\\0 & 0\end{bmatrix}, dy = \begin{bmatrix}1 & 0\\-1 & 0\end{bmatrix} $$ $$ dx\_im = im * dx, dy\_im = im * dy $$ $$ $$ $$ gradmag = { \sqrt{(dx\_im)^2 + (dy\_im)^2} }.$$
dX Image
dY Image
Gradient Magnitude
Gradient Magnitude
(thresh = 0.3)

Part 1.2: Derivative of Gaussian (DoG) Filter

Differences between results in 1.1 vs 1.2: The derivative edges are more prominent and there is noticiably less noise do to the image now consisting of lower frequencies (blurred). Since the noise was reduced, the threshold value can be reduced since only the stronges edges remain. In this case it went from 0.3 to 0.015.

Verify: Looking at the differences between "Blur then Derivative Convolve" and "Single Convolution" they look the same.

Derivative Filters

dX Filter
dY Filter
dXdY Filter

Blur then Derivative Convolve

dX Image
dY Image
Gradient Magnitude
Gradient Magnitude
(thresh = 0.115)

Single Convolution

dX Image
dY Image
Gradient Magnitude
Gradient Magnitude
(thresh = 0.115)

Part 2: Fun with Frequencies!

Part 2.1: Image "Sharpening"

Given Image

a = 0
a = 1
a = 2
a = 3

Chosen Blurry Image

a = 0
a = 1
a = 2
a = 3

Blur then sharpen

Original
Blurred
Sharpend
Fun Fact This image was created with Midjourney, a text-to-image AI model

Part 2.2: Hybrid Images

Hybrid #1: Given Images

Low Frequency Image In
High Frequency Image In
Hybrid

Hybrid #2

Low Frequency Image In
High Frequency Image In
Hybrid

Hybrid #3: Failure Case

Due to the panda bear fur pattern of the panda, the panda is still very visible when looking from close.

Low Frequency Image In
High Frequency Image In
Hybrid

Hybrid #4 (Favorite) + Frequency Analysis

lF Image Input
lF Image Input (Low Frequency)
lF Image Input (Low Frequency FFT)
hF Image Input
hF Image Input (High Frequency)
hF Image Input (High Frequency FFT)
Hybrid FFT
Hybrid

Part 2.3: Gaussian and Laplacian Stacks

Gaussian and Laplacian Stacks for Oraple

Apple
Gaussian
Apple
Laplacian
Orange
Gaussian
Orange
Laplacian

Re-creating figure 3.42

Level 0
LHS
RHS
LHS + RHS
Level 2
LHS
RHS
LHS + RHS
Level 4
LHS
RHS
LHS + RHS
Collapsed
LHS
RHS
LHS + RHS

Part 2.4: Multiresolution Blending

Result #1: Official Vizsla Astronaut Nasa Portrait

Base
Blend In
Mask
Collapsed
Base vs Collapsed

Result #2: Vizsla & Dalmation Astronaut Takeoff

Base
Blend In
Mask
Collapsed
Base vs Collapsed

Result #3: Vizsla Astronaut on the moon

Base
Blend In
Mask
Collapsed
Base vs Collapsed
Fun Fact All Vizsla images were created with Dalle-2, a text-to-image AI model

Favorite Result

Inputs
Base
Blend In
Mask
Level 0
Base
Blend In
Base + Blend In
Level 2
Base
Blend In
Base + Blend In
Level 3
Base
Blend In
Base + Blend In
Collapsed
Base
Blend in
Base + Blend in
Base vs Collapsed
Base vs Collapsed
Bells & Whistles Completed 2.3 & 2.4 in all color channels

Reflection

I really enjoyed learning how to create hybrid images and multiresolution blending. I did not realize until this project how important frequencies are to our visual perception of images. I used to make face swaps using photoshop using a blending feature and I just implemented that feature myself!