Top Banner
Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille Ecole Centrale Marseille
97

Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Apr 04, 2015

Download

Documents

Gaëtane Fevre
Welcome message from author
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
Page 1: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Image processing

Image and image sequence compression

bases

Session 2005-2006

Ecole Centrale MarseilleEcole Centrale Marseille

Page 2: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Goal

Give in 2 hours some technics of compression

Introduction of mathematical tools

Based on information theory

Page 3: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Plan

I) Introduction

II) Tools

III) Lossless compression(redundancy)

IV) Lossy compressionscalar quatizationvector quatization

V) Norms

Page 4: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Digital images and sequences

L

CC

L

L x C pixels by image

8 bits / pixel

ImageSequence

Different formats or standards

RGB,YUV(NTSC,PAL,SECAM)

Page 5: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Formats

RGBRGB : red, green blue: red, green blue

YUV YUV : Y black and white component: Y black and white component U, V color informationU, V color information

YCYCbbCCrr : scaled and offset versions of YUV: scaled and offset versions of YUV

Page 6: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Compression : why ?

Transmission

Storage

Decrease de bitrate with compression technics

ProblemProblem

Amount of data

Elimination of redundancyElimination of redundancyQuantizationQuantization......

Page 7: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Amount of datas

Exemple of format PAL itu-r 601

Resolution : 720 columns and 576 rowsYCbCr : 4:2:2Interlaced (frame ou trame image)

Y = 720 x 576 = 414720 CbCr = 2 x 360 x 576 = 414720

Total = 829440 bytes / image

Si 25 images / sec (50 trames / sec)

Total = 20,7 Mb / sec

Page 8: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Evolution

Increase of quality,increase the size of images,

a lot of images...

More and more dataMore and more data

VISIONVISION

Page 9: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Compression

Data compression addresses the problem of Data compression addresses the problem of reducing the amount of datareducing the amount of data

required to represent given quantity of informationrequired to represent given quantity of information

EExxaammppllee

NN

MMyy00

xx00NxM pixelsNxM pixels

Coordinates, radius, gray levelsCoordinates, radius, gray levels(5 values)(5 values)

Page 10: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Plan

I) Introduction

II) Tools

Page 11: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Transmission of information

Mathématical theory of communication W. Weaver et C.E. ShannonMathématical theory of communication W. Weaver et C.E. Shannon

source of informationsource of information

transmittertransmitter

signalsignal

source of noisesource of noise

receiverreceiver

messagemessagedestinationdestination

messagemessage

Page 12: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

compression system model

Sourceencoder

Channel encoder

Channel decoder

Sourcedecoder

Channel

encoder decoder

noise

f f

exempleexemple

mapper quantizerSymbolencoder

Transform :Transform : DCT,FFT,WTDCT,FFT,WT

SQ,VQSQ,VQ

Inversemapper

Symboldecoder

. . .. . .

^

Page 13: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

f(x,y) is fed into the encoder which creates a set of symbols from the input data

f̂ May or may not be an exact replica of May or may not be an exact replica of f

Error free (lossless compression)Error free (lossless compression)

Lossy compressionLossy compression

f

f

==

Page 14: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Measures

Quality : error between original signal and received signal

Bit rate : quantity of bits

Possibility : complexity of the system (software or hardware)

Page 15: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Fidélity criteria

2

11

0

21

0

1

N

y

M

