Introduction to Wavelets

  • Fourier Transform: Basis functions are sinusoids.
  • Wavelets: Based on small waves (wavelets) of varying frequency and limited duration. These account for both frequency and location of that frequency.
  • Temporal Information: Wavelets capture temporal information in addition to frequency, making them localized in both time and frequency domains. Unlike the Fourier Transform, which uses oscillating functions that exist across infinite duration, wavelets decay to zero.
  • Multiresolution Theory: An approach to signal processing concerned with representing and analyzing images at different resolutions. Features not prominent at one level might be easily detected at another.

Comparison with Fourier Transform

  • Fourier Transform: Analyzes signals by converting them into a continuous series of sine and cosine functions, each with constant frequency, amplitude, and infinite duration.

  • Wavelets:

    • Deal with real-world signals, which are finite and can have abrupt changes.

    • Based on a mother wavelet, denoted by .

    • Wavelet Transform: Converts a signal into a series of wavelets.

    • Basis functions are created by scaling and shifting the mother wavelet:

      where:

      • : Translation (location of wavelet)
      • : Scaling (governs frequency, goes in denominator. Bigger means longer wavelet).
  • Advantages of Wavelets:

    • More Efficient Storage: Signals processed by wavelets can theoretically be stored more efficiently.
    • Better Approximation: Wavelets with rough edges can better approximate real-world signals.
    • Information Movement: Wavelets move information around rather than deleting it, allowing for better noise separation, separating the detail/noise and the average. Expressed as the sum and differences.
      • Image: Signal defined by pixel data.
      • Average and Detail: Represented by sum and difference of pixels.
      • Filters: Low-pass filter for average, high-pass filter for detail.

Multiresolution Analysis

  • Concept: Representation and analysis of images at more than one resolution.
  • Feature Detection: Enables detection of features at different scales.
    • Finest scale: Average and detail computed by sum and difference of neighboring pixels.
    • Coarser levels: Created recursively by taking the sum and difference of the previous levels.

Background

  • Image Objects: Connected regions of similar texture and intensity.
  • Resolution and Object Size:
    • High resolution: For small objects.
    • Coarse resolution: For large objects.

Wavelet Properties (Page 2 of PDF)

  • Images have local variations. It’s difficult to model variations over entire image.

  • Two key properties: Admissibility and Regularity.

  • Admissibility

    • Mathematically expressed as:

      where:

      • : Wave in the time domain.
      • : Fourier transform of .
    • In Practice, admissibility criterion can be simplified to:

      , or equivalently, .

    Implication: The wavelet transform must integrate to zero. The average value in time domain must be 0. It’s well localized.

    • Wavelet defined between .
    • Provides basis functions .
    • is a set of Linearly Independant functions, to form .
      • : Compression
      • : Shifting
      • : coefficient
      • , defined over interval where , signal is shifted.
      • , defined over , signal is compressed.
  • Regularity

    • Ensures the wavelet transform decreases quickly with decreasing scale.
    • The wavelet function should be smooth and concentrated in both time and frequency.
  • Wave and let: Admissibility forms the wave component, Regularity forms the let component, which implies a fast decay.

Image Pyramids (Page 2 of PDF)

  • Structure: Represent images at multiple resolutions. A collection of decreasing resolution images arranged in a pyramid shape.
  • Highest Resolution: At the pyramid base (Level ).
  • Resolution and Size: Decrease as you move up the pyramid.
  • Base Level: Size .
  • General Level size: , .
  • Number of Pixels:
graph TD
    subgraph Pyramid
        Base["Base (Level J) - 2<sup>J</sup> x 2<sup>J</sup>"] --> Level1["Level 1"]
        Level1 --> Level2["Level 2"]
        Level2 --> ...[...]
        ... --> Apex["Apex (Level 0)"]
    end
    style Base fill:#ccf,stroke:#333,stroke-width:2px
    style Apex fill:#f9f,stroke:#333,stroke-width:2px

  • Building Image Pyramids (Iterative Process)

    1. Compute Reduced-Resolution Approximation: Filter and downsample (by a factor of 2) the level input image. Place the result at level of the approximation pyramid.
    2. Create Estimate of Level j Input: Upsample and filter the reduced resolution approximation from step 1. The resulting prediction image has the same dimensions as the level input.
    3. Compute Difference: Subtract the prediction image (step 2) from the input (step 1). Place the result in level of the prediction residual pyramid.
  • After iterations: Level approximation output is placed in the pyramid at level .

  • Types of Pyramids (based on filters):

    • Mean pyramids (neighborhood averaging)
    • Gaussian pyramids (lowpass Gaussian filtering)
    • Subsampling pyramids (no filtering)
    • Filter can be based on: Nearest, Bilinear, Bicubic.

