CS 143 / Project 1 / Image Filtering and Hybrid Images

A blurred image constructed from my_imfilter.

There were a few design decisions to make in my_imfilter. The first was whether to pad the picture with zeros or with a reflection. I chose to use zeros, but after seeing how extreme the results can be with large filters, I'm not sure if I would have done it this way if I did the project again. I also traverse the picture in column-major order, because that is the way Matlab stores arrays and I wanted to maximize cache performance to make my code run quicker. It still runs rather slowly, if I had more time I would have worked to optimize it more. It convolves the filter with the image pixel by pixel for each red, green, and blue attribute. It then returns the output picture. It seems to give the desired input when compared to Matlab's imfilter. Using my_imfilter, it was pretty simple to get the high-pass and low-pass images to make a hybrid image in final proj1 function.

Below are some results from my filtering algorithm. Each column pair of high and low frequency passes (respectively) correspond to the neighboring column's hybrid images. For the hybrid images, my_imfilter is on the top while Matlab's imfilter is on the bottom.

Results