xrms )y,x(f)y,x(f̂

MNe

1

0

1

0

N

y

M

x

)y,x(f)y,x(f̂e

1

0

21

0

1

0

21

0

N

y

M

x

N

y

M

xms

)y,x(f)y,x(f̂

)y,x(f̂

SNR

)SNRlog(SNR msdB 10

Page 16: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Fidélity criteria

1

0

21

0

225520

N

y

M

x

ms

)y,x(f)y,x(f̂logPICSNR

where 255 is the maximum value of the signalwhere 255 is the maximum value of the signal

Page 17: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Fidélity criteria

2

11

0

21

0

1

N

y

M

x

)y,x(f)y,x(f̂gMN

e

SubjectiveSubjective

Value Value RatingRating11 excellentexcellent extremely high qualityextremely high quality22 finefine high qualityhigh quality33 passablepassable44 marginalmarginal55 inferiorinferior very poor imagevery poor image66 unusableunusable can’t watch itcan’t watch it

Page 18: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Measuring information

A random even E that occurs with probability P(E) is said to containsA random even E that occurs with probability P(E) is said to contains

)E(Plog)E(P

log)E(I 1

Units of infoUnits of info

Self information

P(E)=1P(E)=1 event always occursevent always occursP(E)=0P(E)=0 event never occursevent never occursP(E)=0.999P(E)=0.999 ==> small information==> small information

LogLog22 bits bits

Page 19: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Measuring information

)a(Plog)a(P)s(H j

J

jj

1

The average information per source output isThe average information per source output is

ENTROPYENTROPY

H H uncertainty uncertainty information information

ShannonShannon

Page 20: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Definitions

N1 bits before compressionN1 bits before compressionN2 bits after compressionN2 bits after compression

Compression ratioCompression ratio2

1

N

NCR

Relative data redundancyRelative data redundancy

RD C

R1

1

ncompressiotsignificanRandCIf DR 1

Page 21: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Technics

Image compression

Lossless compression : quality is preserved low compression

Sequence compression

Lossy compression :quality decreaseshigh compression

Page 22: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

cameramancameraman Cam10.jpegCam10.jpeg

623623200200

Page 23: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Cam50.jpgCam50.jpg

625625 625625

Cam99.jpgCam99.jpg

Page 24: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Plan

I) Introduction

II) Tools

III) Lossless compression(redundancy)

Page 25: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Error free compression

Redundancy reductionRedundancy reduction

- coding reduction - coding reduction

-- interpixel redundancy interpixel redundancy

dpcm,...dpcm,...

- psychovisual redundancy- psychovisual redundancy

Page 26: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Code length (Longueur de code)

rk prob(rk) code 1l1(rk) code 2 l2(rk)

0 0,19 000 3 11 21/7 0,25 001 3 01 22/7 0,21 010 3 10 23/7 0,16 011 3 001 34/7 0,08 100 3 0001 45/7 0,06 101 3 00001 57/7 0,03 110 3 000001 61 0,02 111 3 000000 6

Code 1 Code 1 L=3 L=3

