Project 2

Fun with filters and frequencies

Keyan Abou-Nasseri

Part 1: Fun with filters

1.1

Partial derivative in x
Partial derivative in y
Gradient magnitude
Edges (threshold of 0.25)
To compute the gradient magnitude, we sum the element-wise squares of the two partial derivative images, then take the square root of the result. In pseudocode, gradient_magnitude = sqrt((partial_x ** 2) + (partial_y ** 2)).

1.2

Filtered cameraman
Partial derivative in x, after filtering
Partial derivative in y, after filtering
Gradient magnitude, after filtering
Edges, after filtering (threshold of 0.13)
After filtering, we get much better results. In particular, the partial derivatives are relatively stronger around the cameraman's body, which makes it easier to separate the true edges from the noise using a threshold. We can see that despite having a lower threshold, the edge image is now much clearer, more accurate, and less noisy.
DoG filter in x
DoG filter in y
Gradient magnitude, using DoG
Edges, using DoG (threshold of 0.13)
We can see that DoG results in the same output images.

1.3

For test images, the order is original, rotated, original histogram, rotated histogram.

Barcelona:

House:

This is probably the failure case, since the algorithm overcorrects.

New York:

Facade:

Part 2: Fun with frequencies

2.1

Taj:

Order: original, sharpened
Alpha = 3, 9x9 gaussian

New York:

Order: original, blurred, resharpened
Alpha = 5, 9x9 gaussian

We can see that "resharpening" causes the image to appear somewhat less blurry, but it can't bring back the information we've lost.

2.2

Dog and cat:


Order: Dog, Dog high freq., Cat, Cat low freq., hybrid


Cat and otter (failure):


Though Mochi and Sakura are very cute, this doesn't work very well due to the difference in head size and Mochi's striped background

Cat and AOC:


2.4

Mona Lisa:


Dog and cat: