La présentation est en train de télécharger. S'il vous plaît, attendez

La présentation est en train de télécharger. S'il vous plaît, attendez

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

Présentations similaires


Présentation au sujet: "Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille."— Transcription de la présentation:

1 Image processing Image and image sequence compression bases Session Ecole Centrale Marseille

2 Goal zGive in 2 hours some technics of compression zIntroduction of mathematical tools Based on information theory

3 Plan I) Introduction II) Tools III) Lossless compression (redundancy) IV) Lossy compression scalar quatization vector quatization V) Norms

4 Digital images and sequences L C C L L x C pixels by image 8 bits / pixel Image Sequence Different formats or standards RGB,YUV(NTSC,PAL,SECAM)

5 Formats RGB: red, green blue YUV : Y black and white component U, V color information U, V color information YC b C r : scaled and offset versions of YUV

6 Compression : why ? Transmission Storage Decrease de bitrate with compression technics Problem Amount of data Elimination of redundancy Quantization...

7 Amount of datas Exemple of format PAL itu-r 601 Resolution : 720 columns and 576 rows YC b C r : 4:2:2 Interlaced (frame ou trame image) Y = 720 x 576= C b C r = 2 x 360 x 576 = Total = bytes / image Si 25 images / sec(50 trames / sec) Total =20,7 Mb / sec

8 Evolution Increase of quality, increase the size of images, a lot of images... More and more data VISION

9 Compression Data compression addresses the problem of reducing the amount of data required to represent given quantity of information ExampExamplleeExampExamplleele N M y0y0y0y0 x0x0x0x0 NxM pixels Coordinates, radius, gray levels (5 values)

10 Plan I) Introduction II) Tools

11 Transmission of information Mathématical theory of communication W. Weaver et C.E. Shannon source of information transmitter signal source of noise receiver message destination message

12 compression system model Source encoder Channel encoder Channel decoder Source decoder Channel encoder decoder noise f f exemple mapper quantizer Symbol encoder Transform : DCT,FFT,WT DCT,FFT,WT SQ,VQ Inverse mapper Symbol decoder... ^

13 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 f Error free (lossless compression) Lossy compression f f f ^ f ^ =

14 Measures Quality : error between original signal and received signal Bit rate : quantity of bits Possibility : complexity of the system (software or hardware)

15 Fidélity criteria

16 where 255 is the maximum value of the signal

17 Fidélity criteria Subjective Value Rating 1excellentextremely high quality 2finehigh quality 3passable 4marginal 5inferiorvery poor image 6unusablecant watch it

18 Measuring information A random even E that occurs with probability P(E) is said to contains Units of info Self information P(E)=1event always occurs P(E)=0event never occurs P(E)=0.999==> small information Log 2 bits

19 Measuring information The average information per source output is ENTROPY H uncertainty information H uncertainty information Shannon

20 Definitions N1 bits before compression N2 bits after compression Compression ratio Relative data redundancy

21 Technics Image compression Lossless compression : quality is preserved low compression Sequence compression Lossy compression : quality decreases high compression

22 cameraman Cam10.jpeg

23 Cam50.jpg Cam99.jpg

24 Plan I) Introduction II) Tools III) Lossless compression (redundancy)

25 Error free compression Redundancy reduction - coding reduction - interpixel redundancy dpcm,... - psychovisual redundancy

26 Code length (Longueur de code) Code 1 L=3 Code 2 Code 2

27 Huffman coding Assignes fewer bits to the more probable gray levels than to the less probable ===> data compression Variable-length code Code optimal, code unique Most popular

28 Huffman coding Two steps : 1 / create a series of source reductions by ordering the probabilities of the symbols under consideration and combining the lowest proba symbols into a single symbol that replace them in the next source reduction 2 / code each reduced source, starting with the smallest source and working back to the original source. (start with 0 or 1 arbitrarily)

29

30 Example Lavr = 0.4 x x x x x x x x x x 5 = 2.2 bits/symbol Ex : means : a3 a1 a2 a2 a6

31 Arithmetic coding Un mot de code (nombre) pour une suite de symboles Precision pb