Code 2 Code 2 bits,)r(prob)r(LL kk

kavr 727

0

Page 27: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Huffman coding

Assignes fewer bits to the more probable gray levels Assignes fewer bits to the more probable gray levels

than to the less probablethan to the less probable

===> ===> data compressiondata compression

Variable-length codeVariable-length codeCode optimal, code uniqueCode optimal, code uniqueMost popularMost popular

Page 28: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Huffman coding

Two steps :Two steps :

11/ / create a series of source reductions by ordering the create a series of source reductions by ordering the

probabilities of the symbols under consideration and probabilities of the symbols under consideration and

combining the lowest proba symbols into a single symbol that combining the lowest proba symbols into a single symbol that

replace them in the next source reductionreplace them in the next source reduction

22/ / code each reduced source, starting with the smallest source code each reduced source, starting with the smallest source

and working back to the original source. (start with 0 or 1 and working back to the original source. (start with 0 or 1

arbitrarily)arbitrarily)

Page 29: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

symbole proba CODEa2 0,4 1 0,4 1 0,4 1 0,4 1 0,6 0a6 0,3 00 0,3 00 0,3 00 0,3 00 0,4 1a1 0,1 011 0,1 011 0,2 010 0,3 01a4 0,1 0100 0,1 0100 0,1 011a3 0,06 01010 0,1 0101a5 0,04 01011

symbole probaa2 0,4 0,4 0,4 0,4 0,6a6 0,3 0,3 0,3 0,3 0,4a1 0,1 0,1 0,2 0,3a4 0,1 0,1 0,1a3 0,06 0,1a5 0,04

Page 30: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Example

Lavr Lavr = 0.4 x 1 + 0.3 x 2 + 0.1 x 3 + 0.1 x 3 += 0.4 x 1 + 0.3 x 2 + 0.1 x 3 + 0.1 x 3 + 0.1 x 4 + 0.06 x 5 + 0.04 x 50.1 x 4 + 0.06 x 5 + 0.04 x 5

= 2.2 bits/symbol= 2.2 bits/symbol

Ex : 010100111100Ex : 010100111100

means : a3 a1 a2 a2 a6means : a3 a1 a2 a2 a6

Page 31: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Arithmetic coding

Un mot de code Un mot de code (nombre) pour (nombre) pour une suite de une suite de symbolessymboles

Precision pbPrecision pb

Page 32: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Run length coding

Represent each row of an image or bit plane by Represent each row of an image or bit plane by sequences of lengths that describe successive runs of sequences of lengths that describe successive runs of black and white pixels.black and white pixels.

fax, standard compression,...fax, standard compression,...

Basic concept :Basic concept :code each group of O ’s (1 ’s) encountered in a left to code each group of O ’s (1 ’s) encountered in a left to right scan of a row by its lenght.right scan of a row by its lenght.

(pattern recognition)(pattern recognition)

Page 33: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Rlc : example

5 5 10 10 10 6 6 6 6 6 6 18 95 5 10 10 10 6 6 6 6 6 6 18 9

2 5 3 10 6 6 1 18 1 92 5 3 10 6 6 1 18 1 9

Original dataOriginal data

Compressed dataCompressed data

13 bytes13 bytes

10 bytes10 bytes

(10/13=0.77)(10/13=0.77)

Page 34: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Bit plane coding

Decompose a multilevel image into a serie of binary Decompose a multilevel image into a serie of binary images and compress each image (binary) via one of images and compress each image (binary) via one of several well known binary compression methodseveral well known binary compression method

ExEx : code each group of O ’s (1 ’s) encountered in a left to right : code each group of O ’s (1 ’s) encountered in a left to right scan of a row by its length.scan of a row by its length.

8 bits image8 bits image

8 binary 8 binary imagesimages

Page 35: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Lemple-Ziv and Welch coding

Pattern recognitionPattern recognition

If a sequence of non identical data values is repeated more than once in the If a sequence of non identical data values is repeated more than once in the data stream, then this repetition can be exploited to compress the data.data stream, then this repetition can be exploited to compress the data.

5 10 7 10 6 5 10 7 10 6 10 5 10 7 10 6 5 10 7 10 6 10

Ca Cb Ca Cb 10Ca Cb Ca Cb 10

Original dataOriginal data

Compressed dataCompressed data

Page 36: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Predictive coding

Simple predictive methodSimple predictive method DCTDCT

xx xx

xxxxjj

ii

)j,i(f̂)j,i(f)j,i(

)j,i(Cf

)j,i(Bf

)j,i(Af)j,i(f̂

11

1

1

0 no prediction1 A2 B3 C4 A+B-C5 A+(B-C)/26 B+(A-C)/27 (A+B)/2

2:12:1

Page 37: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Plan

I) Introduction

II) Tools

III) Lossless compression(redundancy)

IV) Lossy compressiontransform quantisationscalar quantisationvector quantisation

Page 38: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Compression system

compressioncompressiontransformtransform codingcoding

! Attention au mot codage en anglais et français! Attention au mot codage en anglais et français

imageimage coefficientscoefficients indexindex codecodebinary flowbinary flow

Page 39: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Statistics

pdf

pdf

0

pdf

ORIGINAL IMAGE pdf m=1/2 m=1

Wavelet coefficients pdf

0

Page 40: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Transform coding

TT quantizerquantizer Entropy encoderEntropy encoder

Table Table specificationsspecifications

Table Table specificationsspecifications

8x8 blocsCompressed Compressed

imageimage

TT-1-1dequantizerdequantizer Entropy decoderEntropy decoder

Table Table specificationsspecifications

Table Table specificationsspecifications

Source imageSource image

Reconstructed imageReconstructed image

