4c8 image compression. lossy compression effective bit rate = 8 bits/pixel effective bit rate = 1...
TRANSCRIPT
![Page 1: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/1.jpg)
4C8
Image Compression
![Page 2: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/2.jpg)
Lossy Compression
Effective bit rate = 8 bits/pixel
Effective bit rate = 1 bit/pixel (approx)
![Page 3: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/3.jpg)
Transform Coding
• In the last set of slides we showed that transforming the image into a difference image reduces the entropy of image.
G(x,y) = I(x,y) – I(x-1,y)
![Page 4: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/4.jpg)
Transform Coding
• This is because entropy is greatest when uniform
Histogram of the original image Histogram of the difference image
![Page 5: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/5.jpg)
Signal Energy
![Page 6: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/6.jpg)
Lossy Transform Coding
Lossless Lossy Lossless
Lossless
![Page 7: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/7.jpg)
Energy Compaction with Xforms
![Page 8: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/8.jpg)
The Haar Xform
LoLo Hi-Lo
Hi-HiLo-Hi
![Page 9: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/9.jpg)
![Page 10: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/10.jpg)
Implementation Details
• When calculating the haar transform for the image the mid gray value is typical.
• Colour Images are processed by treating each colour channel as separate gray scale images.– If YUV colourspace is used subsampling of
the U and V channels is probable.
![Page 11: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/11.jpg)
Quantisation
• After we create the image we quantise the transform coefficients.
• Step size is shown by perceptual evaluation
• We can assign different step sizes to the different bands.• We can use different step sizes for the different colour
channels.
• We will consider a uniform step size, Qstep, for each band for now.
![Page 12: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/12.jpg)
Entropy
Qstep = 15
![Page 13: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/13.jpg)
Entropy
• Calculating the overall entropy is trickier– Each coefficient in a band represents 4 pixel
locations in the original image.– So bits/pixel = (bits/coefficient)/4
• So the entropy of the transformed and quantised lenna is
pelbitsXH /07.24
70.1
4
80.0
4
15.1
4
65.4)(
Qstep = 15
![Page 14: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/14.jpg)
Mistake in Fig. 5 of handout
Red Dashed Line is the Histogram. Blue bars represent the “entropies” (ie. - p * log2(p) ) and not vice versa
![Page 15: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/15.jpg)
Multilevel Haar Xform
![Page 16: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/16.jpg)
Calculating the Entropy for Level 2 of the transform
• One Level 1 coefficient represents 4 pixels• One level 2 coefficient represents 16 pixels
4
Entropies 1 Level
16
Entropies 2 LevelEntropy
Bands Entropy/Coeff Entropy/pixel
Level 2
LoLo 5.58 0.34
LoHi 2.22 0.14
HiLo 2.99 0.19
HiHi 1.75 0.11
Level 1
LoHi 1.15 0.29
HiLo 1.70 0.43
HiHi 0.80 0.29
Total Entropy = 1.70 bits/pixel
Qstep = 15
![Page 17: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/17.jpg)
Multilevel Haar Xform
![Page 18: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/18.jpg)
Calculating the Entropy for Level 3 of the transform
• One Level 1 coefficient represents 4 pixels• One level 2 coefficient represents 16 pixels• One level 3 coefficient represents 64 pixels
4
Entropies 1 Level
16
Entropies 2 Level
64
Entropies 3 LevelEntropy
Qstep = 15
![Page 19: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/19.jpg)
Calculating the Entropy for Level 3 of the transform
• One Level 1 coefficient represents 4 pixels• One level 2 coefficient represents 16 pixels• One level 3 coefficient represents 64 pixels
4
Entropies 1 Level
16
Entropies 2 Level
64
Entropies 3 LevelEntropy
Bands Entropy/Coeff Entropy/pixel
Level 3
LoLo 6.42 0.10
LoHi 3.55 0.06
HiLo 4.52 0.07
HiHi 3.05 0.05
Level 2
LoHi 2.22 0.14
HiLo 2.99 0.19
HiHi 1.75 0.11
Level 1
LoHi 1.15 0.29
HiLo 1.70 0.43
HiHi 0.80 0.29
Total Entropy = 1.62 bits/pixel
Qstep = 15
![Page 20: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/20.jpg)
Multilevel Haar Xform
Qstep = 15
![Page 21: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/21.jpg)
Measuring Performance
• Compression Efficiency - Entropy• Reconstruction Quality – Subjective Analysis
Haar Transform
Quantisation
Quantisation
![Page 22: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/22.jpg)
Reconstruction Qstep = 15
![Page 23: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/23.jpg)
Reconstruction Qstep = 30
![Page 24: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/24.jpg)
Reconstruction Qstep = 30
Original Quantised Haar Transform + Quantisation
![Page 25: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/25.jpg)
Laplacian Pdfs
![Page 26: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/26.jpg)
So we can estimate x0 for the band by finding the standard deviation of the coefficient values.
GOAL – estimate a theoretical value for the entropy of one of the subbands
![Page 27: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/27.jpg)
x1 = 0, x2 = Q/2
x1 = (k-1/2)Q, x2 = (k-1/2)Q
![Page 28: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/28.jpg)
See Handout for Missing Steps Here
![Page 29: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/29.jpg)
Measured Entropy is less than what we would expect for a laplacian pdf. This is because the actual decay of the histogram is greater than an exponential decay.
![Page 30: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/30.jpg)
Practical Entropy Coding
![Page 31: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/31.jpg)
Huffman Coding
![Page 32: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/32.jpg)
Practical Results
![Page 33: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/33.jpg)
The code is inefficient because level 0 as a probability >>0.5 (0.8 approx)
Remember the ideal codelength
So if pk = 0.8, then
However, the minimum code length we can use for a symbol is 1 bit.
Therefore, we need to find a new way of coding level 0 – use run length coding
)(2log kk pl
bits32.0)8.0(2log kl
![Page 34: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/34.jpg)
RLC
![Page 35: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/35.jpg)
RLC coding to create “events”
13 -5 1 0 -1 00 00 0 00 00 0 0 0 00 0 0
Define max run of zeros as 8, and we are coding runs of 1, 2, 4 and 8 zeros
Here we have 4 non-zero “events”1 x Run-of-4-Zeros event2 x Run-of-2 zeros event1x Run-of-8-zeros event1 x Run-of-1-zero event
![Page 36: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/36.jpg)
Practical Results
![Page 37: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/37.jpg)
![Page 38: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/38.jpg)
Synchronisation
Say we have a source with symbols A, B and C. Say we wish to encode the message ABBCCBCABAA using the following code table
Symbol Code
A 0
B 10
C 11
The Coded message is therefore 010101111101101000
Q. What is the decoded message if the 6th bit in the stream is corrupted?
Ie. We receive 010100111101101000
![Page 39: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/39.jpg)
Synchronisation
• 010100111101101000
• The decoded stream is ABBACCACABA• The problem is that 1 bit error causes subsequent
symbols to be decoded incorrectly as well.• The stream is said to have lost synchronisation.• A solution is to periodically insert synchronisation
symbols into the stream (eg. One at the start of each row). This limits how far errors can propagate.
Symbol Code
A 0
B 10
C 11
![Page 40: 4C8 Image Compression. Lossy Compression Effective bit rate = 8 bits/pixel Effective bit rate = 1 bit/pixel (approx)](https://reader034.vdocument.in/reader034/viewer/2022051401/56649ee65503460f94bf62e6/html5/thumbnails/40.jpg)
Summary