CHAPTER 5 AND 6

Digital Image Processing tutorial · PySpark.in

CHAPTER 5 – IMAGE RESTORATION & RECONSTRUCTION

(From pages 317–398)

Image Restoration = Recovering an image that has been degraded
Objective, model-based, mathematical.
Different from enhancement (which is subjective).


5.1 IMAGE DEGRADATION / RESTORATION MODEL

The degradation process is modeled as:

Spatial domain:

g ( x , y ) = h ( x , y ) ∗ f ( x , y ) + η ( x , y ) g(x,y)= h(x,y) * f(x,y) + \eta(x,y)

Where:

Frequency domain:

G ( u , v ) = H ( u , v ) F ( u , v ) + N ( u , v ) G(u,v)= H(u,v)F(u,v)+N(u,v)

This is the foundation of all restoration techniques.


5.2 NOISE MODELS

(From pp. 318–327)

Common noise types:

1. Gaussian Noise

2. Rayleigh Noise

Occurs in radar images.

3. Gamma / Erlang Noise

Occurs when many small processes add.

4. Exponential Noise

5. Salt–and–Pepper Noise

6. Uniform Noise


5.3 RESTORATION USING SPATIAL FILTERS

(Noise only)

1. Mean Filters

2. Order-Statistics Filters


5.4 PERIODIC NOISE REMOVAL (Frequency Domain)

(From p. 340)

Periodic noise appears as sharp spikes in Fourier domain.

Use:

Steps:

  1. Compute DFT

  2. Identify spikes

  3. Place notches

  4. Apply filter

  5. Compute IDFT


5.5 LINEAR, POSITION-INVARIANT DEGRADATION

(From pp. 348–351)

If blur is uniform and linear,

g ( x , y ) = h ( x , y ) ∗ f ( x , y ) g(x,y)= h(x,y) * f(x,y)

Important: Spatial invariance → convolution → simple frequency multiplication.


5.6 ESTIMATING THE DEGRADATION FUNCTION

(From p. 352)

Methods:

  1. Observation – look at PSF

  2. Experimentally – use test patterns

  3. Mathematical modeling – motion blur, out-of-focus blur

  4. Using inverse filtering concepts


5.7 INVERSE FILTERING

(From p. 356)

Idea:

F ^ ( u , v ) = G ( u , v ) H ( u , v ) \hat F(u,v)= \frac{G(u,v)}{H(u,v)}

Very sensitive to noise → not used alone.


5.8 WIENER FILTER (MMSE FILTER)

(From p. 358)

A robust alternative.

F ^ ( u , v ) = H ∗ ( u , v ) ∣ H ( u , v ) ∣ 2 + S η ( u , v ) S f ( u , v ) G ( u , v ) \hat F(u,v)= \frac{H^*(u,v)}{|H(u,v)|^2 + \frac{S_\eta(u,v)}{S_f(u,v)}}G(u,v)

Where:


5.9 CONSTRAINED LEAST SQUARES FILTER

(From p. 363)

Uses Laplacian for smoothness.

F ^ ( u , v ) = H ∗ ( u , v ) ∣ H ( u , v ) ∣ 2 + γ P ( u , v ) G ( u , v ) \hat F(u,v)= \frac{H^*(u,v)}{|H(u,v)|^2+\gamma P(u,v)} G(u,v)

Where P(u,v) is Laplacian in frequency domain.

Better than inverse; slightly different than Wiener.


5.10 GEOMETRIC MEAN FILTER

(From p. 367)

Generalizes Wiener + Inverse:

F ^ = [ H ∗ ∣ H ∣ 2 ] a [ H ∗ ∣ H ∣ 2 + S η S f ] 1 − a G \hat F= \left[\frac{H^*}{|H|^2}\right]^a \left[\frac{H^*}{|H|^2 + \frac{S_\eta}{S_f}}\right]^{1-a} G

When:


5.11 IMAGE RECONSTRUCTION FROM PROJECTIONS

(From pp. 368–398)

Important for Computed Tomography (CT).

Key steps:

  1. Take multiple projections (raysums)

  2. Backprojection – smear each projection

  3. Filtered Backprojection (FBP)

    • Convolution with a filter

    • Removes blurring

Used in medical imaging widely.


CHAPTER 6 – COLOR IMAGE PROCESSING

(Pages 399–458)

Two motivations:

  1. Humans perceive thousands of colors

  2. Color is a powerful descriptor → segmentation, recognition


6.1 COLOR FUNDAMENTALS

(From pp. 400–404)

Visible Spectrum: 400–700 nm

Achromatic Light

Chromatic Light

Three quantities:

  1. Radiance – energy leaving source

  2. Luminance – perceived brightness

  3. Brightness – subjective sensation


6.2 COLOR MODELS

(From pp. 405–420)

Popular color models:

  1. RGB – hardware, monitors

  2. CMY/CMYK – printing

  3. HSI (Hue, Saturation, Intensity) – human perception

  4. CIE XYZ, Chromaticity diagram

    • Based on color matching experiments

    • Fundamental for representing color

    • Equation:

      x + y + z = 1 x+y+z=1

Color Gamut

Triangle inside chromaticity diagram shows all colors a device can display (Fig. 6.6).


6.3 PSEUDOCOLOR IMAGE PROCESSING

(From p. 420)

Assigning colors to grayscale images.

Methods:

  1. Intensity Slicing

    • Assign color to specific ranges.

  2. Color Coding

    • Map grayscale value → color based on lookup table.

Used in: Medical imaging, astronomy, satellite imagery.


6.4 BASICS OF FULL-COLOR IMAGE PROCESSING

(From pp. 429–430)

Two approaches:

  1. Per-component processing

    • Process R, G, B separately

    • Works only if operations are independent

  2. Vector processing

    • Treat a pixel as a 3D vector

    • Needed for:

      • Median filtering

      • Smoothing

      • Sharpening

      • Segmentation


6.5 COLOR TRANSFORMATIONS

(From p. 430)

General model:

s i = T ( r i ) s_i = T(r_i)

Includes:

Used for fixing over/under-saturation, key type, etc.


6.6 COLOR IMAGE SMOOTHING & SHARPENING

(From p. 442)

Two ways:

  1. Apply filters on each channel (R, G, B)

  2. Use vector filters on color voxels


6.7 USING COLOR IN IMAGE SEGMENTATION

(color-based clustering)

Popular methods:


6.8 NOISE IN COLOR IMAGES

(From p. 452)

• Noise may be independent across channels or correlated
• Use:


6.9 COLOR IMAGE COMPRESSION

(From p. 455)

• RGB converted to YCbCr (JPEG standard)
• Chrominance subsampling (4:2:0) to reduce data
• Quantization + entropy coding

All tutorials · Try the free PySpark compiler · Practice challenges