DCT,FFT,WTDCT,FFT,WT SQ,VQSQ,VQ

reorder datareorder datasame informationsame information

Page 41: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Transform coding

A transform is used to map the image into a set of transform coefficientswhich A transform is used to map the image into a set of transform coefficientswhich are then quantized and codedare then quantized and coded

For natural images, a significant number of coefficients have small magnitudes For natural images, a significant number of coefficients have small magnitudes and can be coarsely quantized (set to zero) without significant distortion.and can be coarsely quantized (set to zero) without significant distortion.

If information of image is well organised !If information of image is well organised !

Goal : decorrelate pixels. Pack as much info as possible into the smallest number Goal : decorrelate pixels. Pack as much info as possible into the smallest number of pixelsof pixels

Compression is not achieved during the transform !Compression is not achieved during the transform !

Page 42: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

JPEG

Page 43: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Discrete Fourier Transform

16

12

16

12

4

1 7

0

7

0

vy)y(cos

ux)x(cos)y,x(f)v(C)u(C)v,u(F

x y

16

12

16

12

4

1 7

0

7

0

vy)y(cos

ux)x(cos)v,u(F)v(C)u(C)y,x(f

x y

otherwiseandv,ufr)v(C),u(C 102

1

FDCTFDCT

IDCTIDCT8x8 bloc8x8 bloc

Source image

Page 44: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Quantizers

Scalar quantizer : one pixel at a timeScalar quantizer : one pixel at a time

Vector quantizer : group of pixelsVector quantizer : group of pixels

Page 45: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Scalar quantization

X= 12.46

Y=12

Consider the input x . As a matter of convention x is considered to be mapped to yiR if x lies in ]sj, si+1]. yi belongs to afinite set of L values

Degradation of signal

Page 46: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Definition

x1 x2 x3 xN-2 xN-1

Y1 Y2 Y3 YNYN-1

Uniform scalar quantizer

Q(x)

y1

y2

y3

y4

y5

y6

y7

x1

x3

x4

x5

x6

x2

x

output

Input

x0

x7

Decision levelsDecision levels

Reconstruction levelsReconstruction levels

Quantizer design problemQuantizer design problem

select the best Xi and Yj select the best Xi and Yj for a for a

particular optimization particular optimization criterion criterion

and pdf of inputand pdf of input

Page 47: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Uniform optimal quantizer (1D)

Optimum mean square Optimum mean square Lloyd-Max quantizerLloyd-Max quantizer

Criterion : minimise rms for a fixed number of quantization levelsCriterion : minimise rms for a fixed number of quantization levels

YL

