I implemented the algorithm simply with some helper functions. I calculate each output pixel value individually by multiplying the filter by the image centered on each pixel. I am doing a simple zero padding of the image.
Below are some examples of a an image filtered with different simple filters.
Identity |
Gaussian Blur |
Sobel Filter(Horizontal Gradients) |
Laplacian Filter(High Pass) |
I implemented the hybrid image algorithm simply by combining a low pass filtered image with a high pass filtered image. The low pass image is filtered using a guassian filter and the high pass uses a blurred guassian filtered image subtracted from the original image. I tuned seperate cutoff frequencies for each image to set the images are combined.
Below are some examples images which were merged.
Origional Dog |
Origional Cat |
Low-Pass Filtered Dog |
High-Pass Filtered Cat |
Hybrid Image Scaled |
Original |
Original |
Low-Pass Filtered |
High-Pass Filtered |
Hybrid Image Scaled |
Original |
Original |
Low-Pass Filtered |
High-Pass Filtered |
Hybrid Image Scaled |
Original |
Original |
Low-Pass Filtered |
High-Pass Filtered |
Hybrid Image Scaled |
Original |
Original |
Low-Pass Filtered |
High-Pass Filtered |
Hybrid Image Scaled |