32 Run length coding Represent each row of an image or bit plane by sequences of lengths that describe successive runs of black and white pixels. fax, standard compression,... Basic concept : code each group of O s (1 s) encountered in a left to right scan of a row by its lenght. (pattern recognition)

33 Rlc : example Original data Compressed data 13 bytes 10 bytes (10/13=0.77)

34 Bit plane coding Decompose a multilevel image into a serie of binary images and compress each image (binary) via one of several well known binary compression method Ex : code each group of O s (1 s) encountered in a left to right scan of a row by its length. 8 bits image 8 binary images

35 Lemple-Ziv and Welch coding Pattern recognition 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 Ca Cb Ca Cb 10 Original data Compressed data

36 Predictive coding Simple predictive method DCT x x x x j i 0no prediction 1A 2B 3C 4A+B-C 5A+(B-C)/2 6B+(A-C)/2 7(A+B)/2 2:1

37 Plan I) Introduction II) Tools III) Lossless compression (redundancy) IV) Lossy compression transform quantisation scalar quantisation vector quantisation

38 Compression system compression transform coding ! Attention au mot codage en anglais et français image coefficientsindex code code binary flow

39 Statistics

40 Transform coding Tquantizer Entropy encoder TablespecificationsTablespecifications 8x8 blocs Compressed image T -1 dequantizer Entropy decoder TablespecificationsTablespecifications Source image Reconstructed image DCT,FFT,WT DCT,FFT,WT SQ,VQ reorder data same information

41 Transform coding A transform is used to map the image into a set of transform coefficientswhich are then quantized and coded For natural images, a significant number of coefficients have small magnitudes and can be coarsely quantized (set to zero) without significant distortion. If information of image is well organised ! Goal : decorrelate pixels. Pack as much info as possible into the smallest number of pixels Compression is not achieved during the transform !

42 JPEG

43 Discrete Fourier Transform FDCT IDCT 8x8 bloc Source image

44 Quantizers Scalar quantizer : one pixel at a time Vector quantizer : group of pixels

45 Scalar quantization X= Y=12 Consider the input x. As a matter of convention x is considered to be mapped to y i R if x lies in ]s j, s i+1 ]. y i belongs to a finite set of L values Degradation of signal

46 Definition x1x1 x2x2 x3x3 x N-2 x N-1 Y1Y1 Y2Y2 Y3Y3 YNYN Y N-1 Uniform scalar quantizer Decision levels Reconstruction levels Quantizer design problem select the best Xi and Yj for a particular optimization criterion and pdf of input

47 Uniform optimal quantizer (1D) Optimum mean square Lloyd-Max quantizer Criterion : minimise rms for a fixed number of quantization levels Reconstruction levels are the centroids of areas under p(x) over specified decision interval Decision levels are half way between reconstruction levels

48 Caracteristic x1x1 x8x8 x Y Y1Y1 Y8Y8 x1x1 x8x8 Quantizer error : difference between input and the reproduction level x (Truncation error if input is out of range)

49 Quantization noise Assume e step quantization error (x i -y i ) quantization error (x i -y i ) Hyp : e small and x i equally distributed in [-e/2,e/2] p( ) is uniform in [-e/2,e/2] 1/ 1/ p( ) -e/2 e/2 Noise power

50 Signal to noise ratio Example : sine wave with amplitude Vm Power of signal Quantization noise

51 Compander Companding =compressing + expanding Pb : low values are badly quantized Pdf should be cte between V max (Loi u)

52 SQ --> Vector quantization Shannon : # of samples --> efficiency of coding Zador : # of reproduction vectors --> mse

53 y y y y y y y y y y y y y y y y Y 7 Definition codebook X=(x 1,x 2 ) Q : R n Y X Q X Y i siX C i i,j 1,...,L C i R n C i C j i j i,j 1,...,L Y Y 1,Y 2 Y L,..., C i X R n / Q X Y i et si Ci : voronoi Yi : codebook vectors

54 Shéma de principe i L 1 Dictionnaire i Décodage Flot Binaire Y i Recherche d u vecteur i L 1 Dictionnaire X Min (d( X,Y )) i i i Codage Source Vectorielle Calcul de coût Calcul de qualité