Upsampling and Downsampling

  • Upsampling:

    • Doubles the spatial dimensions of approximation images.

    • Given a 1D sequence , the upsampled sequence is:

    f_{2\uparrow}(n) = \begin{cases} f(n/2) & \text{if } n \text{ is even} \ 0 & \text{otherwise} \end{cases}$$

    Insert a 0 after every value in sequence.
    
  • Downsampling:

    • Halves the spatial dimensions of the prediction images.

    • Given by:

      Discard every other sample.

Orthogonality and Orthonormality (Page 6 of PDF)

  • Orthogonality: Inner products of wavelets are zero.

  • Orthogonal Basis: Formed by wavelets for the space of admissible functions. Leads to a simple formula for the coefficient :

    Multiplying both sides by and integrating, we get, using orthogonality:

  • Biorthogonality Condition:

    • If , the inner product is 0
    • If , inner product is which is the unit discrete impulse function.
  • Orthonormality: Used in subband coding to develop the fast wavelet transform.

    Orthonormal filters satisfy:

    implies number of coefficients must be even is related to by order reversal and modulation. and are order-reversed versions of and .

    Orthonormal filter bank developed by the impulse response of a single filter, called Prototype.

From 1D to 2D Filters

  • Apply downsampling twice, results in four subbands.
    • Approximation
    • Vertical Detail
    • Horizontal Detail
    • Diagonal Detail

Haar Wavelet (Page 7 of PDF)

  • Oldest and simplest orthonormal wavelet.

  • Expressed in matrix form:

    where:

    • : image matrix, .
    • : Haar transformation matrix, contains basis functions .
    • : Resulting transform.
  • Haar basis functions are defined on continous closed interval where ,

  • is not symmetric.

  • H is created by: or for , and for

  • Haar basis functions:

    h_k(z) = h_{pq}(z) = \frac{1}{\sqrt{N}} \begin{cases} 2^{p/2} & (q-1)/2^p \le z < (q-0.5)/2^p \\ -2^{p/2} & (q-0.5)/2^p \le z < q/2^p \\ 0 & \text{otherwise}, \quad z \in [0, 1] \end{cases}$$
  • The -th row of an Haar Matrix, contains the elements of for . For , first row of matrix is for which is . Second Row, compute for : where , then and . Resulting matrix is:

Haar Scaling and Wavelet Functions (Page 8)

  • one dimension, to .

  • Haar scaling function:

  • Haar wavelet function:

  • Haar scaling (averaging, lowpass filter) function at level 0:

  • Translation by :

graph LR
    A["φ(x)"] --> B["φ<sub>j</sub>(x)"]
  • Coefficients of f: = Average of f over .

  • Approximate Reconsctruction:

    • Ideally, get finer scale for sampling.
    • In Images, smallest scale is one pixel and we start at this level. Sum and differences of neighboring pixels are at the finest scale. *Go to a coarser level using the family: Signals are at Level 1:
  • Averaging at larger scale leads to loss of information.

  • Lost Detail:

    • is at Level 0.
    • Detail Preserved by new coefficient: (Highpass Filter)
    • Haar wavelet Average () and Detail () coefficients at Level 1:

Extension of Haar Wavelet to 2D Signal (Page 10)

  • 2D Sample (Square with 4 Areas)
  • represents the signal coefficients.
  • center coordinates, which are .
graph TD
    subgraph Square
        Q1["Q<sup>(0)</sup><sub>2i,2j</sub>"] -- "(2i, 2j)" --> Q2["Q<sup>(0)</sup><sub>2i,2j+1</sub>"]
        Q2 -- "(2i, 2j+1)" --> Q3["Q<sup>(0)</sup><sub>2i+1,2j+1</sub>"]
        Q3 -- "(2i+1, 2j+1)" --> Q4["Q<sup>(0)</sup><sub>2i+1,2j</sub>"]
        Q4 -- "(2i+1, 2j)" --> Q1
    end
style Q1 fill:#ccf,stroke:#333,stroke-width:2px
style Q2 fill:#ccf,stroke:#333,stroke-width:2px
style Q3 fill:#ccf,stroke:#333,stroke-width:2px
style Q4 fill:#ccf,stroke:#333,stroke-width:2px
  • Haar coefficient:

    where is the characteristic of at level 0:

    with,

    Haar coefficient at level 1 is given by:

  • Average and detail coefficients:

  • Adding the coefficients (Page 11):

    Table

