Docsity

Coding Binary Images Quantization - Lecture Slides | ECE 6258, Study notes of Digital Signal Processing

Toggle sidebar
bg1
1
10/1/2003 ECE 6258 Russell M. Mersereau 1
ECE6258 Lecture 18
Coding Binary Images
Quantization
10/1/2003 ECE 6258 Russell M. Mersereau 2
Announcements
๎š„Problem Set #4 is posted on the web site.
๎š„Due: Friday, October 10, 2003
10/1/2003 ECE 6258 Russell M. Mersereau 3
Coding Binary Images
๎š„Binary images, such as printed documents contain,
on average many fewer than 1 bit/sample.
๎š„They are usually coded losslessly (within sampling
limits).
๎š„Markov models can be successfully applied.
๎š„Examples,
๎š‰Group 3 and Group 4 fax standards
๎š‰JBIG (Joint Binary Images Group) standard (ITU).
10/1/2003 ECE 6258 Russell M. Mersereau 4
Run-length coding
๎š„For sources that emit โ€œrunsโ€ of identical symbols
(e.g. line art)
๎š„Replace a sequence {xn} by a shorter sequence of
symbol pairs {ak,rk} such that
๎š„Entropy coding of new symbol pairs {ak, rk}
๎š„For binary images, ak, can usually be omitted.
pf3
pf4
pf5

Partial preview of the text

Download Coding Binary Images Quantization - Lecture Slides | ECE 6258 and more Study notes Digital Signal Processing in PDF only on Docsity!

10/1/^

ECE 6258 Russell M. Mersereau

1

ECE6258 Lecture 18^ Coding Binary ImagesQuantization

10/1/^

ECE 6258 Russell M. Mersereau

Announcements ย„^ Problem Set #4 is posted on the web site. ย„^ Due: Friday, October 10, 2003

10/1/^

ECE 6258 Russell M. Mersereau

3

Coding Binary Images ย„^ Binary images, such as printed documents contain,on average many fewer than 1 bit/sample. ย„^ They are usually coded losslessly (within samplinglimits). ย„^ Markov models can be successfully applied. ย„^ Examples,^ ย‰^ Group 3 and Group 4 fax standards^ ย‰^ JBIG (Joint Binary Images Group) standard (ITU).

10/1/^

ECE 6258 Russell M. Mersereau

Run-length coding ย„^ For sources that emit โ€œrunsโ€ of identical symbols(e.g. line art) ย„^ Replace a sequence {

x^ } by a shorter sequence of n symbol pairs {

a^ , r } such that kk ย„^ Entropy coding of new symbol pairs {

a ,^ r } kk

ย„^ For binary images,

a^ , can usually be omitted. k

10/1/^

ECE 6258 Russell M. Mersereau

5

ย„^ Markov model [Capon, 1959] ย„^ State probabilitiesPr{ k^ successive white pixels} = (1-

k -1^ p )p^ forWBWB^ k =1,2,3,โ€ฆ

Pr{ k^ successive black pixels} = (1-

k -1^ p )p^ forBW BW^ k =1,2,3,โ€ฆ

Statistical model for binary images of line art

B p WB W^ p BW

1- p BW

1- p WB

10/1/^

ECE 6258 Russell M. Mersereau Measured parameters for Capon model

0.9350.0650.0240.3470.215 bpp 0.8870.1130.0270.2140.241 bpp Pr{ W } Pr{ B }^ p WB^ p BW^ H (SS)

Printed Text Weather Map Document

[Kunt, 1974]

10/1/^

ECE 6258 Russell M. Mersereau

7

Facsimile compression standards ย„^ Standards by the ITU-T^ ย‰^ T4 (Group 3)^ ย„^ Used by all fax machines over PSTN^ ย„^ 1-D modified Huffman code (MH) or 2-D MMR code^ ย‰^ T6 (Group 4)^ ย„^ Fax over digital networks^ ย„^ Always uses 2-D MMR ย„^ Format^ ย‰^ Horizontal resolution: 1728 pixels/line^ ย‰^ Vertical resolution: 3.85 lines/mm (standard)