y

)yix(Edx)x(p)yix(E1

22

21

kkk

xxy

1

1

k

k

k

k

y

y

y

yk

dx)x(p

dx)x(xp

x

Reconstruction levels are the centroids of areas under p(x) over specified decision intervalReconstruction levels are the centroids of areas under p(x) over specified decision intervalDecision levels are half way between reconstruction levelsDecision levels are half way between reconstruction levels

Page 48: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Caracteristic

x1 x8

x

Y

Y1

Y8

x1 x8

Quantizer error :difference between input and the reproduction level

x

(Truncation error if input is out of range)(Truncation error if input is out of range)

Page 49: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Quantization noise

AssumeAssume e stepe step quantization error (xquantization error (xii-y-yii))

Hyp :Hyp : e small and xe small and xii equally distributed in [-e/2,e/2] equally distributed in [-e/2,e/2]

p(p() is uniform in [-e/2,e/2]) is uniform in [-e/2,e/2]1/1/

p(p())

-e/2-e/2 e/2e/2Noise powerNoise power

12

1 22

2

2

2

222 ed

ed)(pE

/e

/e

/e

/e

Page 50: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Signal to noise ratio

Example : sine wave with amplitude VmExample : sine wave with amplitude Vm

Power of signal Power of signal 2

2mVS

Quantization noise Quantization noise nm

nm VVeB

43

1

2

2

12

112

222

2

43 n.

B

S n,

B

S

dB

6761

Page 51: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Compander

Companding =compressing + expandingCompanding =compressing + expanding

Pb : low values are badly quantizedPb : low values are badly quantized

Pdf should be cte between Pdf should be cte between V Vmaxmax

(Loi u)(Loi u)

Page 52: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

SQ --> Vector quantization

Shannon : Shannon : # of samples --> # of samples --> efficiency of coding efficiency of coding

Zador : Zador : # of reproduction vectors --> # of reproduction vectors --> mse mse

Page 53: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

1

2

3

4 5

6

7

89

10

11

12

13

14

15

12

y

y

y

y

y

y

y

yy

y

y

y

y

y

y

y

Y7

Definition

codebook

X=(x 1,x2)

Q :Rn Y

X Q X Y i si X Ci

i, j 1,...,L

CiRn CiCj ij i,j1,...,L

Y Y1, Y2 YL ,...,

Ci X Rn/ Q X Y i

et si

Ci : voronoiCi : voronoiYi : codebook vectorsYi : codebook vectors

ijallforYjXdYXdifYX ii ,,

Page 54: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Shéma de principe

i

L

1

Dictionnaire

i

Décodage

FlotBinaire YiRec her c he

duv ec t eur

i

L

1

Dictionnaire

X Min (d( X,Y ))ii

i

Codage

SourceVectorielle

Calcul de coût

Calcul de qualité

Page 55: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.
Page 56: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Remarks

Beaucoup de blocs dans l ’image sont similairesBeaucoup de blocs dans l ’image sont similaires

Beaucoup de blocs possibles ont peu de chance d ’apparaîtreBeaucoup de blocs possibles ont peu de chance d ’apparaître

Réduire le nombre de vecteurs de reproduction possiblesRéduire le nombre de vecteurs de reproduction possibles

ex : 1024 vecteurs (10 bits) (taille dictionnaire)ex : 1024 vecteurs (10 bits) (taille dictionnaire)

débit moyen : 10 / (4x4) = 0.625 bppdébit moyen : 10 / (4x4) = 0.625 bpp

Minimiser la distorsionMinimiser la distorsion

Type de source (image transformée en général)Type de source (image transformée en général)

Page 57: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Vector quantization

Codebook design minimum distortion fixed codebook size / storage

Codebook search fast - efficient

Decoding reconstruction

1

i

L

Codebook

Yi

i

value

index

Page 58: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Codebook designCodebook design

Classification LBG algorithm

Codebook design

Iterative algorithme

Quantization

LatticesLattices

- codebook vectors regularly spaced in the space- codebook vectors regularly spaced in the space

- fast algorith- fast algorith

Full search, ...

Minimisation of distortion criteriatraining vectors

complex

complex

Linde - Buzo - Gray 1980

Conway & Sloane 1980

aaddaapptteedd

ffaasstt

Page 59: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

LatticesLattices

exemple:

n

Z3

Page 60: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Vector quantization

Hardware and software point of view

on lineoff linecomplexity

CD, satellite transmission, data bases

standards -> hardware implementation

Page 61: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

VQ multirésolution

DictionnaireR

DictionnaireLR

DictionnaireLL 1/2 C

DictionnaireLL 1C

DictionnaireLL 3/2 C

DictionnaireLL 2C

Allocation des débits

Allocation de bitscroissante

Décomposition multirésolutionDictionnaire

multirésolution

Page 62: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

C=50 C=120originale

Page 63: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Plan

I) Introduction

II) Généralités

III) Compression sans perteréduction de redondance

IV) Compression avec pertesquantification scalairequantification vectorielleCompression de séquences

Page 64: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

MéthodesMéthodes

1ère méthode

Décomposition spatio-temporelle

Quantification vectorielle algébrique

2ème méthode

Estimation - Compensation de mouvement

Quantification vectorielle algébrique

Page 65: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Décomposition temporelleDécomposition temporelle

Décomposition spatialeDécomposition spatiale

R

LR

L

LL mC

Q V A

Q V A

Q V A

Décomposition spatio-temporelle

Page 66: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

PrinciplePrinciple

i

j

t

