Académique Documents
Professionnel Documents
Culture Documents
Outline
Motivation of Image Compression
Fundamentals of Compression
Compression Models and Standards
Basic Compression Methods for Grayscale Image
Basic Compression Methods for Binary Images
Block Transform Coding and JPEG
Optimal Quantization
Wavelet Image Compression and JPEG-2000
Image Watermarking
Assignments
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Motivation
Data storage in terms of color image formats for movies
Standard Definition (SD)
Image Compression
EEE 6209 Digital Image Processing
Motivation
Data communication through internet at home
Speed of DSL
Speed of Broadband
Image Compression
EEE 6209 Digital Image Processing
Fundamentals
Data and Information are not the same ! Information is
conveyed through Data. Different representations of data may
have similar information. Representation that contains
irrelevant or repeated data is called redundant data.
Data Redundancy:
1
R = 1
C
0 R 1
Compression Ratio:
b
C= '
b
0C
Image Compression
EEE 6209 Digital Image Processing
Redundancies
Image compression types (i) Loss-less compression (e.g,
medical, law, etc) and (ii) Lossy compression (e.g., movie)
A. Coding Redundancy: Each piece of information is
assigned to a code word, i.e., a sequence of bits. Variable
length code word in terms of bits could be assigned exploiting
data redundancy. May be used for loss-less compression.
B. Spatial/Temporal Redundancy: In an image, neighboring
pixels are highly spatially correlated (or dependent). Frames are
also temporally correlated. Correlations may be used to extract
redundant data, and hence, be exploited for loss-less
compression.
C. Context Redundancy: In an image, certain pixels may be
ignored for HVS or be extraneous for intended purpose. This
redundancy is used for lossy-compression.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Redundancies
Example of Redundancies
Coding
Redundancy
(Certain intensities
are more probable
than others)
Dr. S. M. Mahbubur Rahman
Spatial
Redundancy
(Each row has
same intensity)
Context
Redundancy
(Single intensity for
entire region)
Image Compression
EEE 6209 Digital Image Processing
Coding Redundancy
Let discrete random variable rk be in the interval [0,L-1] for an
image of size (MN)
Probability of k-th
intensity for nk occurrences
nk
pr (rk ) =
MN
k = 1,2, L , L 1
Let (rk) be the number of bits for representing the intensity rk.
Thus, average number of
bits required for representing
each pixel is given by
Coding gain or
compression ratio
Dr. S. M. Mahbubur Rahman
L 1
mMN
C=
where L = 2 m
avg MN
Image Compression
EEE 6209 Digital Image Processing
Coding Redundancy
Variable length coding assigns a lower length
code word to a higher probable intensity level
C = 4.42
Dr. S. M. Mahbubur Rahman
R = 0.774
Image Compression
EEE 6209 Digital Image Processing
Spatial Redundancy
Intensities of each horizontal line are equal, and
thus maximally correlated.
Histogram reveals that
these intensities are equiprobable, and hence, coding
redundancy cannot be
exploited.
Run length coding assigns a code word by combining certain
bits for an intensity plus certain bits for its length.
In example, the coding gain is (2562568)/([256+256]8)=128
In practical images (and video), pixels may be predicted from
spatially (and temporally) correlated neighboring pixels. Thus,
reversible mapping procedure can be used for compression.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Context Redundancy
Intensities for entire region appear to be same, for
which coding gain may be achieved as (2562568)/8=65536
Image Compression
EEE 6209 Digital Image Processing
Image Entropy
Assume that intensities represented by symbols arises from
zero-memory sources (statistically independent)
L 1
~
~
Image entropy H = pr (rk ) log 2 pr (rk )
H = 1.6614
k =0
~
bits/pixel
H gives the lower-limit of minimum
number of bits required to represent the
independent intensity values (i.e., image).
~
H
= 8.0
Visual information appearance to
bits/pixel
humans are not always the same as the
measured information of an image (see
the entropy values of three images)
~
Images are treated as finite memory
H = 1.566
sources so that blocks of correlated pixels
~
bits/pixel
are coded with a bit rate lower than H
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Image Fidelity
Objective Metric
M 1 N 1
SNR =
x =0 y =0
M 1 N 1
[
x =0 y =0
Subjective Metric
2
f ( x , y )
f ( x , y ) f ( x , y )
Image Compression
EEE 6209 Digital Image Processing
Image Fidelity
RMS = 5.17
RMS = 15.67
RMS = 14.17
Image Compression
EEE 6209 Digital Image Processing
Compression Model
Functional block consists of encoder and decoder (called
codec as a combination)
Examples include web browser, commercial image editing
software and DVD player
Image Compression
EEE 6209 Digital Image Processing
Codec
Encoder
Mapper usually transforms the image (/video) data to reduce
spatial (and temporal) redundancy.
Obtaining less correlated or uncorrelated transform coefficients
are reversible process.
Quantization of transform coefficients considers the preset
fidelity criteria and is an irreversible process.
Shortest length code words are assigned to most frequently
occurred quantized values, thus reducing coding redundancy.
Decoder
Symbol decoder and inverse mapper could not regain the
information loss due to quantization.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Compression Standards
Body sanctions standards include ISO, IEC, ITU-T (CCITT) for
images, and SPMTE (std. VC-1) and CMII (std. AVS) for video.
Image Compression
EEE 6209 Digital Image Processing
Binary
Image
Standards
Image Compression
EEE 6209 Digital Image Processing
Continuous Image
Standards
Image Compression
EEE 6209 Digital Image Processing
Continuous Image
Standards
Image Compression
EEE 6209 Digital Image Processing
Video
Standards
Image Compression
EEE 6209 Digital Image Processing
Video
Standards
Image Compression
EEE 6209 Digital Image Processing
Video
Standards
Image Compression
EEE 6209 Digital Image Processing
Huffman Coding
Huffman coding is optimal with the constraint that source
symbols are coded one at a time.
Source reduction is done by ordering probabilities of the
symbols from highest to lowest.
Compound codes starting from lowest to highest length are
assigned to the symbols that are most to the least probable.
Example of
source reduction
for six symbols
Image Compression
EEE 6209 Digital Image Processing
Huffman Coding
Entropy of the six symbols is 2.14 bits/pixel
Average length of Huffman coded symbols (see Table)
avg = 0.4 1 + 0.3 2 + 0.1 3 + 0.1 4 + 0.06 5 + 0.04 5 = 2.2 bits/pixel
It is called block code, since each symbol code has fixed bits.
The symbols is uniquely decodable by using lookup tables
(examining distinct codes from left to right).
010100111100
Example of
code
assignment
for six
symbols
Dr. S. M. Mahbubur Rahman
01010 - 011 - 1 - 1 - 00
a3 a1a2 a2 a6
Image Compression
EEE 6209 Digital Image Processing
Huffman Coding
8-bit image Lena
having size 256256
has entropy 7.3838
bits/pixel.
MATLAB implementation of Huffman coding is done at a
rate of 7.428 bits/pixel.
Computational complexity for J distinct source symbols : (i)
J source probabilities, (ii) (J-2) source reduction (iii) (J-2)
code assignment.
In practice, JPEG and MPEG use near optimal Huffman
coding, wherein codes are assigned to each pixel from the
experimental data.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Golomb Coding
Golomb coding applies for a nonnegative integer n (n0) and
a positive devisor m (m>0) denoted as Gm(n).
Steps of generation of Golomb codes
Step1 Find Unary Code from the quotient
n
q=
m
0 (n mod m ) < c
otherwise
Image Compression
EEE 6209 Digital Image Processing
Golomb Coding
where k = log 2 m c = 2 k m
If m = 2 k
Image Compression
EEE 6209 Digital Image Processing
Golomb Coding
Optimal m for integers
follow geometrically
distributed PMF
p (n ) = (1 ) n 0 < < 1
n
log 2 (1 + )
m=
log 2 (1 )
Image Compression
EEE 6209 Digital Image Processing
Golomb Coding
In practice, Golomb codes are used for differences of
intensities of images, e.g., in JPEG-LS
The negative integer of
the differences are
suitably mapped for
obtaining positive
integers.
Example of a mapping
function is
n0
2n
M (n ) =
2 n 1 n < 0
Image Compression
EEE 6209 Digital Image Processing
Arithmetic Coding
Arithmetic coding
generates non-block
codes, i.e., codes
assign for entire
message (or
character) instead of
codes for symbols.
The code word defines for an interval [0,1), wherein the interval
is defined as per the PMF of symbols in the message.
Example of a 4-symbol
message (n=4):
a1a2 a3 a3 a4
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Arithmetic Coding
Notable issues act as impediment of compression performance:
Extra indicator is required for end-of-message
Finite precision arithmetic is required for assigning bits
(constraint is for shortest interval of large-length message)
Maximum number of bits required for a symbol for length-5
message is 3, since 5 lies between (22) 4 and (23) 8.
Resolution of each interval is = 1 8
Total number of bits required for the message as per entropy:
5
5
Image Compression
EEE 6209 Digital Image Processing
Arithmetic Coding
Variants of arithmetic coding includes Q-coder and MQ-coder
that are used in JBIG and JPEG-2000.
Probabilities of contexts of neighboring image pixels are
estimated adaptively to select the block region for coding a symbol.
No. of
probability
estimation
21 = 2
28 = 256
25 = 32
Image Compression
EEE 6209 Digital Image Processing
LZW Coding
Lempel-Ziv-Weltch (LZW)
uses spatial redundancy
instead of exploiting coding
redundancy of previous
coding methods.
LZW considers fixed-length codes for variable-length source
symbols appear in an image.
No prior probability of symbols is required here.
Common standards GIF, TIFF, PDF, and PNG use LZW.
Finite-length codebook/dictionary keeps the variable-length
symbols and their fixed-length codes. The symbols are placed
in the dictionary suitably considering the left-right and topbottom scanning process and frequency of symbols.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
LZW Coding
LZW coding of 44, 8-bit
image (see Table)
39 39 126 126
39 39 126 126
39 39 126 126
39 39 126 126
Image Compression
EEE 6209 Digital Image Processing
Image Compression
EEE 6209 Digital Image Processing
H RL
H 0 + H1
=
L0 + L1
Image Compression
EEE 6209 Digital Image Processing
Symbol-Based Coding
Frequently appeared sub-image is treated as symbols/tokens.
Symbol dictionary contains triplets {(x1, y1, t1), (x2, y2, t2), },
where (xi yi) pair specifies the location of a symbol in the image
and token ti denotes the address of symbol in the dictionary.
Example may be shown for bi-level image that requires
9 511 = 459 bits
Compression achieved
Dr. S. M. Mahbubur Rahman
C = 1.61
Image Compression
EEE 6209 Digital Image Processing
Symbol-Based Coding
In JBIG2, binary images are compressed by segmentation of
non-overlapping three regions (i) Text (character), (ii) Halftone
(pattern in regular grid) (iii) Generic (art and noise).
Text regions use symbol-based coding. If the reference
character bitmaps/templates in the dictionary are not the same as
in the actual bitmap in the image, it is called perceptually loss-less
coding. The difference in the bitmap may be stored for perfectly
loss-less coding (see d in Figure)
(a) (b) (c)
(a) Lossless
(b) Visually lossless
(c) Difference
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Bit-Plane Coding
Image having more than two intensities may be decomposed
into m-number of bit planes using following polynomial formula.
am 1 2 m 1 + am 2 2 m 2 + L + a1 21 + a0 20
0i m2
Image Compression
EEE 6209 Digital Image Processing
Bit-Plane Coding
Image Compression
EEE 6209 Digital Image Processing
Bit-Plane Coding
Image Compression
EEE 6209 Digital Image Processing
Bit-Plane Coding
Gray code for 127 is 01000000 and that for 128 is 11000000.
Considering an overhead of PDF representation, the image bitplanes are compressed by JBIG2 lossless algorithm using both
the binary and Gray coded bit representations (see Table).
Overall
compression
ratio for binary
representation
C = 678676 503916 = 1.35
Image Compression
EEE 6209 Digital Image Processing
Block-Transform Coding
Image is partitioned into non-overlapping blocks/sub-images
of fixed size (say, 88).
Transformation process de-correlate the pixel data, and pack
as much information as possible to a small number of transformed
coefficients.
Quantization process selectively eliminates least amount of
information.
Quantized coefficients are coded adaptively or non-adaptively
preferably with a variable length coder.
Encoder
Decoder
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Block-Transform Coding
Selection of transform depends on packing capacity and
computational complexity.
Let the size of image be (MN), and that of sub-image be (nn)
General relation for sub-image g(x,y) with r(x,y) and s(x,y) be
forward and inverse kernels, respectively.
n 1 n 1
Forward
n 1 n 1
Inverse
r (x, y, u , v ) = r1 ( x, u )r2 ( y, v )
Dr. S. M. Mahbubur Rahman
s ( x, y , u , v ) = s1 ( x, u )s2 ( y, v )
Image Compression
EEE 6209 Digital Image Processing
FFT-Based Coding
DFT is the well-known transformation that may be used
The kernels for DFT are
1 j
r ( x, y , u , v ) = e
n
2
(ux + vy )
n
1 j
s ( x, y , u , v ) = e
n
2
(ux + vy )
n
n=2
The basis function consists of both sines and cosine
functions.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
FFT-Based Coding
2D Basis functions of DFT
Image Compression
EEE 6209 Digital Image Processing
WHT-Based Coding
Walsh-Hadamard Transform is computationally very simple,
since the basis functions are obtained from alternative +1 and -1
m1
The kernels for
1
bi ( x ) pi (u )+ bi ( y ) pi (v )
r (x, y, u , v ) = s (x, y, u , v ) = ( 1)
WHT are
i =0
n
where
n = 2m
p0 (u ) = bm 1 (u )
p1 (u ) = bm 1 (u ) + bm 2 (u )
p2 (u ) = bm 2 (u ) + bm 3 (u )
M
pm 1 (u ) = b1 (u ) + b0 (u )
bk(z) means k-th bit from the right to left of binary representation
The summation of the exponent use modulo 2 arithmetic.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
WHT-Based Coding
Checker board pattern 2D Basis functions of WHT for n=4
Image Compression
EEE 6209 Digital Image Processing
DCT-Based Coding
DCT is used JPEG. DCT has only cosine basis functions
The kernels for
DCT are
where
r ( x , y , u , v ) = s ( x, y , u , v )
u
= (u ) (v ) cos (2 x + 1) cos (2 y + 1)
2n
2n
(u ) =
1
n
2
n
for u = 0
for u = 1,2,3, L , n 1
Image Compression
EEE 6209 Digital Image Processing
DCT-Based Coding
2D Basis functions of DCT for n=4
Image Compression
EEE 6209 Digital Image Processing
Error from
Original
FFT
Dr. S. M. Mahbubur Rahman
WHT
DCT
Image Compression
EEE 6209 Digital Image Processing
Truncation of Coefficients
n 1 n 1
T (u , v )S uv
Inverse transform in matrix form with G =
u =0 v =0
the basis functions are
s (0,1,u,v )
s (0 ,0 ,u,v )
s (1,0 ,u,v )
s (1,2 ,u,v )
S uv =
M
M
s (0,n 1,u,v )
s (1,n 1,u,v )
L
O
M
=
G
(u, v )T (u, v )Suv
(u , v ) =
u =0 v =0
u =0 v =0
Image Compression
EEE 6209 Digital Image Processing
Comparison of Transforms
WHT-based compression is simple in terms of implementation
Sinusoidal transform (DFT/DCT) has high packing efficiency
Packing efficiency of KLT is the highest in the MSE sense
of truncating coefficients, but computationally expensive
data-dependent basis is required for such case.
Image Compression
EEE 6209 Digital Image Processing
DFT
DCT
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Size of Sub-Image
The sub-image size is
chosen as 2k. Common
choice id (88) or (1616)
Reconstructed output
25% DCT
Coef.
Dr. S. M. Mahbubur Rahman
22
subimage
44
subimage
88
subimage
Image Compression
EEE 6209 Digital Image Processing
Bit Allocation
Bit allocation refers to truncation, quantization, and coding of
transform coefficients.
Zonal Transform coefficients with maximum variance carry the
Coding: most of the information and thus retained.
Coefficients may be normalized by their variances and
then uniformly quantized OR
Optimal quantizer considering PDF of coefficients may be
used. Zeroth and other coefficients are modeled by
Rayleigh and Gaussian PDFs, respectively.
Typical
Zonal
Mask
Dr. S. M. Mahbubur Rahman
Bit assigned
log 2 T2(u ,v )
Image Compression
EEE 6209 Digital Image Processing
Bit Allocation
Threshold Transform coefficients with largest magnitudes are
retained for reconstruction.
Coding:
Thresholds may be global for an image, a local for
subimage, or even depend on location of a subimage.
Retained coefficients of a subimage are reordered to
1D sequence for run-length coding.
Typical
Threshold
Mask
Reordering
for 1D
sequence
Image Compression
EEE 6209 Digital Image Processing
Zonal
Coding
Image Compression
EEE 6209 Digital Image Processing
T (u , v ) = (u , v )T (u , v )
T (u , v )
= round
(
)
Z
u
,
v
c
c
kc T (u , v ) < kc +
2
2
Quantization
steps
Number of bits are controlled by k
Dr. S. M. Mahbubur Rahman
Typical
normalization
mask
Image Compression
EEE 6209 Digital Image Processing
Image Compression
EEE 6209 Digital Image Processing
JPEG
Features: DCT-based lossy baseline coding standard.
Applicable to progressive reconstruction system.
Lossless reversible compression is possible.
Image Compression
EEE 6209 Digital Image Processing
JPEG
Forward transform of DCT using n=8.
Scale the DCT coefficients with normalization matrix.
Image Compression
EEE 6209 Digital Image Processing
JPEG
Steps of reconstruction from compressed image:
Decoding the bits to obtain the real values and rearrange them to
an array of size 88.
Rescaling in accordance with the normalization array.
Image Compression
JPEG
EEE 6209 Digital Image Processing
JPEG
Calculation of inverse of DCT on the denormalized array.
Level shifting by addition of 2k on the transformed pixels.
Estimated error
of the subimage
(RMSE=5.8 only):
Image Compression
EEE 6209 Digital Image Processing
JPEG
Visual output for JPG compression:
Image Compression
EEE 6209 Digital Image Processing
Predictive coding
Predictive coding eliminates redundancies of neighboring
pixels in space or time.
This coding is computationally very efficient, thus used for
compression of video sequence
Loss-less coding:
Encoder
Decoder
Image Compression
EEE 6209 Digital Image Processing
Predictive coding
Lossy coding includes a quantizer.
A feedback loop may be used to eliminate quantization error
Encoder
Decoder
Image Compression
EEE 6209 Digital Image Processing
Optimal Predictor
Let a pixel is to be predicted from m number of its
2
m
neighboring pixels.
2
MSE of prediction
E e (n ) = E f (n ) i f (n i )
i =1
E{ f (n 1) f (n m )}
E{ f (n 2 ) f (n m )}
O
M
L E{ f (n m ) f (n m )}
L
L
E{ f (n ) f (n 1)}
E{ f (n ) f (n 2 )}
{
(
)
(
)
}
E
f
n
f
n
m
Image Compression
EEE 6209 Digital Image Processing
Optimal Predictor
Assuming 2D markov image source with Gaussian statistics
and separable correlation function E{ f ( x, y ) f ( x i, y j )} = 2 i j
v
3 f (x 1, y ) + 1 f (x 1, y + 1)
where
1 = h 2 = v h
3 = v
4 = 0
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
Optimal L-level Lloyd-Max Quantizer
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
Input signal s with PDF p (s )
Quantized signal t = q (s )
Quantization error e(s ) = s q (s )
Mean of quantization error
= E [s q(s )] =
i=L
(s t ) p(s )ds
i = L
si
si 1
= E (s q(s )) =
2
i=L
i= L
si
si 1
(s ti ) p(s )ds
2
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
The quantization error is minimum provided
i=L
2
opt
= min
si , t i
(s t ) p(s )ds
i = L
si
si 1
= L+
2
si
si 1
si +1
i
2
=0
ti
Dr. S. M. Mahbubur Rahman
and
2
=0
si
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
The first derivative
2
=0
ti
0 + L 2
si
si 1
(s ti ) p(s )ds + L + 0 = 0
sp (s )ds = ti p (s )ds
si
si
si 1
si 1
si
ti
si 1
si
si 1
sp (s )ds
p (s )ds
i = L ,L, L
2
2
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
The second derivative
2
=0
si
d
d a ( )
d
da ( )
f (a ( ), )
d
b ( )
[ f (x, )]dx
+
a ( )
dsi
dsi 1
2
2
(si ti ) p(si )
(si 1 ti ) p(si 1 )
0 +L+
dsi
dsi
+
si 1
si
dsi +1
2
2
(s ti ) ds +
(si +1 ti +1 ) p(si +1 )
si
dsi
si +1
dsi
2
2
(si ti +1 ) p(si ) +
(
s ti +1 ) ds + L + 0 = 0
si s
d
s
i
i
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
The second derivative
2
=0
si
(si ti ) p (si ) (si ti +1 ) p (si ) = 0
2
(si ti ) = (si ti +1 )
0
t + t
si = i i +1
2
Dr. S. M. Mahbubur Rahman
i=0
i = L 1 ,L, L 1
2
2
i = L ,L
2 2
) (
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
The values of si and ti are estimated iteratively
Image Compression
EEE 6209 Digital Image Processing
Optimal Quantization
1. Guess initial decision levels
2. Calculate centroids
ti
si
ti =
p(s ) s
ti 1 < si ti
p (s )
ti 1 < si ti
3. Calculate decisions
si
ti + ti +1
si =
2
Image Compression
EEE 6209 Digital Image Processing
Wavelet Coding
The basis functions of wavelets has finite duration as opposed
to infinite duration of cosinusoidal basis function in DCT
DWT coefficients of images possess space-frequency
localization characteristics.
Hence, subimage partition is not necessary for DWT-based
compression, which in turn reduces blocking artifacts even for
high compression ratios.
Encoder
Decoder
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Wavelet Selection
Factors on basis functions to be considered
Computational complexity Reduce filter length. Bi-level filter
Haar wavelet is good in this respect
Orthogonality Error-free reconstruction with high packing
capacity. Daubechies and Symmlets wavelets are good in this
sense.
Symmtricity Reduce border artifacts for reconstruction.
Biorthogonal wavelets are good for this.
Not all factors satisfy simultaneously.
JPEG-2000 uses near-orthogonal (biorthogonal) CohenDaubechies-Feauveau (CDF) wavelet basis function.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Wavelet Selection
Output of 3-level wavelet decomposition for four wavelet
basis functions
Haar
Symlets
Daubechies
CDF
Image Compression
EEE 6209 Digital Image Processing
Wavelet Selection
Comparisons of wavelet basis functions in terms of filters taps
as well as packing capacity (see Table).
Packing capacity is compared in terms of number of zeroed
coefficients for a fixed level threshold.
Image Compression
EEE 6209 Digital Image Processing
Level Selection
With an increasing number of levels, the size of approximate
coefficients reduces significantly (see Table)
Almost 95% of detail coefficients may be truncated, with
almost no significant change in the reconstruction error.
Increasing level of decomposition will introduce extra
computational load.
Image Compression
EEE 6209 Digital Image Processing
Quantizer Selection
Quantization performance may be increased
Introducing dead-zone Larger quantization steps near zero
magnitude coefficients
Scale-adaptation Quantization steps are adapted across
scales.
Impact of deadzone interval on
wavelet coding.
Image Compression
EEE 6209 Digital Image Processing
JPEG 2000
Overall Features
Flexibility in compression and access, e.g., portion of image
may be processed.
Wavelet coefficients are quantized subband-adaptively, and
then arithmetically coded using a bit-plane algorithm.
Encoding Features
R, G, B components are DC shifted
Individual components may optionally undergo irreversible decorrelation transform as
Y0 ( x, y ) = 0.299 I 0 ( x, y ) + 0.587 I1 ( x, y ) + 0.114 I 2 ( x, y )
Image Compression
EEE 6209 Digital Image Processing
JPEG 2000
Image is composed in terms of tiles of rectangular array of
pixels considering aspect ratio.
Each tile component may be processed independently.
Loss-less compression uses 5/3 biorthogonal wavelet, and
lossy compression uses 9/7 biorthogonal wavelet (i.e., CDF).
Implementation uses lifting-based fast wavelet transform
(FWT).
Standard does not specify number of scales for FWT
The transformed coefficient ab(u,v) of subband b is quantized
to qb(u,v) with quantization step b as
ab (u , v )
qb (u , v ) = sgn[ab (u , v )] floor
b = 2
Rb b
b
1 + 11
2
Image Compression
EEE 6209 Digital Image Processing
JPEG 2000
where Rb is the nominal dynamic range
Image Compression
EEE 6209 Digital Image Processing
JPEG 2000
Tile components are coded individually, one bit plane at a
time starting from the MSB bit-plane
Each bit-plane is arithmetically coded in anyone of the three
passes significance propagation, magnitude refinement, and
cleanup.
Codes of similar passes are grouped in to layers, which are
finally partitioned into packets the unit of encoder.
Decoding Features
In decoding, number of bit-planes may chosen arbitrarily.
Inverse quantization is done by
qb (u , v ) + r 2 M b N b b
(
)
=
Rqb u , v qb (u , v ) r 2 M b N b b
qb (u , v ) > 0
qb (u , v ) > 0
qb (u , v ) = 0
Image Compression
EEE 6209 Digital Image Processing
JPEG 2000
where Rqb is the inverse quantized coefficients.
M b is the no. of bit-planes encoded
Image Compression
EEE 6209 Digital Image Processing
JPEG 2000
Visual output
JPEG 2000
approximation
with error and
zoomed-in
section
Image Compression
EEE 6209 Digital Image Processing
Watermarking
Watermarking is embedding data (opposite to compression)
in an image for making an assertion of the image
Use of watermarking includes copyright identification, user
identification or fingerprinting, authenticity determination,
automated monitoring, and copy protection.
Two types of watermarking perceptible and imperceptible.
Usually imperceptible watermarking considers HVS.
Generation of additive marked image fw from the watermark w
where
f w = (1 ) f + w
(0 < 1) controls the imperceptibility
Generation of watermarked image through embedding specified
bits in the last b number of LSBs
w
b f
f w = 2 b + (2 )
2 2
b
Image Compression
EEE 6209 Digital Image Processing
Watermarking
Watermark encoding and decoding system
Watermark w to be embedded is usually generated using a
pseudo-random sequence obtained from a public/private key.
Watermark matching is done through a suitable threshold
Encoder
Decoder
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Watermarking
Visible
watermarking
and extraction
Invisible
watermarking
and extraction
Image Compression
EEE 6209 Digital Image Processing
Watermarking
Watermarked image may undergo attacks, e.g.,
compression, filtering, cropping, rotation, re-sampling, etc.
Watermarking algorithm should be robust such that
intelligibility survives for attacks.
Robust watermarking algorithm uses spread spectrum
technique, so that embedded information (payload) spreads to
whole frequency range of image.
Effect of JPEG compression
for estimating the watermark
(see Figure).
Image Compression
EEE 6209 Digital Image Processing
Watermarking
Comparisons of
strength of marking on
images using a DCTbased algorithm. Marked
image and difference
from unmarked image is
shown in figure.
Image Compression
EEE 6209 Digital Image Processing
Watermarking
General principle of transform-based (DCT, DFT, DWT, etc.)
watermarking encoder:
Forward transform the image and find the selected
coefficients (e.g., largest magnitude) to be modified.
Generate watermark and modify the selected image
coefficients.
Inverse transform the marked coefficients.
General principle of transform-based watermark decoder:
Compute the forward transform of image concerned.
Compute the watermark from the image as per the known
embedding process.
Take decision based on the similarity between original and
estimated watermark.
Dr. S. M. Mahbubur Rahman
Image Compression
EEE 6209 Digital Image Processing
Watermarking
Correlation coefficients may be used for finding similarity
between estimated version of K-element watermark and the
question in concern given by
(w w )(w w )
K
i =1
(
K
i =1
w i w
) (w w )
2
i =1
H1 : T
H0 : < T
Dr. S. M. Mahbubur Rahman
Watermark Exists
Watermark Does' nt Exist
Image Compression
EEE 6209 Digital Image Processing
Watermarking
Effect of attacks on similarity measure
(a) (b) JPEG lossycompression with
increasing
strength.
(c) smoothing,
(d) AWGN,
(e) histogram
equalization,
(f) rotation
Image Compression
EEE 6209 Digital Image Processing
Assignment
Problem #1
Image Compression
EEE 6209 Digital Image Processing
Assignment
Problem #2
Devise a dictionary to obtain LZW encoded output for the 8-bit image of size
48 given in Problem #1
Problem #3
Problem #4
Image Compression
EEE 6209 Digital Image Processing
Assignment
Problem #5