Image Formation and Filtering
Date: September 12, 2024
Lecture Duration: 1.5 hours
Topic Overview: This lecture introduced the fundamental concepts of image formation, starting from the geometry of the pinhole camera and moving through signal sampling theory. We then transitioned to practical image processing, covering pixel-level analysis (histograms) and neighborhood operations (linear and non-linear filtering). —
1. Introduction to Image Formation
We began with an overview of image formation concepts, including the pinhole camera model. The pinhole camera projection was visualized using Python.
Pinhole Camera Model
The pinhole camera model is a simple mathematical model that describes the relationship between coordinates in 3D space and their projection onto a 2D image plane. It assumes that light rays pass through a single point (the pinhole) before hitting the image plane.
Key concepts include:
- Focal Length: The distance between the pinhole and the image plane.
- Projection: 3D points \((X, Y, Z)\) are projected to 2D points \((x, y)\) using similar triangles: \(x = f \cdot \frac{X}{Z}\), \(y = f \cdot \frac{Y}{Z}\).
2. Sampling and Aliasing
Digital images are discrete representations of continuous scenes. This discretization involves sampling (spatial discretization) and quantization (intensity discretization).
Aliasing occurs when the sampling rate is insufficient to capture the high-frequency content of the signal (Nyquist-Shannon sampling theorem). In images, this can manifest as jagged edges (jaggies) or Moiré patterns.
3. Pixel Operations and Histograms
Before manipulating image structure, we looked at analyzing and modifying individual pixels (Point Processing).
- Histograms & CDF: We visualized the distribution of pixel intensities to understand image contrast and exposure.
- Grayscale Conversion: We discussed why a weighted sum of RGB channels (\(0.299R + 0.587G + 0.114B\)) matches human perception better than a simple average.
- Brightness & Contrast: We implemented linear transformations (\(\alpha \cdot x + \beta\)) to adjust the dynamic range of images.
4. Spatial Filtering and Denoising
The final part of the lecture introduced Neighborhood Operations, where a pixel’s value is determined by its surrounding neighbors using Convolution.
- Linear Filters: We compared Box Filters (Mean) vs. Gaussian Filters to understand smoothing and why Gaussian kernels are preferred for natural blurring.
- Non-Linear Filters: We explored advanced techniques like Median Filtering (for removing salt-and-pepper noise) and Bilateral Filtering (for smoothing noise while preserving edges).
Interactive Demonstration
Below is the complete Jupyter Notebook used in class. It contains the Python implementation for the pinhole camera projection, aliasing simulations, and the full suite of filtering algorithms.