7.70 lines/mm (fine)

10/1/^

ECE 6258 Russell M. Mersereau Group 3 fax: modified Huffman code ย„^ Lengths of white pixels and black pixels encoded within ascan line ย„^ Each run represented aswhite runs:

r =64 x^ r w^ w/make-up

+^ r similar for black w/term^ ย„^ Two separate Huffman code tables for white and black runsbased on the statistics of 8 representative documents. ย„^ Shortest code words (2 bits) for black runs of length 2 and 3 ย„^ Shortest code words (4 bits) for white runs of lengths 2โ€ฆ7. ย„^ Special EOL codework for each line, 6x EOL as end of page.

10/1/^

ECE 6258 Russell M. Mersereau

13

Quantization ย„^ The output of the quantizer is a sequence ofsymbols that is fed to an entropy encoder. ย„^ If the pdf (probability density function) of

x [ n ]

is known, the probabilities of the quantizedvalues can be calculated.

Quantizer

10/1/^

ECE 6258 Russell M. Mersereau Quantization (contโ€™d) ย„^ If

t^ t^ i^ i+

10/1/^

ECE 6258 Russell M. Mersereau

15

Common pdf models for Images ย„^ Gaussian ย„^ Laplacian ย„^ Generalized Gaussian

10/1/^

ECE 6258 Russell M. Mersereau Quantization Intervals

ย„^ Interval boundaries-โˆž,^ x ,^ x^1

,^ x ,^ x ,^ โˆž 234 ย„^ Representationvalues^ y ,^ y ,^ y^123

,^ y ,^ y 4 5 Q [ r ]^ r xx^1 2^ x^3 y^5 y^4 x^4^ y^2^ y^1

10/1/^

ECE 6258 Russell M. Mersereau

17

Formalizing ย„^ An^ N -point scalar quantizer

Q^ is a mapping Q :^ R ร† C , where

R^ is the real line and C ={ y , y ,โ€ฆ,^12

y^ }^ โŠ‚^ R^ is the output set or N codebook

with size^

N.

ย„^ Associated with every

N -point quantizer is a partition of the real line

R^ into^ N^ cells or atoms. The

th^ i cell is given by R^ = { x^ โˆˆ R : i^

Q ( x )= y^ } = i

-1 Q ( y^ ) i

10/1/^

ECE 6258 Russell M. Mersereau Quantization Error ย„^ There are a number of measures of thedistortion introduced by a quantizer.^ ย‰^ d ( x , y^ ) = | i

(^2) x - y | (^) i (squared error) ย‰^ d ( x , y^ ) = | i x - y^ |^ i (absolute error) ย‰^ d ( x , y^ ) = | i

m^ x - y | i th^ ( m power) ย„^ Mean-Squared Error

10/1/^

ECE 6258 Russell M. Mersereau

19

Quantizer Design ย„^ Design Problem #1Given^ p^ X

( x ),^ N , and distortion criterion, find {

y^ }, { x^ } to ii

minimize^ D. ย„ Design Problem #2Assume knowledge of interval can be encoded using

l^ bits. i^

Subject to^ R โ‰ค

R *, find { l^ }, { xi

}, { y },^ N^ that minimize ii

D.

10/1/^

ECE 6258 Russell M. Mersereau Uniform Quantizers ย„^ Regular quantizers ย„^ Partitions of same size ย„^ Reconstruction levels are midpoints ofintervals. ย„^ Implemented by most A/D converters ย„^ Uniform quantizers minimize the maximumerror

10/1/^

ECE 6258 Russell M. Mersereau The Lloyd algorithm 1.^ Begin with an initial codebook,

C. Set^ m^1

2.^ Given codebook

C^ , perform a Lloyd m iteration to generate an improved codebook C^. m +13. Compute the average distortion for

C^. If it m +

has changed by a small enough amountsince the last iteration, stop. Else

m +1ร† m

and go to Step 2.