Example of a Hybrid Image.
Image filtering forms the basis of computer vision allowing a remarkable amount of image manipulation. Filters can, among many other abilities, blur and sharpen, highlight vertical or horizontal lines, and remove frequencies within ranges. The goal for this project was to write a version of Matlab's imfilter procedure called my_imfilter. This procedure takes an image and a filter and applies the filter to all pixels of each color channel. It does this through four steps:
Box Blur
Gaussian Blur
Sobel
Laplacian
One interesting application of imfilters is creating hybrid images. This process merges two images into one in such a way that different distances from the image reveal each component image separately. This effect is achieved by filtering the high frequencies from one image and the low frequencies from the other and then adding the results. At longer and shorter distances, different frequencies stand out. Generating the low frequencies is a simply matter of applying a Gaussian blur to the image. The high frequency component is generated by first applying the Gaussian blur and then subtracting that image from the original image. By changing the standard deviation of the Gaussian blur a different cutoff frequency between high and low frequencies can be obtained.
Here is the original image cat image.
Here is the original image dog image.
Here is the result of a Gaussian blur filter with dimensions 25 x 25 and standard deviation 7 applied to the dog.
Here is the result of first the same Gaussian blur applied and then that image being subtracted from the original cat image.
![]() ![]() ![]() ![]() |
![]() ![]() ![]() ![]() |