CS 143 / Project 1 / Image Filtering and Hybrid Images

Hybrid Image

Simplified version of Hybrid images is shown in the SIGGRAPH 2006 paper by Oliva, Torralba, and Schyns. This project is to develop a image filter and generate hybrid images of set of image pairs.



Aim of the Project 1

  1. Create a imfilter to handle images both black and white, and filters of arbitrary size.
  2. Fuse the high frequency components of an image with the low frequency components of another image to form an hybrid image
  3. Check the cutoff frequencies of different image pairs and give the observations.


I: Image filter creation:

Image filtering is an image operation by sliding a matrix/image onto primary image to generate some useful interpretations of the primary image. The steps followed to create filter is as below.

  1. Load both the primary image and the filter image.
  2. Check the size of the filter for odd dimensions (like 3x5 and not 2x9).
  3. Check if the image provided is color of gray scale.
  4. Colored images are split into channels and the filtering is processed.
  5. Size of the original image is increased with respect to the dimensions of the filter to handle the boundary cases.
  6. The filter matrix/image is slid across the primary image and based on the below equation at every pixel of the primary image new image is formed. New image formed is called "Hybrid Image"
  7. h[m, n] = Sum for all k, l {g[k, l] f[m+k, n+l]} (taken from James Hayes slide)


Results of the image filtering:

Below are the set of images and their filtered images for various filters.
Original Image
Box filter
Gaussian blur filter
Sobel filter
High pass filter
Laplacian filter


II: Frequency components and their characteristics:

An experiment was done on the blurred images and their frequency domains. It is seen that the low frequency components are preserved in the blurring process and further blurring leads to sharp low frequency components. There is a big change in the blur effect that looses all the high frequency components of the image.
Original Image
Gaussian blur with thresh_freq = 4
Gaussian blur with thresh_freq = 6
Gaussian blur with thresh_freq = 8
Gaussian blur with thresh_freq = 10


III: Created Hybrid images:



With cutoff frequency = 5
Low frequency image
High frequency image
Hybrid image


With cutoff frequency = 8
Low frequency image
High frequency image
Hybrid image


With cutoff frequency = 8
Low frequency image
High frequency image
Hybrid image


With cutoff frequency = 7
Low frequency image
High frequency image
Hybrid image


With cutoff frequency = 4
Low frequency image
High frequency image
Hybrid image

Conclusion:

Image filter is implemented and frequency changes of the images are analysed with the help of Fast fourier transforms. Hybrid images are formed for the image data provided. Hybrid images require careful selection of images for the fusion process to succeed and have an impact. It doesn't seem to work for the images whose field of view are pretty high (like landscapes).