55

56 Remarks Beaucoup de blocs dans l image sont similaires Beaucoup de blocs possibles ont peu de chance d apparaître Réduire le nombre de vecteurs de reproduction possibles ex : 1024 vecteurs (10 bits) (taille dictionnaire) débit moyen : 10 / (4x4) = bpp Minimiser la distorsion Type de source (image transformée en général)

57 Vector quantization zCodebook design yminimum distortion yfixed codebook size / storage zCodebook search yfast - efficient zDecoding yreconstruction 1 i L Codebook Y i i value index

58 Codebook design Classification LBG algorithm Codebook design Iterative algorithme Quantization Lattices - codebook vectors regularly spaced in the space - fast algorith Full search,... Minimisation of distortion criteria training vectors complex Linde - Buzo - Gray 1980 Conway & Sloane 1980 adaptedadaptedadaptedadapted fastfastfastfast

59 Lattices exemple: n Z 3

60 Vector quantization zHardware and software point of view on line off line complexity CD, satellite transmission, data bases standards -> hardware implementation

61 VQ multirésolution Dictionnaire R LR Dictionnaire LL 1/2 C Dictionnaire LL 1C Dictionnaire LL 3/2 C Dictionnaire LL 2C Allocation des débits Allocation de bits croissante Décomposition multirésolution Dictionnaire multirésolution

62 C=50 C=120 originale

63 Plan I) Introduction II) Généralités III) Compression sans perte réduction de redondance IV) Compression avec pertes quantification scalaire quantification vectorielle Compression de séquences

64 Méthodes ère méthode x x Décomposition spatio-temporelle x x Quantification vectorielle algébrique ème méthode x x Estimation - Compensation de mouvement x x Quantification vectorielle algébrique

65 Décomposition temporelle Décomposition spatiale R LR L LL mC Q V A Décomposition spatio-temporelle

66 Principle i j t t-1 t+1 i' j' i' j' i" j" i j i j d u v -> Estimation Compensation

67 Motion estimation Quantification Indexage Désindexage Retard Estimation Compensation ItIt I t+1 I t-1 ItIt ^ ^ ~ ~ ItIt * Retard Estimation Compensation I t+1 I t-1 ItIt ^ ^ ~ * ItIt ^ Désindexage Codeur Décodeur

68 Compression de Miss America C=100 C=220 original

69 Bibliography zDigital Image Processing, R.C. Gonzalez & R.E. Woods, Addison Wesley zVector quantization, R.M. Gray, IEEE ASSP Magazine, april 1984 zImage coding using vector quantization : a review, N.M. Nasrabadi & R.A. King, IEEE Trans. On Com., vol36 n°8, august zImage data compression, A.K. Jain, Proc. Of IEEE, vol69 n°3, march 1981 zTravaux, thèse et notes personnelles

70 End Thank you for your attention

71 Extra slides

72 Video Compression Standards zVideo 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 zDepending on intended application, the standards can be grouped into two broad categories: yVideo teleconferencing standards yMultimedia standards

73 Videoconferencing standards zA number of teleconferencing standards have been defined by International Telecommunication Union (ITU) yH.261: intended for operation at affordable telecom bit rates with delay of less than 150ms yH.262: based on MPEG2 standard for multimedia compression yH.263: designed for very low bit rate video, in the range of 10 to 30 kBits/s yH.320: desgined for ISDN lines yAll are based on MPEG type compression scheme

74 Multimedia Video Compression zDeveloped for Video on Demand, HDTV, CD image video database zMPEG-1: for high quality video as on CDROM supporting bit rate os 1.5MBits/s zMPEG2: 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 zMPEG1 and MPEG2 are meant for storage and transmission efficiency

75 MPEG standards zMPEG4 provides yImproved video compression efficiency yContent based interactivity yAV object access and efficient integration of natural and synthetic data yUniversal access yAll these make segmentation necessary though no approach is proposed for segmentation. yIt requires change on the creation side: similar to multitrack audio capture yTargets bit rates of 5 to 64 Kbits/s for mobile devices and 4Mbits/s for TV and film

