Project 2: Fun with Filters and Frequencies!

By: Daniela Fajardo

Overview

We took this project as an opportunity to use filters and frequencies towards creating hybrid images, finding edges, and sharpening and blending images.

Part 1: Fun with Filters

1.1: Finite Difference Operator

1. To find the partial derivatives, I convolved the image with Dx = [-1, 1] and Dy = [1, -1]^T using scipy.signal.convolve2d.

Gradient x

Gradient x

Gradient y

Gradient y

2. Computed the gradient magnitude image: (np.sqrt(grad_x**2 + grad_y**2))

Gradient Magnitude

Gradient Magnitude

3. Threshold: np.max(grad_magnitude) * 0.36
4. Created Binary Edge Image using the threshold.

Edges

Edges

1.2: Derivative of Gaussian (DoG) Filter

Approach 1:

1. Created a Gaussian filter with ( sigma = 2 ). Blurred the image by convolving it with the Gaussian filter using convolve2d.

Blurred Image

Blurred cameraman (sigma = 2 )

2. Convolved the blurred image with Dx and Dy to get the partial derivatives.

Gradient x (DoG)

Gradient x (DoG)

Gradient y (DoG)

Gradient y (DoG)

3. Computed gradient magnitude and created binary edge image:

Gradient Magnitude (DoG)

Gradient Magnitude (DoG)

Edges (DoG)

Edges (DoG)

Approach 2: The difference in this approach was first convolving the Gaussian filter with Dx and Dy and then applying it to the blurred image. The results were almost identical, with slightly wider edges.

Gradient x (DoG)

Gradient x (DoG)

Gradient x (DoG)

Gradient x (DoG)

Edges (DoG)

Edges (DoG)

Part 2: Fun with Frequencies!

2.1: Image Sharpening

Taj Mahal

Blurred Taj Mahal

Blurred Version

Sharpened Taj Mahal

Sharpened Version

Blue House

Blurred Blue House

Blurred Version

Sharpened Blue House

Sharpened Version

2.2: Hybrid Images

Derek the Cat

Hybrid Derek the Cat

Basic example of hybrid images.

Camel Lion

Camel Lion

Riding Lions in Egypt!

A Firework Tree

Firework Tree

Failure: Although you can see both images, the fireworks did not fit well enough to merge with the tree leaves.

Real Life Edna Moda

Hybrid Edna Moda

My favorite hybrid!

Frequency Analysis

Frequency Edna Moda

Frequency Edna Moda

Frequency Linda Hunters

Frequency Linda Hunters

Frequency Low Pass

Frequency Low Pass

Frequency High Pass

Frequency High Pass

Frequency Combined

Frequency Combined

2.3: Gaussian and Laplacian Stacks

Progress of Stacks

Apple Progress

Apple Progress

Orange Progress

Orange Progress

Oraple Progress

Oraple Progress

2.4: Multiresolution Blending (a.k.a. the Oraple!)

The Oraple

Oraple

Just like magic!

The Hypo-bread

Oraple

Avocados are sweet

Oraple

Avocado Progress

Avocado Progress

M&M Progress

M&M Progress

Combined Progress

Combined Progress