t-1

t+1

i'

j'

i'

j'

i"

j"

i

ji

j

d

u

v

->

->

->

Estimation

Compensation

Page 67: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Motion estimation

QuantificationIndexage

Désindexage

Retard

RetardEstimation

Compensation

It

It+1 It-1

It

^

^

~

~

It

*

Retard

RetardEstimation

Compensation

It+1It-1

It^

^~

* It^

Désindexage+ -

++

++

Codeur Décodeur

Page 68: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Compression de Miss America

20

25

30

35

40

45

50

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

C=100

C=220

original

Page 69: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Bibliography

Digital Image Processing, R.C. Gonzalez & R.E. Woods, Addison Wesley

Vector quantization, R.M. Gray, IEEE ASSP Magazine, april 1984

Image coding using vector quantization : a review , N.M. Nasrabadi & R.A. King, IEEE Trans. On Com., vol36 n°8, august 1988.

Image data compression, A.K. Jain, Proc. Of IEEE, vol69 n°3, march 1981

Travaux, thèse et notes personnelles

Page 70: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

End

Thank you for your attentionThank you for your attention

Page 71: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Extra slides

Page 72: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Video Compression Standards

Video Compression Standards extend the transform based, still image compression techniques of the previous sections to include methods for reducing temporal or frame to frame redundancy

Depending on intended application, the standards can be grouped into two broad categories: Video teleconferencing standards Multimedia standards

Page 73: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Videoconferencing standards

A number of teleconferencing standards have been defined by International Telecommunication Union (ITU) H.261: intended for operation at affordable

telecom bit rates with delay of less than 150ms H.262: based on MPEG2 standard for multimedia

compression H.263: designed for very low bit rate video, in the

range of 10 to 30 kBits/s H.320: desgined for ISDN lines All are based on MPEG type compression scheme

Page 74: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Multimedia Video Compression

Developed for Video on Demand, HDTV, CD image video database

MPEG-1: for high quality video as on CDROM supporting bit rate os 1.5MBits/s

MPEG2: addresses applications involving video quality between NTSC/PAL and CCIR a range that is suitable for cable TV broadcast, narrow channel satellite broadcasting, 2 to 10Mbits/s

MPEG1 and MPEG2 are meant for storage and transmission efficiency

Page 75: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

MPEG standards

MPEG4 provides Improved video compression efficiency Content based interactivity AV object access and efficient integration of

natural and synthetic data Universal access All these make segmentation necessary though

no approach is proposed for segmentation. It requires change on the creation side: similar to

multitrack audio capture Targets bit rates of 5 to 64 Kbits/s for mobile

devices and 4Mbits/s for TV and film

Page 76: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

MPEG 7

A sophisticated system meant for content management

Encodes high semantic informationShows the dedication of MPEG

community to go from a mere compression scheme to information management system

Page 77: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

MPEG 21

Builds in the concept of digital rights management

Watermarking algorithms for videos and images

Page 78: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Lossless predictive coding

Eliminates interpixel redundancy of closely spaced pixelsEliminates interpixel redundancy of closely spaced pixels extract and code only extract and code only new informationnew information

[difference between actual and predicted value of that pixel][difference between actual and predicted value of that pixel]

predictorpredictor Nearest Nearest integerinteger

SymbolSymbolencoderencoder

inputinputffnn

ffnn^̂

eenn

predictorpredictor

SymbolSymbolencoderencoder

ffnn^̂

eenn ffnn

Binary flowBinary flow

Binary flowBinary flow

encoderencoder

decoderdecoder++

--

++

++

See trSee tr

Page 79: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Codebook

Codebook sizeC : # vectors

k : # pixels / vectorI : size of indexR : bit rate

bitsClogI 2

bppk

IR

I :[6 bpp - 12bpp]I :[6 bpp - 12bpp]C : [32 - 4096]C : [32 - 4096]k : 4 - 32k : 4 - 32

R : [0.5 - 2 bpp]R : [0.5 - 2 bpp]

Ordres de grandeur

Page 80: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Q. V. AlgébriqueQ. V. Algébrique

