Title: Wavelet Analysis
1Image Processing, Computer Vision, and Pattern
Recognition
Fac. of Comp., Eng. Tech. Staffordshire
University
Wavelet Analysis
Dr. Claude C. Chibelushi
2Outline
- Introduction
- Image Pyramids
- Gaussian pyramid
- Wavelet pyramid
- Wavelet Transform
- Forward / inverse transform
- Filter coefficients
- Sample Applications
- Summary
3Introduction
- Multi-resolution (hierarchical) image processing
- Involves the creation of images at various
spatial resolutions (image pyramid) - high resolution image may contain irrelevant
details - low resolution image may omit or distort
significant details - most image features are often related across
resolution hierarchy - hence, judicious combination of information
contained in the pyramid levels may lead to
higher performance
4Image Pyramids
- Collection of images (same scene) of varying
resolution
- Possible techniques for varying resolution
- resolution reduction may be based on averaging
(low-pass filtering) and downsampling - resolution increase may use interpolation and
upsampling
5Image Pyramids
- Recursive filtering generates pyramid
- Many types of image pyramids
- Gaussian pyramid
- based on Gaussian (low-pass) filter
- Laplacian pyramid
- based on differences across levels of Gaussian
pyramid - wavelet pyramid
- based on wavelet transform
6Image Pyramids
- Gaussian pyramid
- (example 1-D three-level pyramid)
low res.
high res.
7Image Pyramids
- Three-level Gaussian pyramid
8Image Pyramids
- Two-level image pyramid from wavelet transform
B blurred H horizontal edge sensitivity V
vertical edge sensitivity HV horiz. vert. edge
sensitivity
9Wavelet Transform
- Example three-level image pyramid
10Wavelet Transform
- Based on filtering
- uses special pair of filters
- low-pass filter and high-pass filter
- decomposition
- image ? B1, H1, V1, HV1 (pyramid level 1)
- B1 ? B2, H2, V2, HV2 (pyramid level 2)
- B2 ? ...
- reconstruction right-hand-side ? left-hand-side
11Wavelet Transform
- Recursive filtering of input image with special
pair of filters - Quadrature Mirror Filter (QMF) pair
- low-pass filter and high-pass filter
- pass-bands mirrored about cut-off of low-pass
filter - separates signal into its low-frequency and
high-frequency components
12Wavelet Transform
- Convolution is afflicted by image-border problem
- possible solution image is assumed symmetric
about vertical and horizontal borders - mirror image to allow convolution near borders
- Recursive filtering generates pyramid
- total number of pixels equal to number in
original image - filtering of image usually implemented as 1D
convolution along rows and columns
13Wavelet Transform
- Low-pass filter generates blurred lower
resolution image (approximation image) from
higher resolution image - High-pass filter generates details (detail
image) required for reconstruction of higher
resolution image from lower resolution
approximation image - detail image refines approximation image
14Wavelet Transform
- Forward transform
- Procedure recursively apply QMF pair to image
- low-pass filter applied to higher resolution
image - generates approximation image
- high-pass filter applied to higher resolution
image - generates detail image
15Wavelet Transform
- Forward transform
- Procedure (ctd.)
- down-sample images output by QMF filters
(decimation discard every other pixel) - feed down-sampled approximation image into QMF
pair / down-sampler combination - generates approximation and detail images at next
lower-resolution - process repeated until desired lowest resolution
16Wavelet Transform
Lower resolution images
Higher resolution image
17Wavelet Transform
- Forward transform pseudo code
- / decompose image into given number of pyramid
levels / - fwdTransform(image, nLevelsToDo)
- curLevel nAllLevels - nLevelsToDo
- for index1 from 0 to 1
- // row-wise filtering
- tmpFltIm convolve(fwdQMFindex1, image,
row) - tmpFltDsIm downsample(tmpFltIm, row)
- // column-wise filtering
- for index2 from 0 to 1
- tmpFltIm convolve(fwdQMFindex2,
tmpFltDsIm, col) - pyrcurLevelindex1 2 index2
downsample(tmpFltIm, col) -
-
- --nLevelsToDo
- if (nLevels gt 0)
- // assume approximation stored as 0th entry at
each pyramid level
18Wavelet Transform
- Example two-level image pyramid
C horizontal-edge sensitivity (high frequency
along column, low frequency along row) R
vertical-edge sensitivity (high frequency along
row, low frequency along column)
RC horizontal- and vertical-edge sensitivity
(high frequency along row, high frequency along
column)
19Wavelet Transform
- Inverse transform
- Procedure
- introduce pixel with value 0 between pixel-pairs
in both approximation and detail image - generate higher-resolution images through
- low-pass filtering
- high-pass filtering
- add filtered up-sampled images
- reconstructs approximation image at next level
- repeat above steps until original resolution
obtained
20Wavelet Transform
Rows
Detail RC
Detail R
Lower resolution images
Higher resolution image
Detail C
Approx.
21Wavelet Transform
- Inverse transform pseudo code
- / reconstruct image from given number of pyramid
levels / - invTransform(pyr, nLevelsToDo)
- curLevel nLevelsToDo - 1
- for index1 from 0 to 1
- // column-wise filtering
- for index2 from 0 to 1
- tmpFltUsIm upsample(pyrcurLevelindex1 2
index2, col) - tmpFltImindex2 convolve(invQMFindex2,
tmpFltUsIm, col) -
- tmpFltImSum add(tmpFltIm0, tmpFltIm1)
- // row-wise filtering
- tmpFltUsIm upsample(tmpFltImSum, row)
- imageindex1 convolve(invQMFindex1,
tmpFltUsIm, row) -
- tmpFltImSum add(image0, image1)
- // approximation stored as 0th entry at each
pyramid level - pyrcurLevel0 scale(tmpFltImSum, 4)
22Wavelet Transform
- Filter coefficients
- Forward transform (decomposition)
- coefficients in reverse order of corresponding
filter in inverse transform
23Wavelet Transform
- Filter coefficients
- Relation between reconstruction and decomposition
filter coefficients
reverse order h(-n)
24Wavelet Transform
- Filter coefficients
- Inverse transform (reconstruction)
- high-pass filter coefficients of low-pass filter
in reverse order and shifted rightwards by 1,
with alternating sign - let h(n) be coefficients of low-pass filter, and
g(n) be coefficients of high-pass filter - g(n) (-1)1-n h(1-n)
- i.e. if (n is even) g(n) - h(1-n) else g(n)
h(1-n)
25Wavelet Transform
- Filter coefficients
- Relation between coefficients of low-pass and
high-pass reconstruction filters
1. reverse order h(-n)
2. shift right h(1 - n)
3. negate even-numbered coefficients g(n)
(-1)1-n h(1-n)
0
26Wavelet Transform
- Filter coefficients
- Many wavelet filters are available e.g.
- a Haar low-pass filter
- a set of Daubechies QMF filters
27Sample Applications
- Multi-resolution image processing has been used
in a wide variety of applications - image segmentation
- image matching
- image compression
- texture analysis
- noise removal
- ...
28Sample Applications
- Image compression
- High-pass filtered image (edges)
- has most values concentrated near zero
- higher redundancy (than original image) offers
possibility of higher compression ratio - hence, Laplacian or wavelet pyramid provide basis
for compression - JPEG 2000 is based on wavelet transform
29Sample Applications
- Image compression
- Forward transform used in compression
- transform, followed by quantisation, Huffman
coding, ... - Inverse transform used in decompression
- Huffman decoding, ... followed by transform
30Summary
- Multi-resolution image processing
- processing at several image scales
- generation of image pyramid recursive filtering
- some pyramid types
- Gaussian, Laplacian, wavelet pyramids
- Sample applications
- image compression, segmentation, matching, ...