# Assignment 0: Hybrid Images

## Contents

### Assignment Due: Sep 12, 2011

(Look at image on right from very close, then from far away.)

Credits: Assignment originally developed by Derek Hoiem.

## Overview

The goal of this assignment is to create hybrid images using the approach described in the SIGGRAPH 2006 paper by Oliva, Torralba, and Schyns. Hybrid images are static images that change in interpretation as a function of the viewing distance. The basic idea is that high frequency tends to dominate perception when it is available, but, at a distance, only the low frequency (smooth) part of the signal can be seen. By blending the high frequency portion of one image with the low-frequency portion of another, you get a hybrid image that leads to different interpretations at different distances.

## Details

This project is intended to familiarize you with image filtering and frequency representations. Here, Derek has included two sample images (of himself and his former cat Nutmeg) and some starter code that can be used to load two images and align them. The alignment is important because it affects the perceptual grouping (read the paper for details).

First, you'll need to get a few pairs of images that you want to make into hybrid images. You can use the sample images for debugging, but you should use your own images in your results. Then, you will need to write code to low-pass filter one image, high-pass filter the second image, and add (or average) the two images. For a low-pass filter, Oliva et al. suggest using a standard 2D Gaussian filter. For a high-pass filter, they suggest using the impulse filter minus the Gaussian filter (which can be computed by subtracting the Gaussian-filtered image from the original). The cutoff-frequency of each filter should be chosen with some experimentation.

For your favorite result, you should also illustrate the process through frequency analysis. Show the log magnitude of the Fourier transform of the two input images, the filtered images, and the hybrid image. In Matlab, you can compute and display the 2D Fourier transform with with: imagesc(log(abs(fftshift(fft2(gray_image)))))

Try creating a variety of types of hybrid images (change of expression, morph between different objects, change over time, etc.).

## Extra Credit

Implement the Laplacian pyramid of Burt and Adelson and then use it to perform image interpolation and/or image blending as described by Ogden, Adelson, Bergen and Burt.

## How to access Matlab

Using the username and password that we provide, you can log into the Windows PCs in 199 Cory or the Linux PCs in 330 Soda and run /share/b/bin/matlab from the command line. This will open Matlab for you. You can find more information on how to run Matlab on this website.

## How to create your wiki page

Begin by creating a new wiki page for this assignment. The title of the page should be of the form:

A0-FirstnameLastname.

Replace Firstname and Lastname with your real first and last names. You can create the page by entering a url of the following form into your browser:

http://vis.berkeley.edu/courses/cs294-69-fa11/wiki/index.php/A0-FirstnameLastname

To upload images to the wiki, first create a link for the image of the form [[Image:image_name.jpg]] (replacing image_name.jpg with a unique image name for use by the server). This will create a link you can follow that will then allow you to upload the image. Alternatively, you can use the "Upload file" link in the toolbox to upload the image first, and then subsequently create a link to it on your wiki page.

## Deliverables

Add a link to your finished assignment here. The page you create should include a few images you created using your algorithms. Show both the input images and the resulting hybrid. If you implement extra credit describe briefly describe what you did.

Once you are finished editing the page, add a link to it here with full name as the link text. The wiki syntax will look like this: *[[A0-FirstnameLastname|Firstname Lastname]]. Hit the edit button for this section to see how I created the link for my name.