k0123
l
2i1111
2i+111-1-1
p
2j1-11-1
2j+11-1-11
$d_{i,j,k}^{(1)} = \int f(x,y) \psi_{(i,j,k)}^{(1)}(x,y)dxdy$
    *$k=0$ Corresponds to:*
    $\phi_{(2i,2j)}^{(1)}(x,y) = \frac{1}{4}\phi(\frac{1}{2}x-i, \frac{1}{2}y-j)$

Discrete Wavelet Transform (DWT) (Page 11)

  • Continuous Wavelet Transform (CWT): Redundant because the transform is calculated by continuously shifting a continuously scalable function over a signal and calculating correlation.

  • Discrete Form: Usually, a piecewise continuous function, sample the time-scale at discrete levels.

  • Wavelet Series Decomposition: Transforming a continous signal into a series of coefficients.

  • Scaling function can be expressed in wavelets from to .

  • Adding a wavelet: New scaling function, with spectrum twice as wide.

  • Two-scale relation:

    Scaling Function (average) at given scale can be expressed by translated functions at next smaller scale (smaller scale = more detail).

Subsampling Property (Page 12)

  • Step size of 2 for scaling and wavelet filters.
  • Each filter bank iteration halves sample number.

Implementation of Haar Wavelets (Page 12)

  • Iteration of Filters with rescaling.

  • Filter Bank: Set of Filters.

  • Averaging and detail filter implemented by filtering matrices and .

  • and : Transpose of and

  • : Identity Matrix of

  • Properties:

  • Signal: Vector of length .

  • Filtering process: Includes downsampling (), decomposes into (block average) and (detail):

Reconstruction: Discarding achieves lossy compression

Applying to image: an matrix of pixels. Apply the filter to , new image : Matrix:

Four Matrices: (Fully Averaged Picture) and are partially averaged and partially differenced pictures. (Fully Differenced Picture)

  • Synthesis Filter Bank (Reconstruction)

    • Orthogonal Filter Bank:
      • Synthesis Bank is inverse of Analysis Bank.
      • Analysis Bank: Filtering and Downsampling
      • Synthesis Bank: Reverses the order and performs Upsampling and Filtering.
  • Lossy Compression: Achieved by discarding the differenced pictures (setting the matrices to zero) and retaining only during reconstruction.

Other Wavelets

  • Haar wavelet transform may not be able to take advantage of the continuity of pixel values.
  • Other wavelets may perform better and achieve higher compression, especially for smooth textures.

JPEG 2000 Standard

  • Based on wavelets.

  • Scalable: Can be decoded in many ways. Truncating the codestream gives a lower resolution representation.

  • Computationally Demanding: Encoders and Decoders.

  • Artifacts: Produces ringing artifacts at low resolutions, near edges. JPEG produces blocking artifacts.

  • Comparison with standard JPEG

    • Better scalability and editability.
    • Superior compression.
  • Multiresolution Representation

    Uses DWT, to decompose image at different levels. Allows addition use, such as for presentation.
  • Progressive Transmission

    Efficient code stream organization. Progressive by: Pixel Accuracy (SNR Scalability) and Image Resolution. Quality improved by downloading more data bits. Web applications in mind.
  • Lossless and Lossy

    Choice of lossless and lossy compression in a single architecture.

  • Random Access

    Access to different Regions of Interest (ROI). Store different parts of the same picture at different qualities.

  • Error Resilience

    Robust to bit errors.

  • Flexible File Format

    Color-space information and metadata. High dynamic range support. Supports any bit depth, 16/32 bit floating point images. Transparency (alpha planes).

  • Color Components Transformation

    Transforms images from RGB to other colorspaces. Options: * Irreversible Color Transform Uses color space. Irreversible due to using floating point, and round-off errors. * Reversible Color Transform Modified color space. No quantization errors. Fully reversible. Transformation: Forward: Reverse: Chrominance components can be downscaled in resolution. Downsampling is done by separating images and dropping the finest scale.

  • Tiling

    Image is divided into a 2D array of samples, called components. Example: Color image with red, green, blue components. *Image and Components are decomposed into rectangular tiles. These are basic units. *All components forming a tile, stay together. Tiles can be any size, but usually, they are all the same in an image. Possible different sizes in bottom right corner. Decoder needs less memory. Option: Decode only a subset of tiles. *Quality can decrease due to lower peak SNR. Many tiles may lead to blocking artifacts.

  • Wavelet Transform (in JPEG 2000)

    Tiles are analyzed using wavelets to create multiple decomposition levels. *Co