76 MPEG 7 zA sophisticated system meant for content management zEncodes high semantic information zShows the dedication of MPEG community to go from a mere compression scheme to information management system

77 MPEG 21 zBuilds in the concept of digital rights management zWatermarking algorithms for videos and images

78 Lossless predictive coding Eliminates interpixel redundancy of closely spaced pixels extract and code only new information extract and code only new information [difference between actual and predicted value of that pixel] predictor Nearestinteger Symbolencoder input fnfnfnfn fnfnfnfn ^ enenenen predictor Symbolencoder fnfnfnfn ^ enenenen fnfnfnfn Binary flow encoder decoder See tr

79 Codebook zCodebook size C : # vectors k : # pixels / vector I : size of index R : bit rate I :[6 bpp - 12bpp] C : [ ] k : R : [ bpp] Ordres de grandeur

80 Q. V. Algébrique Quantification Vectorielle Algébrique = Quantification Vectorielle + Dictionnaire = réseau régulier de points Définition du réseau Définition de la relation de quantification Indexage Quantifier =

81 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-Y 2 (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)

82 Codebook - Vecteurs de reproduction calculés par classification - Quantification par Full Search - Codebook adapté à la statistique /apprentissage - Points dun 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

83 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éseau Définition de la relation de quantification Indexage

84 Coding redundancy Variable length coding L gray levels --> histogram nknk k n k : # of times that the k th gray level appears n : total number L(r k ) : # of bits used to represent each value of r k Average # of bits to represent each pixel Average length of codewords TOTAL # of bits = # of pixels L avr TOTAL # of bits = # of pixels x L avr

85 Algorithme de Huffman z1. Soit L une liste des probabilités des symboles de la source qui sont associées aux feuilles d un arbre binaire. z2. 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 z3. 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

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

87 Arithmetic coding Un mot de code (nombre) pour une suite de symboles Precision pb

88 Lossless predictive coding Eliminates interpixel redundancy of closely spaced pixels extract and code only new information extract and code only new information [difference between actual and predicted value of that pixel] predictor Nearestinteger Symbolencoder input fnfnfnfn fnfnfnfn ^ enenenen predictor Symbolencoder fnfnfnfn ^ enenenen fnfnfnfn Binary flow encoder decoder See tr

89 Predictive coding Simple predictive method DCT x x x x j i 0no prediction 1A 2B 3C 4A+B-C 5A+(B-C)/2 6B+(A-C)/2 7(A+B)/2 2:1

90 QS --> Quantification Vectorielle Shannon à montré que les performances du codage d une source sans mémoire sont améliorées (on approche les courbes débit- distortion)si l on augmente la taille des blocs d échantillons. Zador a montré aussi que la QV peut donner une meilleure erreur quadratique moyenne par dimension dans le cas d un nombre de vecteurs de reproduction asymptotiquement grands

91 Definition codebook Q : R n Y X Q X Y i siX C i i,j 1,...,L C i R n C i C j i j i,j 1,...,L Y Y 1,Y 2 Y L,..., C i X R n / Q X Y i et si 3 3 define codebook 3 3 quantize 3 3code (index)

92 Etapes de quantification vectorielle 0) Quantifier 1) Trouver lindex I dun vecteur de reproduction Y i 1 i L Dictionnaire Y i i valeur index 2) Trouver le vecteur de reproduction Y i connaissant lindex I

93 Codebook zCodebook size C : # vectors k : # pixels / vector I : size of index R : bit rate I :[6 bpp - 12bpp] C : [ ] k : R : [ bpp] Ordres de grandeur

94 Q. V. Algébrique Quantification Vectorielle Algébrique = Quantification Vectorielle + Dictionnaire = réseau régulier de points Définition du réseau Définition de la relation de quantification Indexage Quantifier =

95 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-Y 2 (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)

96 Codebook - Vecteurs de reproduction calculés par classification - Quantification par Full Search - Codebook adapté à la statistique /apprentissage - Points dun 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

97 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éseau Définition de la relation de quantification Indexage


Télécharger ppt "Image processing Image and image sequence compression bases Session 2005-2006 Ecole Centrale Marseille."

Présentations similaires


Annonces Google