Quantification Vectorielle Algébrique

=

Quantification Vectorielle

+Dictionnaire = réseau régulier de points

Définition du réseauDéfinition de la relation de quantificationIndexage

Quantifier =

Page 81: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Alogorithme LBG(0) INITIALISATION

 Séquence d'apprentissage formée de vecteurs X (training vectors)(les N premiers vecteurs, sélection aléatoire, splitting)

 Dictionnaire initial formé de vecteurs Y

(1) CLASSIFICATION des vecteurs X

Obtention d'une PARTITION de la séquence

Critère de distorsion à minimiser : d(X,Y) = X-Y2

(2) OPTIMISATION du représentant de chaque classe de la partition

Calcul du centre gravité cen(C) de chaque classe C

Nouveau dictionnaire : Y = cen(C)

Page 82: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Codebook

- Vecteurs de reproduction calculés par classification- Quantification par “Full Search”- Codebook adapté à la statistique /apprentissage- Points d’un réseau régulier (pas de calcul)- Algorithme rapide de quantification.- Troncature du réseau et scaling adaptés à la statistique.

•Méthodes classiques par apprentissage•Méthode géométrique

Page 83: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Codebook design

•Algorithm of CLASSIFICATION LBG[Linde - Buzo - Gray 1980]

• Minimisation distortion criteria

• Iteratif

• KOHONEN neural network

•TREILLIS[Conway & Sloane 1980]

• Codebook organised in the space

Définition du réseauDéfinition de la relation de quantificationIndexage

Page 84: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Coding redundancy

Variable length codingVariable length coding

L gray levels --> histogramL gray levels --> histogram 110 L,...,,kn

n)r(prob k

k

nk

k

nk :# of times that the kth gray level appears

n : total number

L(rL(rkk)) : # of bits used to represent each value of r : # of bits used to represent each value of rkk

)r(prob)r(LL k

L

kkavr

1

0

Average # of bits to represent each pixelAverage # of bits to represent each pixelAverage length of codewordsAverage length of codewords

TOTAL # of bits = # of pixels TOTAL # of bits = # of pixels x LLavravr

Page 85: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Algorithme de Huffman

1. Soit L une liste des probabilités des symboles de la source qui sont associées aux feuilles d ’un arbre binaire.

2. Choisir les deux plus faibles probabilités dans L et construire un nœud parent. Etiquetter une branche par 1 et l ’autre par 0

3. Remplacer les deux probabilités par la somme et l ’associer au nœud formé. Terminer si la liste contient un seul élément; Sinon aller à l ’étape 2

Page 86: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Arithmetic coding

- It generates nonblock coding- It generates nonblock coding- One to one correspondance between source symbols and - One to one correspondance between source symbols and codewords doesn ’t existcodewords doesn ’t exist- An entire sequence of source symbol is assigned a single - An entire sequence of source symbol is assigned a single arithmetic code word which defines an interval of real numbers arithmetic code word which defines an interval of real numbers between 0 and 1between 0 and 1- As # of symbols increases --> the interval to represent it - As # of symbols increases --> the interval to represent it becomes smallerbecomes smaller- Each symbol of the message reduces the size of interval in - Each symbol of the message reduces the size of interval in accordance with its probability of occurrenceaccordance with its probability of occurrence

Page 87: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Arithmetic coding

Un mot de code Un mot de code (nombre) pour une (nombre) pour une suite de symbolessuite de symboles

Precision pbPrecision pb

Page 88: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Lossless predictive coding

Eliminates interpixel redundancy of closely spaced pixelsEliminates interpixel redundancy of closely spaced pixels extract and code only extract and code only new informationnew information

[difference between actual and predicted value of that pixel][difference between actual and predicted value of that pixel]

predictorpredictor Nearest Nearest integerinteger

SymbolSymbolencoderencoder

inputinput

ffnn

ffnn^̂

eenn

predictorpredictor

SymbolSymbolencoderencoder

ffnn^̂

eenn ffnn

Binary flowBinary flow

Binary flowBinary flow

encoderencoder

decoderdecoder++

--

++

++

See trSee tr

Page 89: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Predictive coding

Simple predictive methodSimple predictive method DCTDCT

xx xx

xxxxjj

ii

)j,i(f̂)j,i(f)j,i(

)j,i(Cf

)j,i(Bf

)j,i(Af)j,i(f̂

11

1

1

0 no prediction1 A2 B3 C4 A+B-C5 A+(B-C)/26 B+(A-C)/27 (A+B)/2

2:12:1

Page 90: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

QS --> Quantification Vectorielle

Shannon à montré que les performances du codage d ’une source Shannon à montré que les performances du codage d ’une source

sans mémoire sont améliorées (on approche les courbes débit-sans mémoire sont améliorées (on approche les courbes débit-

distortion)si l ’on augmente la taille des blocs d ’échantillons.distortion)si l ’on augmente la taille des blocs d ’échantillons.

Zador a montré aussi que la QV peut donner une meilleure erreur Zador a montré aussi que la QV peut donner une meilleure erreur

quadratique moyenne par dimension dans le cas d ’un nombre de quadratique moyenne par dimension dans le cas d ’un nombre de

vecteurs de reproduction asymptotiquement grandsvecteurs de reproduction asymptotiquement grands

Page 91: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Definition

codebook

1

2

3

4 5

6

7

89

10

11

12

13

14

15

12

y

y

y

y

y

y

y

yy

y

y

yy

y

y

y

X=(x1,x2)

Y7

Q :Rn Y

X Q X Y i si X Ci

i, j 1,...,L

CiRn CiCj ij i,j1,...,L

Y Y1, Y2 YL ,...,

Ci X Rn/ Q X Y i

et si

define codebook

quantize

code (index)

Page 92: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Etapes de quantification vectorielle

0) Quantifier

