• Lossless
– Information preserving
– Low compression ratios
• Lossy
– Information loss
– High compression ratios
compression
Compression ratio:
Relevant Data Redundancy
Example:
Types of Data Redundancy
Example:
Coding Redundancy (cont’d)
• Case 2: l(rk) = variable length
variable length
auto-correlation
f ( x) o g ( x) f ( x) g ( x a)da
auto-correlation: f(x)=g(x)
Interpixel redundancy (cont’d)
• To reduce interpixel redundancy, some kind of transformation
must be applied on the data (e.g., thresholding, DFT, DWT)
Example:
threshold
original
11 ……………0000……………………..11…..000…..
thresholded
(1+10) bits/pair
Psychovisual redundancy
units of information!
using
units/pixel
Entropy:
(e.g., bits/pixel)
Redundancy
• Redundancy:
(data vs info)
where:
image
Entropy Estimation (cont’d)
• First order estimate of H:
image
Differences in Entropy Estimates
16
Differences in Entropy Estimates (cont’d)
• What is the entropy of the pixel differences image?
• How close is to ?
• Criteria
– Subjective: based on human observers
– Objective: mathematically defined criteria
Subjective Fidelity Criteria
Objective Fidelity Criteria
• Backward Pass
Assign code symbols going backwards
Huffman Coding (cont’d)
• Lavg assuming Huffman coding:
0 1
2) Subdivide [0, 1) based on the probabilities of α i
Encode
α 1 α2 α3 α3 α4
[0.06752, 0.0688)
0.8
code: 0.068
0.4
(must be inside sub-interval)
0.2
Example (cont’d)
Decode 0.572
α3 (sequence length=5)
Initial Dictionary
Dictionary Location Entry
0 0
1 1
. .
255 255
256 -
511 -
LZW Coding (cont’d)
Example:
As the encoder examines image
39 39 126 126
pixels, gray level sequences
39 39 126 126
(i.e., blocks) that are not in the
39 39 126 126
dictionary are assigned to a new
39 39 126 126
entry.
Dictionary Location Entry
0
1
0
1
- Is 39 in the dictionary……..Yes
. . - What about 39-39………….No
255 255
256 -
39-39
* Add 39-39 at location 256
511 -
Example
39 39 126 126 Concatenated Sequence: CS = CR + P
39 39 126 126
(CR) (P)
39 39 126 126
39 39 126 126
CR = empty
repeat
P=next pixel
CS=CR + P
If CS is found:
(1) No Output
(2) CR=CS
else:
(1) Output D(CR)
(2) Add CS to D
(3) CR=P
Decoding LZW
e.g., (0,1)(1,1)(0,1)(1,0)(0,2)(1,4)(0,2)
Bit-plane coding
(addresses interpixel redundancy)
• Process each bit plane individually.
K << N
K-1 K-1
Transform Selection
Forward:
Inverse:
if u=0 if v=0
if u>0 if v>0
DCT (cont’d)
Reconstructed images
by truncating
50% of the
coefficients
Reconstructions
DFT
has n-point periodicity
DCT
has 2n-point periodicity
JPEG Compression
Entropy
encoder
Accepted as
an
international
image
compression
standard in
1992.
Entropy
decoder
JPEG - Steps
Quantization
JPEG Steps (cont’d)
6. Encode coefficients:
symbol_1 symbol_2
(SIZE) (AMPLITUDE)
predictive
coding:
Intermediate Symbol Sequence – AC coeff
# bits
Original
Effect of Quantization:
non-homogeneous 8 x 8 block
Effect of Quantization:
non-homogeneous 8 x 8 block (cont’d)
Quantized De-quantized
Effect of Quantization:
non-homogeneous 8 x 8 block (cont’d)
Reconstructed
Error is high!
Original:
Case Study: Fingerprint Compression
No “blocky” artifacts.
WSQ Algorithm
Compression ratio
• FBI’s target bit rate is around 0.75 bits per pixel (bpp)
Sequential
Progressive
Progressive JPEG (cont’d)
N/4 x N/4
N/2 x N/2
NxN
More Methods …