Hybrid Images

CS5670 Project 1 - Introduction to Computer Vision
Cornell University, Spring 2025

Look at the image from very close and then very far. What do you see?

This project implements image filtering functions to create hybrid images using the technique from the SIGGRAPH 2006 paper by Oliva, Torralba, and Schyns. Hybrid images are static images that change interpretation based on viewing distance - high frequencies dominate close viewing while low frequencies are visible from far away.

Hybrid Image Result
Move closer and farther from the screen to see the effect!

Project Details

Language: Python with NumPy
Key Concepts: Image filtering, Gaussian blur, frequency domain

Overview

The goal of this assignment was to write image filtering functions from scratch and use them to create hybrid images. The basic principle is that high frequency components tend to dominate perception when available, but at distance, only low frequency (smooth) components are visible. By blending the high frequency portion of one image with the low-frequency portion of another, we create images that change interpretation based on viewing distance.

Implementation

This project required implementing 5 core functions, each building on the previous:

  1. cross_correlation_2d
  2. convolve_2d
  3. gaussian_blur_kernel_2d
  4. low_pass
  5. high_pass

Image Filtering

Implemented cross-correlation and convolution from scratch using for loops and NumPy vectorization, without using any pre-built filtering functions. This provided fundamental understanding of how spatial filters work at the pixel level.

Gaussian Blur

Created a 2D Gaussian kernel generator that produces weighted averaging kernels for smooth blurring effects. The kernel size and standard deviation (sigma) control the amount of blurring.

Frequency Filtering

Implemented high-pass and low-pass filters using Gaussian blur. Low-pass filters remove fine details (keep coarse features), while high-pass filters retain only fine details by subtracting the blurred version from the original.

My Results

My Implementation Results

Parameters used:

Add your specific parameters here:
• right_size: 8.0
• left_size: 13.0
• right_sigma: 4.1
• left_sigma: 7.0
• mixin_ratio: 0.65
• scale_factor: 2.0
Original Left Image
Original Left Image
Z
Original Right Image
Original Right Image

Processing Steps

Low-Pass Filtered Image
Low-Pass Filtered
Blurred version (coarse features)
High-Pass Filtered Image
High-Pass Filtered
Edge details only

Final Hybrid Image at Different Scales

The effect becomes more apparent when viewing the image at different scales:

Full Size:
Full-size Hybrid Image
Half Size:
Half-size Hybrid Image
Quarter Size:
Quarter-size Hybrid Image

Key Learnings

Technical Details

Implementation Constraints

Forbidden Functions: No NumPy, SciPy, OpenCV, or other pre-built filtering functions allowed. Only basic operations like np.shape, np.zeros, np.transpose, np.flip, and np.pad were permitted.

Core Challenge: Implementing all filtering operations using for loops and NumPy vectorization to understand the underlying mathematics.