M. Wu: ENEE631 Digital Image Processing (Spring'09) Unitary Transform Unitary Transform Spring ’09 Instructor: Min Wu Electrical and Computer Engineering Department, University of Maryland, College Park bb.eng.umd.edu (select ENEE631 S’09) [email protected]ENEE631 Spring’09 ENEE631 Spring’09 Lecture 10 (2/25/2009) Lecture 10 (2/25/2009)
33
Embed
M. Wu: ENEE631 Digital Image Processing (Spring'09) Unitary Transform Spring ’09 Instructor: Min Wu Electrical and Computer Engineering Department, University.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
M. Wu: ENEE631 Digital Image Processing (Spring'09)
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [2]
OverviewOverview
Last Time:– MMSE Quantizer for non-uniform and uniform source– Companding: Quantizer with pre- and post- nonlinear transformation– Quantizer in predictive coding
Today:– Vector vs. Scalar Quantizer – Revisit image transform from a coding and basis perspective
Start with uniform quantizer Use iterative algorithm. optimum thresholds (red) and reconstruction values (blue)
From B. Liu PU EE488 F’06
Truncated Gaussian N(0,1) with L=16 quantizer
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [5]
Vector QuantizationVector Quantization
Encode a set of values together– Find the representative combinations– Encode the indices of combinations
Scalar vs. Vector quantization– SQ is simpler in implementation – VQ allows flexible partition of coding cells– VQ could naturally explore the correlation
between elements
Stages to build vector quantizer– Codebook design– Encoder– Decoder
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [6]
Outline of Core Parts in VQOutline of Core Parts in VQ
Design codebook– Optimization formulation is similar to MMSE scalar quantizer– Given a set of representative points
“Nearest neighbor” rule to determine partition boundaries
– Given a set of partition boundaries “Probability centroid” rule to determine representative
points that minimizes mean distortion in each cell
Search for codeword at encoder– Tedious exhaustive search– Design codebook with special structures to
speed up encoding E.g., tree-structured VQ
Reference:A. Gersho and R. M. Gray, Vector Quantization and Signal Compression, Kluwer Publisher. R. M. Gray, ``Vector Quantization,'' IEEE ASSP Magazine, pp. 4--29, April 1984.
Lossy tools for reducing bit rate– Quantization: scalar quantizer vs. vector quantizer– Truncations: discard unimportant parts of data
Facilitating compression via Prediction– Convert the full signal to prediction residue with smaller dynamic range– Encode prediction parameters and residues with less bits– Be careful: use quantized version available to decoder when designing encoder
Facilitating compression via Transforms– Transform into a domain with improved energy compaction
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [9]
Why Do Transforms?Why Do Transforms?
Fast computation– E.g., convolution vs. multiplication for filter with wide support
Conceptual insights for various image processing– E.g., spatial frequency info. (smooth, moderate change, fast change, etc.)
Obtain transformed data from measurement– E.g., blurred images, radiology images (medical and astrophysics)– Often need to perform an inverse transform to obtain the actual data
For efficient storage and transmission– Pick a few “representatives” (basis) – Just store/send the major “contribution” from some basis image/vector
Figure is from slides at Gonzalez/ Woods DIP book website (Chapter 8)
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [11]
Basis Vectors and Basis ImagesBasis Vectors and Basis Images
A basis for a vector space ~ a set of vectors that is– Linearly independent ~ ai vi = 0 if and only if all ai=0– Uniquely represent every vector in the space by their linear combination
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [15]
1-D Unitary Transform1-D Unitary Transform
Consider linear invertible transform– 1-D sequence { x(0), x(1), …, x(N-1) } as a vector – y = A x and A is invertible
Unitary matrix: A is unitary if A-1 = A*T = AH – Denote A*T as AH ~ “Hermitian”
– x = A-1 y = A*T y = ai*T y(i)
– Hermitian of row vectors of unitary matrix A form a set of orthonormal basis vectors {ai
*T }
Think: how about column vectors of A?
Orthogonal matrix ~ A-1 = AT – Real-valued unitary matrix is also an orthogonal matrix– Row vectors of real orthogonal matrix A form orthonormal basis vectors
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [28]
2-D Transform: General Case2-D Transform: General Case
A general 2-D linear transform with kernel {ak,l(m,n)}
– y(k,l) is a transform coefficient for Image {x(m,n)} – {y(k,l)} is “Transformed Image”– Equiv to rewriting all from 2-D to 1-D and applying 1-D transform
Computational complexity– N2 values to compute– N2 terms in summation per output coefficient– O(N4) for transforming an NxN image!
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [31]
Basis Images for Separable TransformBasis Images for Separable Transform
X = AH Y A* => x(m,n) = k l a*(k,m)a*(l,n) y(k,l)– Represent X with NxN basis images weighted by coeff. Y– Obtain basis image by setting Y={(k-k0, l-l0)} and getting X
{ a*(k0 ,m)a*(l0 ,n) }m,n
Basis image in matrix form A*k,l = a*k al*T
~ a*k is kth column vector of AH transf. coeff. y(k,l) is the inner product of the basis A*k,l with
Figures from Mani Thomas U.Del CISC489/689 2D FThttp://vims.cis.udel.edu/~mani/TACourses/Spring06/cv/index.html
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [37]
8x8 DFT Basis Images8x8 DFT Basis Images
Figures from John Woods’ book.
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [38]
Summary and ReviewSummary and Review
1-D transform of a vector– Represent an N-sample sequence as a vector in N-dimension vector space– Transform
Different representation of this vector in the space via different basis e.g., 1-D DFT from time domain to frequency domain
– Forward transform In the form of inner product Project a vector onto a new set of basis to obtain N “coefficients”
– Inverse transform Use linear combination of basis vectors weighted by transform
coefficents to represent the original signal
2-D transform of a matrix– Generally can rewrite the matrix into a long vector & apply 1-D transform– Separable transform allows applying transform to rows then columns
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec10 – Unitary Transform [39]
Summary and Review (cont’d)Summary and Review (cont’d) Vector/matrix representation of 1-D & 2-D sampled signal
– Representing an image as a matrix or sometimes as a long vector
Basis functions/vectors and orthonormal basis– Used for representing the space via their linear combinations– Many possible sets of basis and orthonormal basis
Unitary transform on input x ~ A-1 = A*T – y = A x x = A-1 y = A*T y = ai
*T y(i) ~ represented by basis vectors {ai*T}
– Rows (and columns) of a unitary matrix form an orthonormal basis
General 2-D transform and separable unitary 2-D transform– 2-D transform involves O(N4) computation– Separable: Y = A X AT = (A X) AT ~ O(N3) computation
Apply 1-D transform to all columns, then apply 1-D transform to rows
– For non-square image of size MxN: Y = AMxM X ATNxN ; basis images MxN