Lecture 2: Image Formation
Image Intensity
Models pixel intensity as the product of surface reflectance $R(x, y)$ and scene illumination $L(x, y)$.
\[I(x, y) = R(x, y) \cdot L(x, y)\]
Linear Mapping (8-bit grayscale)
Maps raw intensity value $I$ to an 8-bit integer grayscale range $[0, 255]$.
\[\text{pixel\_value} = \left(\dfrac{I}{1000}\right) \cdot 255\]
Perspective Projection
Maps 3D scene point $(X, Y, Z)$ to 2D pixel coordinates $(u, v)$ with focal length $f$.
\[u = f \cdot \dfrac{X}{Z}, \qquad v = f \cdot \dfrac{Y}{Z}\]
Magnification
Defines the ratio of image size $y'$ to object size $y$, equivalent to focal length $f$ divided by depth $z$.
\[m = \dfrac{y'}{y} = \dfrac{f}{z}\]
Field of View (FOV)
Calculates the angular extent of the scene imaged by a sensor of width $w$ with focal length $f$.
\[\text{FOV} = 2 \cdot \arctan\!\left(\dfrac{w}{2f}\right)\]
Radial Distortion
Models distortion of coordinates due to lens shape using coefficient parameters $k_1, k_2, k_3, \dots$.
\[r_d = r \cdot (1 + k_1 r^2 + k_2 r^4 + k_3 r^6 + \dots)\]
Lecture 3: Digital Images
RGB to HSV/HSL (Base)
Computes the color channel extrema and the HSL luminance $L$.
\[V_{max} = \max(R,G,B), \quad V_{min} = \min(R,G,B), \quad L = \dfrac{V_{max}+V_{min}}{2}\]
RGB to HSV Saturation
Computes color saturation (purity) for the HSV representation space.
\[S = \dfrac{V_{max}-V_{min}}{V_{max}} \quad (\text{if } V_{max}>0,\ \text{else } 0)\]
RGB to HSL Saturation
Computes color saturation for the HSL representation space based on luminance value $L$.
\[\begin{aligned} S &= \dfrac{V_{max}-V_{min}}{V_{max}+V_{min}} & (\text{if } L<0.5) \\ S &= \dfrac{V_{max}-V_{min}}{2-(V_{max}+V_{min})} & (\text{if } L\ge 0.5) \end{aligned}\]
Hue Calculation (Both HSV & HSL)
Calculates the circular color hue angle $H$ in degrees $[0, 360]$.
\[\begin{aligned} H &= 60 \cdot \dfrac{G-B}{V_{max}-V_{min}} & (\text{if } V_{max}=R) \\ H &= 120 + 60 \cdot \dfrac{B-R}{V_{max}-V_{min}} & (\text{if } V_{max}=G) \\ H &= 240 + 60 \cdot \dfrac{R-G}{V_{max}-V_{min}} & (\text{if } V_{max}=B) \end{aligned}\]
Lecture 4: Image Enhancement
General Point Operation
Applies a mapping function $T$ directly to individual pixel values.
\[g(x) = T(f(x)) \quad \text{or} \quad I'(u,v) = f\big(I(u,v)\big)\]
Brightness Shift
Offsets pixel values by a constant scale $k$.
\[I'(u,v) = I(u,v) + k\]
Image Differencing
Measures changes by subtracting pixel values of aligned frames.
\[D(u,v) = I_1(u,v) - I_2(u,v) \quad \text{or} \quad D_t(u,v) = \left| I_t(u,v) - I_{t-1}(u,v) \right|\]
Binary Motion Mask
Segments moving regions by thresholding the image difference at level $T$.
\[M_t(u,v) = 1 \ (\text{if } D_t(u,v) \ge T), \quad \text{else } 0\]
Contrast Scaling
Multiplies intensity values by factor $\alpha$ and clamps to the valid range.
\[I'(u,v) = \text{clamp}\big(\alpha \cdot I(u,v)\big)\]
Uniform Quantization
Discretizes continuous or deep color channels into intervals of step size $\Delta$.
\[I'(u,v) = \left\lfloor \dfrac{I(u,v)}{\Delta} \right\rfloor \cdot \Delta \qquad \text{where} \quad \Delta = \dfrac{L}{256}\]
Inversion
Inverts pixel values to create negative representations.
\[s = 255 - r \quad \text{or} \quad f_{invert}(a) = a_{max} - a\]
Piecewise Contrast Stretching
Stretches contrast linearly between specific control points.
\[a' = \left[\dfrac{a'_{high} - a'_{low}}{a_{high} - a_{low}}\right] \cdot (a - a_{low}) + a'_{low}\]
Histogram Equalization
Transforms pixel intensities to follow a uniform probability distribution.
\[f_{eq}(a) = \big(H(a) - H_{min}\big) \cdot \left[\dfrac{M \cdot N - H_{min}}{K-1}\right] \quad \text{or} \quad a' = \left\lfloor (K-1)\cdot \text{CDF}(a) \right\rfloor\]
Histogram Matching
Transforms an image so its histogram matches a target reference distribution.
\[a' = P_R^{-1}\big(P_A(a)\big)\]
Global Thresholding
Binarizes an image using a single global threshold value $a_{th}$.
\[I'(u,v) = a_0 \ (\text{if } I(u,v) < a_{th}), \quad \text{else } a_1\]
Alpha Blending
Linearly blends two images using a weighting coefficient $\alpha \in [0, 1]$.
\[I_{blend} = \alpha \cdot I_{left} + (1-\alpha) \cdot I_{right}\]
Gamma Definition
Defines the output gamma exponent $\gamma$ as the ratio of change in brightness to density.
\[\gamma = \dfrac{\Delta B}{\Delta D}\]
Gamma Correction
Adjusts non-linear monitor characteristics using power-law curves.
\[b = f_\gamma(a) = a^\gamma\]
Lecture 5: Image Filtering
General Linear Filtering
Computes new pixel values as a weighted linear combination of neighborhood pixels.
\[g[m,n] = \sum_{k,l} h[k,l] \cdot f[m+k, n+l]\]
Cross-Correlation
Slides a filter kernel directly over the local neighborhood.
\[G[i,j] = \sum_u \sum_v H[u,v] \cdot F[i+u, j+v] \quad \text{or} \quad G = H \otimes F\]
Convolution
Slides a filter kernel over the neighborhood after flipping the kernel coordinates.
\[G[i,j] = \sum_u \sum_v H[u,v] \cdot F[i-u, j-v] \quad \text{or} \quad G = H \star F\]
Associativity of Convolution
States that multiple convolving kernels can be combined first to optimize execution.
\[(f \star h_1) \star h_2 = f \star (h_1 \star h_2)\]
1D Discrete Derivative
Approximates the first derivative using central finite differences.
\[f'(x) = \dfrac{f(x+1) - f(x-1)}{2}\]
Derivative of Gaussian (DoG) Property
Shows that convolving an image with a differentiated Gaussian equals convolving and then differentiating.
\[\dfrac{\partial}{\partial x}(G \star I) = \left(\dfrac{\partial G}{\partial x}\right) \star I\]
Laplacian of Gaussian (LoG)
Combines Gaussian smoothing with the Laplacian operator to highlight edges.
\[\nabla^2 (G \star I) = (\nabla^2 G) \star I\]
DoG Approximation
Approximates the computationally expensive LoG filter using the difference of two Gaussians.
\[\text{DoG} = G_{\sigma_1} - G_{\sigma_2}\]
Lecture 6: Image Analysis
Laplacian Pyramid Residual
Calculates detail information by subtracting the expanded coarser representation.
\[L_l = G_l - \text{Expand}(G_{l+1})\]
Laplacian Pyramid Reconstruction
Reconstructs coarser details into the original image level.
\[G_l = \text{Expand}(G_{l+1}) + L_l\]
Sinusoidal Signal
Models a standard sinusoidal wave signal in 1D.
\[f(x) = A \cdot \sin(\omega x + \varphi)\]
Practice Assignments & PAs
Gradient Magnitude (PA3)
Combines orthogonal directional gradients to calculate overall edge magnitude.
\[G = \sqrt{G_x^2 + G_y^2}\]
Match the midterm formula name on the left to the correct mathematical equation on the right. Click a formula name, then click its matching mathematical expression.
Correct matches: 0 / 5
1. Perspective Projection & Magnification Calculator
Compute projected image coordinates $(u, v)$ and magnification $m$ based on object location $(X, Y, Z)$ and focal length $f$.
Focal Length (f)50
Object X Pos20
Object Y Pos-15
Object Depth (Z)150
2. RGB to HSV/HSL Conversion Calculator
Adjust the Red, Green, and Blue input channels to calculate Hue ($H$), HSV/HSL Saturation ($S$), and luminance metrics.
Red Channel (R)180
Green Channel (G)90
Blue Channel (B)220
3. Uniform Quantization & Gamma Correction
Input pixel value to compute Uniform Quantization with interval size $\Delta$ and Gamma Correction with exponent $\gamma$.
Input Pixel Value (0-255)128
Quantization Step (Δ)32
Gamma Exponent (γ)1.8
4. 1D Discrete Derivative & Sobel Edge Magnitude
Compute 1D Central Difference Derivative and 2D Sobel Edge Magnitude $G = \sqrt{G_x^2 + G_y^2}$.
f(x + 1)160
f(x - 1)40
Sobel Gx Response120
Sobel Gy Response-90