M. Wu: ENEE631 Digital Image Processing (Spring'09) Wavelet Coding and Related Issues Wavelet Coding and Related Issues 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 13 (3/11/2009) Lecture 13 (3/11/2009)
52
Embed
M. Wu: ENEE631 Digital Image Processing (Spring'09) Wavelet Coding and Related Issues Spring ’09 Instructor: Min Wu Electrical and Computer Engineering.
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)
Wavelet Coding and Related IssuesWavelet Coding and Related Issues
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [5]
Recall: EZW Algorithm and ExampleRecall: EZW Algorithm and Example
Initial threshold ~ 2 ^ floor(log2 xmax)– Put all coeff. in dominant list
Dominant Pass (“zig-zag” across bands)
– Assign symbol to each coeff. and entropy encode symbols ps – positive significance ns – negative significance iz – isolated zero ztr – zero-tree root
– Significant coefficients Move to subordinate list Set them to zero in dominant list
Subordinate Pass– Output one bit for subordinate list
According to position in up/low half of quantization interval
Repeat with half threshold, until bit budget achieved – E.g. first look for coeff. above 32; then focus on coeff. between 16
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [8]
EZW and BeyondEZW and Beyond
Can apply DWT to entire images or larger blocks than 8x8
Symbol sequence can be entropy encoded – e.g. arithmetic coding
Cons of EZW– Poor error resilience; Difficult for selective spatial decoding
SPIHT (Set Partitioning in Hierarchal Trees)– Further improvement over EZW to remove redundancy– Achieve equal/better performance than EZW w/o arithmetic coding
EBCOT (Embedded Block Coding with Optimal Truncation)– Used in JPEG 2000– Address the shortcomings of EZW (random access, error resilience, …)– Embedded wavelet coding in each block + bit-allocations among blocks
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [16]
Solutions to Coefficient ExpansionSolutions to Coefficient Expansion Circular convolution in place of linear convolution
– Periodic extension of input signal– Problem: artifacts by large discontinuity at borders
Symmetric extension of input– Reduce border artifacts (note the signal length doubled with symmetry)– Problem: output at each stage may not be symmetric From Usevitch (IEEE
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [27]
JPEG 2000: A Wavelet-Based New StandardJPEG 2000: A Wavelet-Based New Standard
Targets and features
– Excellent low bit rate performance without sacrifice performance at higher bit rate
– Progressive decoding to allow from lossy to lossless– Region-of-interest (ROI) coding– Error resilience
For details
– JPEG2000 Tutorial by Skrodras @ IEEE Sig. Proc Magazine 9/2001 – David Taubman: “High Performance Scalable Image Compression
with EBCOT”, IEEE Trans. On Image Proc, vol.9(7), 7/2000.– Taubman’s book on JPEG 2000 (on library reserve)– Links and tutorials @ http://www.jpeg.org/JPEG2000.htm
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [29]
DCT vs. Wavelet: Which is Better?DCT vs. Wavelet: Which is Better?
3dB improvement?
– Wavelet compression was claimed to have 3dB improvement over DCT-based compression
– Comparison is done on JPEG Baseline
Improvement not all due to transforms
– Main contribution from better rate allocation, advanced entropy coding, & smarter redundancy reduction via zero-tree
– Difference due to DCT vs. Wavelet transform is less than 1dB– DCT coder can be improved to decrease the gap
[Ref] "A comparative study of DCT- and wavelet-based image coding", Z. Xiong, K. Ramchandran, M. Orchard, Y-Q. Zhang, IEEE Trans. on Circuits and Systems for Video Technology, v.9, no.5, 8/99, pp692-695.
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [37]
Summary of Today’s LectureSummary of Today’s Lecture Wavelet transform and coding
– Haar basis/transform; considerations for wavelet filters; JPEG 2000
Optimal bit allocation: “equal slope” in R-D curves– Lead to reverse water filling for Gaussian coefficients
Next lecture– Optimal transform
Readings: see wavelet coding references in Project #1– Gonzalez’s 3/e book Section 8.2.10; 7.1, 7.4-7.5; (7.2-7.3 on wavelet)– Transform coding articles in IEEE Sig. Proc. Magazine Sept. 2001
(special issue on transform coding)
– To explore more: Tutorial on rate-distortion by Ortega-Ramchandran in IEEE Sig. Proc. Magazine, Nov. 98, and Jain’s book Section 2.13;“Wavelets and the lifting scheme: A 5 minute tour” by Wim Sweldens [Zeitschrift für Angewandte Mathematik und Mechanik, 76 (2), pp. 41-44, 1996]
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [38]
Review: Correlation After a Linear TransformReview: Correlation After a Linear Transform
Consider an Nx1 zero-mean random vector x
– Covariance (or autocorrelation) matrix Rx = E[ x xH ] give us ideas of the correlation between elements Rx is a diagonal matrix for if all N r.v.’s are uncorrelated
Apply a linear transform to x: y = A x
What is the autocorrelation matrix for y ?
Ry = E[ y yH ] = E[ (Ax) (Ax)H ] = E[ A x xH AH ]
= A E[ x xH ] AH = A Rx AH
Decorrelation: try to search for A that can produce a decorrelated y (equiv. a diagonal correlation matrix Ry )
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [41]
Review: Correlation After a Linear TransformReview: Correlation After a Linear Transform
Consider an Nx1 zero-mean random vector x
– Covariance (or autocorrelation) matrix Rx = E[ x xH ] give ideas of correlation between elements Rx is a diagonal matrix for if all N r.v.’s are uncorrelated
Apply a linear transform to x: y = A x
What is the correlation matrix for y ?
Ry = E[ y yH ] = E[ (Ax) (Ax)H ] = E[ A x xH AH ]
= A E[ x xH ] AH = A Rx AH
Decorrelation: try to search for A that can produce a decorrelated y (equiv. a diagonal correlation matrix Ry )
– Keep only a subset of m transform coefficients and then perform inverse transform (1 m N)
– Basis restriction error: MSE between original & new sequences
Goal: to find the forward and backward transform matrices to minimize the restriction error for each and every m– The minimum is achieved by KLT arranged according to the
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [57]
Basic Steps in R-D OptimizationBasic Steps in R-D Optimization
Determine source’s statistics– Simplified models: Gaussian, Laplacian, Generalized Gaussian– Obtain from training samples
Obtain operational R-D points/functions/curves– E.g., compute distortion for each candidate quantizer
Determine objective function and constraints
Search for optimal operational R-D points– Lagrange multiplier approach
select only operating points on the convex hull of overall R-D characteristics (Fig.19 of Ortega’s tutorial)
may handle different coding unit independently
– Dynamic programming approach not constrained by convex hull but has larger search space
~ higher complexity => See Ortega’s SPM’98 tutorial for details
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [58]
Bridging the Theory and the Practice Bridging the Theory and the Practice
Operational R-D curves– Directly achievable R-D pairs with practical implementation
Tradeoff! – How close are the R-D operational points to info. theory bounds?
– Practical considerations: cost of memory, computation, delay, etc.
Often narrowing down to an optimization problem:~ optimize an objective function subject to a set of constraints
Problem of model mismatch
– How good are our assumptions on source modeling?– How well does a coding algorithm tolerate model mismatch?
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [59]
Ref: convex hullRef: convex hull
Formally
– Smallest convex set containing all points For R-D problem, we concerned of the lower boundary of this
set that close to the info. theoretical bound (the upper/right end are open)
– Convex set if X1,..,Xn are in the set, then the linear combinations of
them (with non-negative combination factors) are still in the set
Intuitively
– Use a rubber band to wrap the outermost points so that the band encloses all points
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [60]
1
0
2 )()(
1min
N
kq kvkvE
ND
where k2 -- variance of k-th coeff. v(k); nk -- # bits allocated for v(k)
f(-) – quantization distortion func.
Bit AllocationBit Allocation How many bits to be allocated for each coeff.?
– Determined by the variance of coeff.– More bits for high variance k
2 to keep total MSE small
1
0
2 )(1 N
kkk nf
N
1
0
.bits/coeff 1
subject toN
kk Bn
N
“Inverse Water-filling” (from info. theory)
– Try to keep same amount of error in each freq. band
See Jain’s pp501 for detailed bit-allocation algorithm
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [61]
Details on Reverse Water-filling Solution (cont’d)Details on Reverse Water-filling Solution (cont’d)
DDD i
i
in
i
tosubj. ,lnmin2
121
n
ii
i
in
i
DD
DJ1
2
121 ln)( Construct func. using
Lagrange multiplier
D and allfor 0 1
2
1ii
ii
DDiDD
J Necessary condition Keep the same marginal gain
DDD i
n
i i
i
tosubj. ,0,ln2
1maxmin
1
2
DDDD
D
D
Ji
ii
ii
ii
ii
i
s.t.
if ,
if ,
if ,0
if ,022
2
2
2
Necessary conditionfor choosing
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [63]
Lagrangian Opt. for Indep. Budget ConstraintLagrangian Opt. for Indep. Budget Constraint
Previous: fix distortion, minimize total rate
Alternative: fix total rate (bit budget), minimize distortion
(Discrete) Lagrangian optimization on general source
– “Constant slope optimization” (e.g. in Box 6 Fig. 17 of Ortega’s tutorial)– Need to determine the quantizer q(i) for each coding unit i– Lagrangian cost for each coding unit
use a line with slope - to intersect with each operating point (Fig.14)
– For a given operating quality , the minimum can be computed independently for each coding unit
=> Find operating quality satisfying the rate constraint
n
iiqiiqi rd
1)(,)(,min
)(,)(, iqiiqi rd
n
iiqiiqi
n
iiqiiqi rdrd
1)(,)(,
1)(,)(, minmin
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [64]
(from Box 6 Fig. 17 of Ortega’s tutorial)(from Fig. 14 of Ortega’s tutorial)
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [65]
Bridging the Theory and Ad-hoc Practice Bridging the Theory and Ad-hoc Practice
Operational R-D curves– Directly achievable with practical implementation
Tradeoff! Tradeoff! Tradeoff! – Rate vs. Distortion
how close are the operational points to info. theory bounds?– Also tradeoff among practical considerations
Cost of memory, computation, delay, etc.
Often narrowing down to an optimization problem:~ optimize an objective func. subj. to a set of constraints
Model mismatch problem– How good are our assumptions on source modeling?– How well does a coding algorithm tolerate model mismatch?
M. Wu: ENEE631 Digital Image Processing (Spring'09) Lec13 – Wavelet Coding, etc. [66]
Basic Steps in R-D OptimizationBasic Steps in R-D Optimization
Determine source’s statistics– Simplified models: Gaussian, Laplacian, Generalized Gaussian– Obtain from training samples
Obtain operational R-D points/functions/curves– E.g., compute distortion for each candidate quantizer
Determine objective func. and constraints
Search for optimal operational R-D points– Lagrange multiplier approach
select only operating points on the convex hull of overall R-D characteristics (Fig.19 of Ortega’s tutorial)
may handle different coding unit independently
– Dynamic programming approach not constrained by convex hull but has larger search space