Back to Portfolio

🎨 Computational Photography, Computer Vision, & Image Processing

This page brings together a set of interactive algorithm visualizations designed to make classical image-processing techniques transparent. By exposing their internal structures— from bilateral grids to Hough parameter spaces—these demos reveal the computational and geometric principles behind filters, detectors, and transforms used throughout vision and graphics. (More computationally intensive algorithms will be showcased in a separate demo built on a higher-performance backend.)

📊 Bilateral Grid Filter

About Bilateral Grid

The bilateral grid is an efficient data structure for edge-preserving image filtering. It extends the 2D image into a 3D space where X and Y are spatial coordinates, and Z is the intensity/color dimension. Pixels are "splatted" into this 3D grid, accumulating in cells. The 3D visualization shows the actual grid structure: each point is a grid cell, its size represents accumulated weight (how many similar pixels cluster there), and its color shows the average color in that cell. Larger, brighter points = denser clusters of similar pixels in both space and color!

Input Image
Filtered Output
3D Grid Space - Size = Weight/Density (Drag to Rotate)
Grid Size: -
Active Clusters: -
Processing Time: -

📐 Hough Transform - Line Detection

About Hough Transform

The Hough Transform detects lines by mapping image space to parameter space (ρ, θ). Each point in the image contributes a sinusoidal curve in Hough space. Lines appear as bright spots where many curves intersect. Draw on the canvas to create lines and watch them appear in the Hough space in real-time!

Line Field Visualization Modes:
Dominant Direction - Shows the strongest line orientation at each point (current implementation)
Hough Accumulation - Stacks semi-transparent lines based on Hough space brightness (your suggestion)

How it works: For each pixel in Hough space (ρ, θ), we draw the corresponding line in image space. Brighter pixels in Hough space = more opaque lines. This creates a beautiful overlay showing all potential lines!
Drawing Canvas (Interactive)
Hough Space (ρ-θ)
Detected Lines
Lines Detected: 0
Hough Time: -

⭕ Hough Circle Transform - Circle Detection

About Hough Circle Transform

The Hough Circle Transform extends line detection to circles by using a 3D parameter space (x, y, r). Each edge point votes for possible circle centers at various radii. Circles appear as peaks in this 3D space. Draw circles or load an image to detect them in real-time!

How Circle Detection Works:
For each edge pixel at (x₁, y₁), we vote for all possible circle centers (x₀, y₀) at distance r:
x₀ = x₁ - r·cos(θ), y₀ = y₁ - r·sin(θ) for θ ∈ [0, 2π]

The 3D accumulator stores votes for each (x, y, r) combination. Peaks indicate detected circles!
Visualization Modes: Similar to line field, we can show dominant circles or accumulation overlay.
Drawing Canvas (Interactive)
Hough Space (Slice at r)
Detected Circles
Circles Detected: 0
Current Radius: 55
Circle Time: -

🎯 Generalized Hough Transform - Arbitrary Shape Detection

About Generalized Hough Transform

Detects arbitrary user-defined shapes with rotation and scale invariance! Draw a template shape, then the algorithm finds all instances of that shape in the target image, even if rotated or scaled. Uses an R-table to encode shape geometry.

How It Works (Ballard's Algorithm):
1. Template Creation: Extract edge points and gradient directions from your drawn shape
2. R-Table Construction: For each gradient angle φ, store vectors from centroid to edge points
3. Detection: For each edge in target image with gradient φ, vote for possible reference points
4. Scale & Rotation: Test multiple scales and rotations by transforming R-table vectors

Mathematical Formula:
For edge at (x, y) with gradient angle φ, vote for reference point:
(x_ref, y_ref) = (x, y) - s·R(θ)·r(φ)
where s = scale, R(θ) = rotation matrix, r(φ) = R-table vector for angle φ
Template Shape (Draw Here - or hit 'Clear Template' to redraw)
Target Image (Draw Here)
Detected Shapes (with rotation/scale)
Template Status: Not Created
Shapes Found: 0
Detection Time: -

🔬 Image Processing Filters

Comprehensive Collection

A comprehensive collection of common image processing algorithms, from basic operations to complex filters. Each filter includes a brief explanation of how it works!

📊 Basic Filters (O(n)):
Brightness/Contrast - Linear transform: out = α·in + β
Invert - Complement: out = 255 - in
Threshold - Binary: out = in > T ? 255 : 0
Posterize - Quantization: out = floor(in / step) · step

🎨 Convolution Filters (O(n·k²)):
Gaussian Blur - Weighted average with Gaussian kernel G(x,y) = e^(-(x²+y²)/(2σ²))
Sharpen - Unsharp mask: sharp = img + α·(img - blur)
Emboss - Directional derivative kernel highlights edges
Edge Enhance - High-pass filter emphasizes transitions

🔍 Edge Detection (O(n)):
Sobel - Gradient magnitude: G = √(Gx² + Gy²) using [-1,0,1] kernels
Canny - Multi-stage: Gaussian blur → Sobel → Non-max suppression → Hysteresis
Laplacian - Second derivative: ∇²f = ∂²f/∂x² + ∂²f/∂y²

🧬 Morphological Operations (O(n·k²)):
Dilate - Expand bright regions: max over kernel
Erode - Shrink bright regions: min over kernel
Open - Erode then dilate (removes noise)
Close - Dilate then erode (fills gaps)

🎭 Other Filters:
Median Filter - Non-linear: replaces with median of neighborhood (great for salt-pepper noise)
Unsharp Mask - Professional sharpening: sharp = original + amount·(original - blurred)
High-Pass Filter - Preserves high-frequency details: highpass = img - lowpass
Sepia - Vintage warm tone effect
Vignette - Darkens edges for focus
Pixelate - Mosaic effect by downsampling
Input
Processed
Current Filter: -
Processing Time: -