Programming Project #2 (proj2)

CS180: Intro to Computer Vision and Computational Photography

Due Date: 11:59pm on Monday, Sep 23, 2024

Project Description

In this project, I explored the concepts of 2D convolutions, filtering, and image processing. The project is split into two major parts: Fun with Filters and Fun with Frequencies, where I applied various filters and frequency manipulations to generate meaningful results and visualizations. Below are the results and explanations for each part of the project.

Part 1: Fun with Filters

Part 1.1: Finite Difference Operator

Using the finite difference operator, I computed the partial derivatives of the Cameraman image in the x and y directions using dx,dy = [1, -1], followed by calculating the gradient magnitude and applying a threshold to create an edge-detected image.

Part 1.2: Derivative of Gaussian (DoG) Filter

First, I used a Gaussian filter to blur the original image by convolving with a Gaussian, and then finding partial derivatives in x and y. The result contains smoother, cleaner, and thicker edges. We have less noise and more accurate edge detection overall.

Then, instead of convolving twice, I created a derivative of the gaussian filters and then applied to to the image. Result is pretty similar but a bit more accurate with a bit less noise.

Part 2: Fun with Frequencies

Part 2.1: Image "Sharpening"

In this section, I used unsharp masking to sharpen images. This involves subtracting the low frequencies from an image to isolate the high frequencies, scaling the high frequencies up, and then adding them back to the original image to emphasize the high frequencies. Below are the results:

Part 2.2: Hybrid Images

In this part, I created hybrid images by combining the low-frequency and high-frequency information of two different images. Note that although the Kakashi (anime ninja guy) image does not seem to show happy Kakashi that well, it actually shows up quite well when you are at a far distance, in more than just the eye.

These results are my favorite, so below I have listed more detailed frequency analysis of both images.