300 likes | 693 Views
Image Compression-JPEG 2000. ECE 591-05. Examples: JPEG2K vs. JPEG. From Christopoulos (IEEE Trans. on CE 11/00). Secret: Discrete Wavelet Transform. The discrete wavelet transform (DWT) has gained widespread acceptance in signal processing and image compression.
E N D
Image Compression-JPEG 2000 ECE 591-05
Examples: JPEG2K vs. JPEG From Christopoulos (IEEE Trans. on CE 11/00)
Secret: Discrete Wavelet Transform • The discrete wavelet transform (DWT) has gained widespread acceptance in signal processing and image compression. • Because of their inherent multi-resolution nature, wavelet-coding schemes are especially suitable for applications where scalability and tolerable degradation are important • Recently the JPEG committee has released its new image coding standard, JPEG-2000, which has been based upon DWT.
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.
Wavelet Transform • Wavelet transform decomposes a signal into a set of basis functions. • These basis functions are called wavelets • Wavelets are obtained from a single prototype wavelet called mother wavelet by dilations and shifting: where a is the scaling parameter and b is the shifting parameter
Discrete Wavelet Transform • The signal is also decomposed simultaneously using a high pass filter h. The outputs giving the detail coefficients (from the high-pass filter) and approximation coefficients (from the low-pass).
Discrete Wavelet Transform • This decomposition is repeated to further increase the frequency resolution and the approximation coefficients decomposed with high and low pass filters and then down-sampled. • The tree is known as a filter bank
Downsampling and Upsampling • Let M denote the downsampling factor. • Reduce the data by picking out every Mth sample: h(k) = g(Mk). Data rate reduction occurs in this step. • Upsampling
Matlab Comand • X = imread(‘barbarb.bmp’); • nbcol = size(X,1); • [cA1,cH1,cV1,cD1] = dwt2(X,'db1'); • cod_X = wcodemat(X,nbcol); • cod_cA1 = wcodemat(cA1,nbcol); • cod_cH1 = wcodemat(cH1,nbcol); • cod_cV1 = wcodemat(cV1,nbcol); • cod_cD1 = wcodemat(cD1,nbcol); • dec2d = [cod_cA1, cod_cH1; cod_cV1, cod_cD1]; • imagesc(dec2d); http://matlab.izmiran.ru/help/toolbox/wavelet/dwt2.html
Discrete Wavelet Transform • Using matlab command DWT2, IDWT2
Discrete Wavelet Transform Separable transform by successively applying 1-D DWT to rows and columns From Usevitch’s article in IEEE Sig.Proc. Mag. 9/01
Embedded Zero-Tree Wavelet Coding (EZW) • “Modern” lossy wavelet coding exploits multi-resolution and self-similar nature of wavelet decomposition • Energy is compacted into a small number of coefficients • Significant coeff. tend to cluster at the same spatial location in each frequency subband • time-freq. or space–freq. analysis • Two set of info. to code: • Where are the significant coefficients? • What values are the significant coefficients?
Key Concepts in EZW • Parent-children relation among coeff. • Each parent coeff at level k spatially correlates with 4 coeff at level (k-1) of same orientation • A coeff at lowest band correlates with 3 coeff. • Coding significance map via zero-tree • Encode only high energy coefficients • Need to send location info. large overhead • Encode “insignificance map” zero-trees • Successive approximation quantization • Send most-significant-bits first and gradually refine coefficient value • “Embedded” nature of coded bit-stream • get higher fidelity image by adding extra refining bits
EZW • The EZW encoder exploits the zerotree based on the observation that wavelet coefficients decrease with scale. It assumes that there will be a very high probability that all the coefficients in a quad tree will be smaller than a certain threshold if the root is smaller than this threshold
EZW • The relations between wavelet coefficients in different subbands (left), how to scan them (upper right) and the result of using zerotree (lower right) symbols (T) in the coding process. An H means that the coefficient is higher than the threshold and an L means that it is below the threshold. The zerotree symbol (T) replaces the four L's in the lower left part and the L in the upper left part.
EZW Algorithm and Example From Usevitch (IEEE Sig.Proc. Mag. 9/01) • 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 threshold = initial_threshold; do { dominant_pass(image); subordinate_pass(image); threshold = threshold/2; } while (threshold > minimum_threshold
After 1st Pass From Usevitch (IEEE Sig.Proc. Mag. 9/01) Divide quantization interval of [32,64) by half: [32,48) => 40 and [48, 64) => 56
After 2nd Pass From Usevitch (IEEE Sig.Proc. Mag. 9/01)
EZW 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 • 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
EZW Results • P (positive significance), N (negative significance), T (isolated zero) or Z (zero-tree root) D1: pnztpttttztttttttptt D2: ztnptttttttt D3: zzzzzppnppnttnnptpttnttttttttptttptttttttttptttttttttttt D4: zzzzzzztztznzzzzpttptpptpnptntttttptpnpppptttttptptttpnp D5: zzzzztzzzzztpzzzttpttttnptppttptttnppnttttpnnpttpttppttt D6: zzzttztttztttttnnttt
JPEG 2000 Image Compression Standard From Christopoulos (IEEE Trans. on CE 11/00)
JPEG 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 • Links and tutorials @ http://www.jpeg.org/JPEG2000.htm
Required Readings • Usevitch’s tutorial in IEEE Sig. Proc. Magazine 9/01x • http://www.cs.tau.ac.il/~amir1/WAVELET/PAPERS/lossy_wavelet_compress01.pdf • Xiong’s paper on DCT vs. Wavelet on IEEE Trans. CSVT