1) Trouver l’index I d’un vecteur de reproduction Yi

1

i

L

Dictionnaire

Yi

i

valeur

index

2) Trouver le vecteur de reproduction Yi connaissant l’index I

Page 93: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Codebook

Codebook sizeC : # vectors

k : # pixels / vectorI : size of indexR : bit rate

bitsClogI 2

bppk

IR

I :[6 bpp - 12bpp]I :[6 bpp - 12bpp]C : [32 - 4096]C : [32 - 4096]k : 4 - 32k : 4 - 32

R : [0.5 - 2 bpp]R : [0.5 - 2 bpp]

Ordres de grandeur

Page 94: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Q. V. AlgébriqueQ. V. Algébrique

Quantification Vectorielle Algébrique

=

Quantification Vectorielle

+Dictionnaire = réseau régulier de points

Définition du réseauDéfinition de la relation de quantificationIndexage

Quantifier =

Page 95: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Alogorithme LBG(0) INITIALISATION

 Séquence d'apprentissage formée de vecteurs X (training vectors)(les N premiers vecteurs, sélection aléatoire, splitting)

 Dictionnaire initial formé de vecteurs Y

(1) CLASSIFICATION des vecteurs X

Obtention d'une PARTITION de la séquence

Critère de distorsion à minimiser : d(X,Y) = X-Y2

(2) OPTIMISATION du représentant de chaque classe de la partition

Calcul du centre gravité cen(C) de chaque classe C

Nouveau dictionnaire : Y = cen(C)

Page 96: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Codebook

- Vecteurs de reproduction calculés par classification- Quantification par “Full Search”- Codebook adapté à la statistique /apprentissage- Points d’un réseau régulier (pas de calcul)- Algorithme rapide de quantification.- Troncature du réseau et scaling adaptés à la statistique.

•Méthodes classiques par apprentissage•Méthode géométrique

Page 97: Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille.

Codebook design

•Algorithm of CLASSIFICATION LBG[Linde - Buzo - Gray 1980]

• Minimisation distortion criteria

• Iteratif

• KOHONEN neural network

•TREILLIS[Conway & Sloane 1980]

• Codebook organised in the space

Définition du réseauDéfinition de la relation de quantificationIndexage