lloyd-max quantization schemes -...

69
Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations Lloyd-Max Quantization Schemes Helmut Knaust Department of Mathematical Sciences The University of Texas at El Paso El Paso TX 79968-0514 [email protected] January 6, 2011

Upload: others

Post on 02-Jul-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Lloyd-Max Quantization Schemes

Helmut KnaustDepartment of Mathematical Sciences

The University of Texas at El PasoEl Paso TX 79968-0514

[email protected]

January 6, 2011

Page 2: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

1 Introduction

2 Basic Quantization Schemes

3 Lloyd-Max Quantization Setup

4 Lloyd-Max Quantization for “Raw” Images

5 Lloyd-Max Quantization for Transformed Images

6 Generalizations

Page 3: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Learning Outcomes and Prerequisites

Learning Outcomes:

Students will reflect on the role of quantization in imagecompression.Students will improve their programming skills.

Prerequisites:Multi-variable CalculusSome knowledge of wavelet transforms and their use inimage compressionSome minimal statistics knowledge

Page 4: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Learning Outcomes and Prerequisites

Learning Outcomes:Students will reflect on the role of quantization in imagecompression.

Students will improve their programming skills.Prerequisites:

Multi-variable CalculusSome knowledge of wavelet transforms and their use inimage compressionSome minimal statistics knowledge

Page 5: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Learning Outcomes and Prerequisites

Learning Outcomes:Students will reflect on the role of quantization in imagecompression.Students will improve their programming skills.

Prerequisites:Multi-variable CalculusSome knowledge of wavelet transforms and their use inimage compressionSome minimal statistics knowledge

Page 6: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Learning Outcomes and Prerequisites

Learning Outcomes:Students will reflect on the role of quantization in imagecompression.Students will improve their programming skills.

Prerequisites:

Multi-variable CalculusSome knowledge of wavelet transforms and their use inimage compressionSome minimal statistics knowledge

Page 7: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Learning Outcomes and Prerequisites

Learning Outcomes:Students will reflect on the role of quantization in imagecompression.Students will improve their programming skills.

Prerequisites:Multi-variable Calculus

Some knowledge of wavelet transforms and their use inimage compressionSome minimal statistics knowledge

Page 8: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Learning Outcomes and Prerequisites

Learning Outcomes:Students will reflect on the role of quantization in imagecompression.Students will improve their programming skills.

Prerequisites:Multi-variable CalculusSome knowledge of wavelet transforms and their use inimage compression

Some minimal statistics knowledge

Page 9: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Learning Outcomes and Prerequisites

Learning Outcomes:Students will reflect on the role of quantization in imagecompression.Students will improve their programming skills.

Prerequisites:Multi-variable CalculusSome knowledge of wavelet transforms and their use inimage compressionSome minimal statistics knowledge

Page 10: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Quantization

Quantization reduces ranges of values in a signal to asingle value, thereby reducing entropy.

Quantization is an integral part of lossy compressionalgorithms.

Quantization is usually employed after transformation.

Page 11: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Quantization

Quantization reduces ranges of values in a signal to asingle value, thereby reducing entropy.

Quantization is an integral part of lossy compressionalgorithms.

Quantization is usually employed after transformation.

Page 12: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Quantization

Quantization reduces ranges of values in a signal to asingle value, thereby reducing entropy.

Quantization is an integral part of lossy compressionalgorithms.

Quantization is usually employed after transformation.

Page 13: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Basic Quantization Scheme: Thresholding

The most basic quantization technique is Thresholding:

Given a signal ~x = (xi) and a single threshold σ, we replacevalues as follows:

q(xi) =

