Skip to content
IT-703 (D) · Digital Image Processing/Quick Revision Short Notes

Digital Image Processing (IT-703 (D)) - Unit 1 Short Notes

UNIT 1: DIGITAL IMAGE PROCESSING FUNDAMENTALS

1. Digital Image Formation and Perception

Image Formation in the Human Eye

  • Structure: Light enters through the cornea, is focused by the lens onto the retina at the back of the eye.

  • Receptors: The retina contains two types of photoreceptors:

    • Rods: Highly sensitive to light, enable scotopic (low-light) vision, no color perception, concentrated in peripheral retina.

    • Cones: Less sensitive, require brighter light (photopic vision), responsible for color vision and high acuity. Three types (S, M, L) sensitive to short (blue), medium (green), and long (red) wavelengths.

  • Processing: Signals from receptors are processed by retinal neurons (bipolar, ganglion cells) before transmission via the optic nerve to the brain's visual cortex.

Brightness Adaptation and Discrimination

  • Brightness Adaptation: The eye's ability to adjust its sensitivity to a wide range of luminance levels (from starlight to bright sunlight). This is primarily achieved by the iris (adjusts pupil size) and biochemical changes in photoreceptors.

    • Dynamic Range: The human eye can cover ~10¹⁰ intensity levels, but at any instant, it can discriminate only about 30-100 levels in a given scene.
  • Brightness Discrimination (Contrast Sensitivity): The ability to distinguish between slight differences in luminance.

    • Weber's Law: For a given background intensity $I$, the just noticeable difference (JND) in intensity $\Delta I$ is proportional to $I$.

$$ \Delta I = k \cdot I $$

where $k$ is the **Weber fraction** (constant for a specific sensory modality).

*   **Weber-Fechner Law**: Perceived brightness $B$ is a logarithmic function of the incident intensity $I$.

$$ B = c \cdot \log(I) + b $$

where $c, b$ are constants. This explains why the eye adapts to a logarithmic rather than linear intensity scale.

Exam Tip: A very common 7-mark question. Be prepared to draw a labeled diagram of the eye and clearly differentiate between adaptation (global sensitivity change) and discrimination (local contrast detection).

2. Sampling and Quantization

Sampling

  • Definition: The process of converting a continuous spatial function $f(x, y)$ (image) into a discrete 2D array by capturing its values at a finite set of locations.

  • Sampling Grid: The set of points where samples are taken. The spacing between samples is the sampling interval.

  • Nyquist Rate (Shannon Sampling Theorem): To reconstruct a band-limited image perfectly from its samples, the sampling frequency must be at least twice the highest frequency present in the image.

$$ f_s \geq 2 \cdot f_{max} $$

where $$\displaystyle f_s $$ is the sampling rate (samples/unit distance).
  • Aliasing: Moiré patterns or false frequencies that appear when the sampling rate is below the Nyquist rate ($$\displaystyle f_s < 2f_{max} $$). Caused by high-frequency content being misinterpreted as lower frequency.

    Prevention: Use an anti-aliasing filter (low-pass filter) before sampling to band-limit the image.

Quantization

  • Definition: The process of converting the continuous range of intensity values (amplitude) of the sampled image into a finite set of discrete levels.

  • Gray-Level Resolution: The number of bits $L$ used for quantization. Number of gray levels $$\displaystyle G = 2^L $$.

  • Quantization Error (Noise): The difference between the actual continuous value and the quantized discrete value.

$$ e_q(x,y) = f_q(x,y) - f(x,y) $$

where $$\displaystyle f_q $$ is the quantized value.
Quantization Type Description Formula (for L levels)
Uniform Quantization Equal-sized intervals across the entire intensity range $$\displaystyle [0, I_{max}] $$. Interval size: $$\displaystyle \Delta = \frac{I_{max}}{L} $$
Non-Uniform Quantization Interval sizes vary. Smaller intervals in frequently used intensity ranges (e.g., dark regions), larger elsewhere. Used for compression. Designed based on input histogram (e.g., optimal quantizer).

Relationship: Sampling is spatial discretization (x,y coordinates). Quantization is amplitude discretization (intensity values). Both are required to create a digital image.

Exam Tip: Distinguish clearly between aliasing (spatial domain, due to sampling) and quantization error (gray-level domain). Be ready to calculate Nyquist rate given image resolution or highest spatial frequency.

3. Intensity Transformations

Point Operations (Gray-Level Transformations)

  • Definition: Operations where the output pixel value $s$ at coordinates $(x,y)$ depends only on the input pixel value $r$ at the same coordinates.

$$ s = T(r) $$

The transformation function $T$ is applied to every pixel independently.
  • Common Types:

    1. Image Negatives: $$\displaystyle s = L - 1 - r $$ (for $L$ gray levels).

    2. Log Transformations: $$\displaystyle s = c \cdot \log(1 + r) $$. Compresses high dynamic range, expands dark values.

    3. Power-Law (Gamma) Corrections: $$\displaystyle s = c \cdot r^\gamma $$. Used for monitor correction and general contrast adjustment.

    4. Contrast Stretching: Linear or piecewise-linear functions to increase contrast in a specific range (e.g., thresholding as an extreme case).

    5. Thresholding (Binarization): $$\displaystyle s = \begin{cases} 0 & \text{if } r < k \\ L-1 & \text{if } r \geq k \end{cases} $$

Histogram Processing

  • Histogram $$\displaystyle h(r_k) $$ of an image: Counts the number of pixels with intensity value $$\displaystyle r_k $$.

$$ p_r(r_k) = \frac{h(r_k)}{MN} = \text{Probability of intensity } r_k $$

