CS194-26: Intro to Computer Vision and Computational Photography, Fall 2021

Project 2: Fun with Filters and Frequencies!

INSTRUCTOR: Alexei (Alyosha) Efros, Angjoo Kanazawa

Jingqi Huang, CS194-26

Overview

Play with gaussian low-pass filter and laplacian

Part 1.1: Finite Difference Operator

partical derivative of x (dx)
partical derivative of y (dy)
gradient magnitude (sqrt( dx**2 + dy**2 ))
edge image: binarize gradient magnitude at threshold 0.3

Part 1.2: Derivative of Gaussian (DoG) Filter

result from blurred picture(apply gaussian to picture first, then dx dy to blurred picture), have less noise and clear edges:
gradient magnitude for blurred picture;
edge image for blurred picture: binarize gradient magnitude at threshold 0.11;

gaussian filter on dx dy filter(first convolv then blur), then apply to original picture:
partical derivative of x;
partical derivative of y ;
gradient magnitude;
edge image;

The result of find gradient magnitude on gaussian filtered picture is same as first convolv dx dy with gaussian filter then apply to original picture. This corresponds with the fact that convolution is associative and commutative


Part 2.1: Image "Sharpening"

sharpen for taj
original taj
gaussian blurred taj, ksize=6, sd=1
high frequency
sharpened taj = original taj + 1*high frequency

sharpen for taj
original Angkor Wat
gaussian blurred Angkor Wat;
high frequency
sharpened Angkor Wat = original Angkor Wat + 2*high frequency

blur the sharp image and try to resharp the blur image:
original gather logo
gaussian blurred gather;
resharpened gather logo from the blurred gather

We can see from the original picture that the Gather logo is composed of many green dots. Comparing the original Gather logo with the resharpend one, we notice that the green dots is invisible from the resharpened one. Because the blurring get rid of high frequencies and details, it is impossible to get those high frequencies and details back from soly the blurred pictures.


Part 2.2: Hybrid Images

grayscale
colored
colored cat on gray face

Peacock
Folding fan
color
color peacock on gray fan

Try to hybrid zebra and leopard

Overall performance not so good to see two animals with both strong patterns to be hybrid together.

zebra
leopard
leopard
leopard
colored high frequency zebra on top of blurred leopard, cannot see the characteristic rosettes on leopard fur.
colorerd high freqeuncy leopard on blurred zebra. Gaussian ksize for zebra set to 12, still too clear stripes both from apart and from near close.
colorerd high freqeuncy leopard on blurred zebra. Gaussian ksize for zebra set to 24, better performance.
Instead, try replace zebra with horse
horse
leopard
colored leopard on blurred horse
Now, see the fft for horse and leopard hybrid
horse fft
leopard fft
low filtered fft for horse
high filtered fft for leopard
fft for result

some other attempts:


Part 2.3: Gaussian and Laplacian Stacks

Oraple

level 0

level 1

level 2

level 3

Part 2.4: Multiresolution Blending (a.k.a. the oraple!)

apple + orange ==> oraple
orange
oraple
castle + mountain ==> castain
castle
mountain
use gaussian filter
nice castle on mountain
hand + mouth ==> mouthand
hand
mouth
clear seam
mouth filter
nice weird mouthand