Project 1: Image Filtering and Hybrid Images

In order to generate the filtered images, my algorithm first pads the input image with reflected image content along the edges. I chose reflection over zero-padding simply because reflection results in less distortion from the original image when filtering. My algorithm accomplishes this simply by using MATLAB's padarray() function.

Next, my algorithm applies the input filter to the padded image. It loops through the padded image and each of its color channels, but it only considers the pixels containing the original image. At each pixel, a matrix of the same size as the filter is centered on the current pixel, indicating the current region of interest for the filter. Element-wise multiplication is then performed between this matrix and the filter itself. The resulting matrix from this multiplication has its elements summed together to give the filtered value of the pixel on which the filter is currently centered. Finally, this filtered value is copied into the corresponding pixel of the output image that has the same size as the original image.

Results

Hybrid Image High Frequencies Low Frequencies Original Images
Dog-Cat
Motorcycle-Bicycle
Plane-Bird
Einstein-Marilyn
Submarine-Fish
Panda-Wolf