An Algorithm for Compression of Bilevel Images Authors
An Algorithm for Compression of Bilevel Images Authors: Maire D. Reavy and Charles G. Boncelet Source: IEEE Transactions on Image Processing, Vol. 10, No. 5, May 2001 Speaker: Guu-In Chen Date: 2001/9/13 1
INTRODUCTION Algorithm for lossless bilevel image compression: G 3: • 1980 • Run length modified Huffman encoder • Suitable for business documents • Not for halftone images More than 24 JBIG (JBIG 1): patents • 1993 • An arithmetic coder (IBM QM-coder) • Suitable for business documents & halftone images • Not been implemented commercially 2
INTRODUCTION (cont. ) BACIC (Block Arithmetic Coding for Image Compression): • 1997 • Block arithmetic coder (BAC) • Suitable for business documents & halftone images • Compression ratio: v. Documents: ~JBIG, 2. 4 x. G 3 vhalftone images: >JBIG, 6. 1 x. G 3 3
Documents 4
Grayscale Image Halftone Image - by Floyd-Steinberg error diffusion 5
Halftone Image - by dispersed-dot ordered dither 6
Halftone Image - by clustered-dot ordered dither 7
BAC q predeterminiate the number of codewords K v. K is as large as possible to maximize BAC’s coding efficiency. q calculate the overall p 0 (p 1=1 - p 0) p 0 : the probability of a bit equaling zero q build BAC coding tree BAC codebook q raster-scan the image q From the root of BAC coding tree, one bit one node moves forward till a leaf and outputs its number (ie, codeword). v. The coding tree is small and constant, the encoder and decoder can each store a copy of this tree. 8
For example: K=16 (0 -15 or 0000 -1111) p 0 =0. 8 BAC coding tree: K 0=[p 0 K] K 1=K-K 0 [ • ]: rounded to the nearest integer unless [p 0 K]=K K 0 =K-1 , K 1=1 K or [p 0 K]=1 K 0 =1, K 1= K-1 K 0 K 1 K K 0 9
BAC coding tree: K=16 (0 -15), p 0 =0. 8 10
Bitstream: 11 0011 101 00011 010 Code: 15 9 14 7 10 or 11 (with the size of image in the header) 11
BACIC q BASIC propose an adaptive BAC coding tree: Ø p 0 (p 1=1 - p 0) is no longer constant; Ø using a three-line or five-line template to estimate p 0 (p 1); Ø constructing only that portion of the tree that is needed to generate a codeword. 12
The template used by BACIC For documents & error diffusion halftone The essences: üri counts the previously coded pixels equaling one. üsi counts all the previously coded pixels. For ordered dither halftone üFor a context, the estamate of p 1: 13
The template used by BACIC (cont. ) For every context: ri (0)=1. 0 ri (n+1) = px+ 0. 985 *ri (n) si (0)=2. 0 si (n+1) = 1. 0+ 0. 985 *si (n) n : the sequence no. px: the value of the current pixel 0. 985: the weight to make the recent pixels have greater influence on the probability estimate of the current pixel than earlier pixels do. 0. 006: to correct the overestimate p 1 when si (n) reach its upper limit 14
The example for adaptive BAC coding tree p 0={0. 80, 0. 90, 0. 25, 0. 90 ……. }, K=16 Input stream : 0 0 0 1……. Output: 2 15
Decoding: 1. p 0 of the first pixel is 0. 80 and K=16. The according index is 2. 2. 16*0. 80=13, (13 -1)>=2, so go down the lower path from the root of BAC coding tree. 3. p 0 of the second pixel is 0. 90, 13*0. 90=12, (12 -1)>=2, so go down the lower path. 4. p 0 of the third pixel is 0. 25, 12*0. 25=3, (3 -1)>=2, so go down the lower path. 5. p 0 of the forth pixel is 0. 90, 3*0. 90=2, (2 -1)<2, so go down the upper path, and the node is a leaf, so this index 2 decoded to be 0001. 16
Experimental results 17
ordered dither halftone 18
- Slides: 18