where $M \times N$ is image size.
  • Histogram Equalization: A point operation that transforms the input histogram to a uniform output histogram.

    • Goal: Maximize contrast by spreading out the most frequent intensity values.

    • Transformation Function (for continuous case):

$$ s = T(r) = (L-1) \cdot \int_0^r p_r(w) \, dw $$

*   **Discrete Implementation**:

    1.  Compute input histogram $$\displaystyle p_r(r_k) $$.

    2.  Compute cumulative distribution function (CDF):

$$ cdf(r_k) = \sum_{j=0}^{k} p_r(r_j) $$

    3.  Map each input level $$\displaystyle r_k $$ to output level $$\displaystyle s_k = \text{round}((L-1) \cdot cdf(r_k)) $$.

> **Result**: Output histogram is approximately uniform.
  • Histogram Matching (Specification): Transform the image histogram to match a specified histogram $$\displaystyle p_z(z) $$.

    • Requires two steps: Equalize input image to uniform, then equalize specified histogram to uniform, and map between the two uniform distributions.

    • More complex than equalization, used for color transfer or standardizing image appearance.

Histogram Processing for Color Images

  • Approach 1: Process Each Channel Separately

    • Apply histogram operations (equalization, matching) independently to R, G, B channels.

    • Major Drawback: Can cause severe color hue shifts and unrealistic colors because it ignores correlation between channels.

  • Approach 2: Convert to a Decorrelated Color Space

    • Convert RGB to a space like HSV (Hue, Saturation, Value) or YCbCr.

    • Apply histogram processing only to the intensity (V or Y) channel.

    • Convert back to RGB.

    • Advantage: Preserves hue and saturation, avoids color distortion. This is the preferred method for intensity-based adjustments on color images.

Exam Tip: For color images, always mention the pitfall of processing RGB channels independently and the solution using HSV/YCbCr. Histogram equalization formula and CDF computation are frequently asked.

4. Noise in Digital Images

Noise Models

Noise is a random variable characterized by its Probability Density Function (PDF).

Noise Model PDF $p(r)$ Key Parameters Typical Source
Gaussian Noise $$\displaystyle p(r) = \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(r-\mu)^2}{2\sigma^2}} $$ Mean $\mu$, Variance $$\displaystyle \sigma^2 $$ Electronic circuit noise, sensor noise.
Rayleigh Noise $$\displaystyle p(r) = \begin{cases} \frac{2(r-a)}{b^2} e^{-\frac{(r-a)^2}{b^2}} & r \geq a \\ 0 & r < a \end{cases} $$ $a$ (mode), $b$ (scale) Range imaging, certain radar signals.
Erlang (Gamma) Noise $$\displaystyle p(r) = \frac{a^b r^{b-1} e^{-ar}}{(b-1)!} $$ $a$ (scale), $b$ (shape) Laser imaging.
Exponential Noise $$\displaystyle p(r) = ae^{-ar}, \quad r \geq 0 $$ $a$ (parameter) Certain radioactive decay measurements.
Uniform Noise $$\displaystyle p(r) = \frac{1}{b-a}, \quad a \leq r \leq b $$ $a, b$ (min, max) Quantization error (ideal).
Impulse (Salt-and-Pepper) Noise PDF: $$\displaystyle p(r) = \begin{cases} q & r = \text{min} \\ 1-2q & r = \text{med} \\ q & r = \text{max} \\ 0 & \text{otherwise} \end{cases} $$ Noise density $q$ (probability a pixel is corrupted) Defective memory cells, transmission errors.

Noise Parameter Estimation Approaches

The goal is to estimate noise parameters (e.g., $$\displaystyle \sigma^2 $$ for Gaussian noise) from a single noisy image.

  1. Local Statistics (Smooth Region Assumption):

    • Assumes existence of small flat/smooth regions where true image signal is nearly constant ($f(x,y) \approx c$).

    • In such a region, the sample variance of pixel values is an estimate of the noise variance $$\displaystyle \hat{\sigma}^2_n $$.

    • Method: Manually or automatically select a homogeneous ROI, compute $$\displaystyle \hat{\sigma}^2_n = \frac{1}{M} \sum (g_i - \bar{g})^2 $$, where $$\displaystyle g_i $$ are noisy pixels, $\bar{g}$ their mean.

  2. Histogram Analysis (Mode-Based):

    • For many noise models (especially Gaussian), the mode (peak) of the image histogram occurs where the signal is most frequent. The spread (standard deviation) of the histogram around this peak is dominated by noise.

    • Method: Find histogram peak $$\displaystyle r_{mode} $$. Estimate $$\displaystyle \hat{\sigma}_n $$ from the width of the histogram at half-height or via curve fitting to the assumed noise PDF.

  3. Robust Estimators (Median Absolute Deviation - MAD):

    • More robust to outliers (like salt-and-pepper noise) than standard deviation.

    • For Gaussian noise: $$\displaystyle \hat{\sigma}_n \approx 1.4826 \cdot \text{MAD} $$, where $$\displaystyle \text{MAD} = \text{median}(|g_i - \text{median}(g)|) $$.

  4. Wavelet-Based Methods:

    • Apply wavelet transform. Noise energy is concentrated in high-frequency subbands (details).

    • Estimate $$\displaystyle \sigma_n $$ from the median of the finest scale wavelet coefficients: $$\displaystyle \hat{\sigma}_n = \frac{\text{median}(|w_{i,j}|)}{0.6745} $$ (for 1D, similar for 2D).

Exam Tip: For a 7-mark question on noise estimation, structure your answer: (1) State the challenge (single image, unknown signal), (2) Describe 2-3 methods (Local Statistics is most fundamental), (3) Mention assumptions and limitations of each. Be prepared to derive or state the MAD estimator formula.

Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in