{0 if |xi | ≤ σxi if |xi | > σ

Page 14: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The thresholding quantization function:

x

qHxL

Page 15: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The JPEG2000 Quantization Scheme

The Lossy JPEG2000 Quantization Scheme also has onefixed parameter, τ . After wavelet transformation, a “step”quantization

q(xi) = sgn(xi) · σ ·⌊|xi |σ

⌋is applied to each region with a parameter σ determined asfollows:

Τ

2 Τ

Τ 2 Τ

n = 1

Page 16: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The JPEG2000 Quantization Scheme

The Lossy JPEG2000 Quantization Scheme also has onefixed parameter, τ . After wavelet transformation, a “step”quantization

q(xi) = sgn(xi) · σ ·⌊|xi |σ

⌋is applied to each region with a parameter σ determined asfollows:

Τ

2

Τ

2 Τ

Τ

Τ 2 Τ

n = 2

Page 17: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The JPEG2000 Quantization Scheme

The Lossy JPEG2000 Quantization Scheme also has onefixed parameter, τ . After wavelet transformation, a “step”quantization

q(xi) = sgn(xi) · σ ·⌊|xi |σ

⌋is applied to each region with a parameter σ determined asfollows:

Τ

2

Τ

2

Τ

2 Τ

Τ

Τ 2 Τ

n = 3

Page 18: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The quantization function for a given region:

x

qHxL

Page 19: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

For a fixed signal ~x and a fixed positive integer n, Lloyd-Maxquantization uses two sets of parameters:

Bin-boundaries ~L = (L1,L2, . . . ,Ln+1), withmin~x = L1 < L2 < · · · < Ln < Ln+1 = 1 + max~x ,and replacement values ~p = (p1,p2, . . . ,pn).

The quantization function replaces the x-values in the bin[Lj ,Lj+1) by the value pj :

q(xi) = pj , when xi ∈ [Lj ,Lj+1)

Page 20: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The goal is to choose ~L and ~p to minimize the resultingquantization error

E(~L, ~p) =m∑

i=1

|xi − q(xi)|2

This is a classical Calculus problem. Rewriting we obtain:

E(~L, ~p) =n∑

j=1

∑xi∈[Lj ,Lj+1)

(xi − pj)2

Page 21: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

E(~L, ~p) =n∑

j=1

∑xi∈[Lj ,Lj+1)

(xi − pj)2

Since minima will occur only if all partial derivatives are equal to0, the following conditions need to be satisfied:

∂ E∂pj

=∑

xi∈[Lj ,Lj+1)

2(xi − pj) = 0⇔ pj =

∑xi∈[Lj ,Lj+1)

xi

#{i | xi ∈ [Lj ,Lj+1)}(1)

∂ E∂Lj

= 0 ⇔ Lj =12(pj−1 + pj) (2)

p j-1 L j p jxi

Page 22: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

E(~L, ~p) =n∑

j=1

∑xi∈[Lj ,Lj+1)

(xi − pj)2

Since minima will occur only if all partial derivatives are equal to0, the following conditions need to be satisfied:

∂ E∂pj

=∑

xi∈[Lj ,Lj+1)

2(xi − pj) = 0⇔ pj =

∑xi∈[Lj ,Lj+1)

xi

#{i | xi ∈ [Lj ,Lj+1)}(1)

∂ E∂Lj

= 0 ⇔ Lj =12(pj−1 + pj) (2)

p j-1 L j p jxi

Page 23: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

E(~L, ~p) =n∑

j=1

∑xi∈[Lj ,Lj+1)

(xi − pj)2

Since minima will occur only if all partial derivatives are equal to0, the following conditions need to be satisfied:

∂ E∂pj

=∑

xi∈[Lj ,Lj+1)

2(xi − pj) = 0⇔ pj =

∑xi∈[Lj ,Lj+1)

xi

#{i | xi ∈ [Lj ,Lj+1)}(1)

∂ E∂Lj

= 0 ⇔ Lj =12(pj−1 + pj) (2)

p j-1 L j p jxi

Page 24: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

E(~L, ~p) =n∑

j=1

∑xi∈[Lj ,Lj+1)

(xi − pj)2

Since minima will occur only if all partial derivatives are equal to0, the following conditions need to be satisfied:

∂ E∂pj

=∑

xi∈[Lj ,Lj+1)

2(xi − pj) = 0⇔ pj =

∑xi∈[Lj ,Lj+1)

xi

#{i | xi ∈ [Lj ,Lj+1)}(1)

∂ E∂Lj

= 0 ⇔ Lj =12(pj−1 + pj) (2)

p j-1 L j p jxi

Page 25: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

These equations can usually not be solved explicitly; instead atwo-step procedure is used repeatedly until a fixed point hasbeen (nearly?) reached:

Equations (1) are used to update the values ~p:

pnewj = ave

{xi | xi ∈ [Lj ,Lj+1)

}Equations (2) then yield new values for ~L:

Lnewj =

12(pnew

j−1 + pnewj ) , j = 2, . . . ,n

The values for L1 and Ln+1 are left unchanged.

Page 26: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

These equations can usually not be solved explicitly; instead atwo-step procedure is used repeatedly until a fixed point hasbeen (nearly?) reached:

Equations (1) are used to update the values ~p:

pnewj = ave

{xi | xi ∈ [Lj ,Lj+1)

}

Equations (2) then yield new values for ~L:

Lnewj =

12(pnew

j−1 + pnewj ) , j = 2, . . . ,n

The values for L1 and Ln+1 are left unchanged.

Page 27: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

These equations can usually not be solved explicitly; instead atwo-step procedure is used repeatedly until a fixed point hasbeen (nearly?) reached:

Equations (1) are used to update the values ~p:

pnewj = ave

{xi | xi ∈ [Lj ,Lj+1)

}Equations (2) then yield new values for ~L:

Lnewj =

12(pnew

j−1 + pnewj ) , j = 2, . . . ,n

The values for L1 and Ln+1 are left unchanged.

Page 28: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

As an example, we apply the algorithm to a grayscale image,with n = 32. The initial bins are chosen at random.

Original image, entropy=7.65

Page 29: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

As an example, we apply the algorithm to a grayscale image,with n = 32. The initial bins are chosen at random.

21 iterations, entropy=4.75, PSNR 40.7

Page 30: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

As an example, we apply the algorithm to a grayscale image,with n = 32. The initial bins are chosen at random.

28 iterations, entropy=4.56, PSNR 40.0

Page 31: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is the quantization function for the second run:

0 50 100 150 200 250x0

50

100

150

200

250

qHxL

Page 32: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Quantization applied to “raw” images usually gives bad resultsin areas of gradual gray-value change (sky, water, etc.):

Original image:entropy=7.63

Page 33: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Quantization applied to “raw” images usually gives bad resultsin areas of gradual gray-value change (sky, water, etc.):

n = 26:10 iterations, entropy=5.53, PSNR 45.1

Page 34: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Quantization applied to “raw” images usually gives bad resultsin areas of gradual gray-value change (sky, water, etc.):

n = 25:18 iterations, entropy=4.35, PSNR 38.0

Page 35: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Quantization applied to “raw” images usually gives bad resultsin areas of gradual gray-value change (sky, water, etc.):

n = 24:22 iterations, entropy=3.76, PSNR 34.7

Page 36: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

We now compare step quantization to Lloyd-Max quantizationfor a transformed image:

We use the CDF97 wavelet transform once.For the step quantization we use τ = 16:

Original image (-128): entropy=7.74

Page 37: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

We now compare step quantization to Lloyd-Max quantizationfor a transformed image:

We use the CDF97 wavelet transform once.For the step quantization we use τ = 16:

CDF97-transformed image

Page 38: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

We now compare step quantization to Lloyd-Max quantizationfor a transformed image:

We use the CDF97 wavelet transform once.For the step quantization we use τ = 16:

Τ�2=8 Τ=16

Τ=16 2Τ=32

Step sizes for the quantization

Page 39: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

We now compare step quantization to Lloyd-Max quantizationfor a transformed image:

We use the CDF97 wavelet transform once.For the step quantization we use τ = 16:

Quantized transform: entropy=2.75

Page 40: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

We now compare step quantization to Lloyd-Max quantizationfor a transformed image:

We use the CDF97 wavelet transform once.For the step quantization we use τ = 16:

Reconstructed image: PSNR 32.44

Page 41: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is the same example with Lloyd-Max quantization:

Original image (-128): entropy=7.74

Page 42: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is the same example with Lloyd-Max quantization:

CDF97-transformed image

Page 43: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is the same example with Lloyd-Max quantization:

n=24 n=10

n=11 n=6

Number of bins for the quantization

Page 44: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is the same example with Lloyd-Max quantization:

Quantized transform: entropy=3.73

Page 45: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is the same example with Lloyd-Max quantization:

Reconstructed image: PSNR=33.44

Page 46: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Why is the entropy comparatively high after LM-quantization?Here are the histograms of the quantized transformed signals:

Step quantization Lloyd-Max quantization

Page 47: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Lloyd-Max quantization can be generalized to higherdimensions.

The bin boundary conditions in Equations (2) now becomeVoronoi cell conditions.The update step given by Equations (1) still remains: Thenew replacement values are the average of the signalvalues in the Voronoi cell.

Page 48: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 49: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 50: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 51: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 52: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 53: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 54: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 55: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 56: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 57: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 58: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 59: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 60: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 61: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 62: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 63: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 64: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 65: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 66: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 67: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

Here is a two-dimensional example:

Page 68: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The End...

Any Questions?

Helmut [email protected]

Page 69: Lloyd-Max Quantization Schemes - Knausthelmut.knaust.info/presentations/2011/20110106_JMM_DWT.pdf2011/01/06  · Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed

Introduction Basic Quantization Lloyd-Max “Raw” Images Transformed Images Generalizations

The End...

Any Questions?

Helmut [email protected]