CS 143 / Project 1 / Image Filtering and Hybrid Images

There were two main parts to this assignment: writing the filtering function and creating hybrid images with the filter.

Filtering Algorithm

The filtering algorithm was pretty straightforward. I chose to pad the image with zeros. For each pixel in the image, I multiplied the filter element-wise by the surrounding elements of the pixel to get the output. To handle color images, I treated each color chanel separately. Though I considered using im2col, ultimately I found that having to reshape the data afterwards was too time-intensive for images of this size.

Results in a table

Hybrid Images

To create hybrid images, I created the low pass image by blurring image1. For the high pass image, I subtracted the blurred image2 from the original image. Then I added both images together to get the hybrid image.