Upload
others
View
20
Download
0
Embed Size (px)
Citation preview
Image Compression and Watermarking
Image Processing
CSE 166
Lecture 14
Announcements
• Assignment 4 is due May 20, 11:59 PM
• Assignment 5 will be released May 20
– Due May 29, 11:59 PM
• Reading
– Chapter 8: Image Compression and Watermarking
• Sections 8.1, 8.9, 8.10, and 8.12
CSE 166, Spring 2020 2
Data compression
• Data redundancy
where compression ratio
CSE 166, Spring 2020 3
where
Data redundancy in images
CSE 166, Spring 2020 4
Coding redundancy
Spatial redundancy
Irrelevant information
Does not need all 8 bits
Information is unnecessarily
replicated
Information is not useful
Image information
• Entropy
– It is not possible to encode input image with fewer than bits/pixel
CSE 166, Spring 2020 5
where
Fidelity criteria,objective (quantitative)
• Total error
• Root-mean-square error
• Mean-square signal to noise ratio (SNR)
CSE 166, Spring 2020 6
Fidelity criteria,subjective (qualitative)
CSE 166, Spring 2020 7
Approximations
CSE 166, Spring 2020 8
5.17 15.67 14.17
(a) (b) (c)
Objective (quantitative) qualityrms error (in intensity levels)
Subjective (qualitative) quality, relative
Lower is better
(a) is better than (b),
(b) is better than (c)
Compression system
CSE 166, Spring 2020 9
Compression methods
• Huffman coding• Golomb coding• Arithmetic coding• Lempel-Ziv-Welch (LZW) coding• Run-length coding• Symbol-based coding• Bit-plane coding• Block transform coding• Predictive coding• Wavelet coding
CSE 166, Spring 2020 10
Symbol-based coding
CSE 166, Spring 2020 11
(0,2) (3,10) …
Block-transform coding
CSE 166, Spring 2020 12
Encoder
Decoder
Block-transform coding
• Example: discrete cosine transform
• Inverse
CSE 166, Spring 2020 13
where
Block-transform coding
CSE 166, Spring 2020 14
Discrete cosine transformWalsh-Hadamard transform
4x4 subimages (4x4 basis images)
Block-transform coding
CSE 166, Spring 2020 15
Fourier transform
cosine transform
Walsh-Hadamardtransform
2.32 1.78 1.13rms error
Retain 32 largest
coefficients
Error image
8x8 subimages
Lower is better
Block-transform coding
CSE 166, Spring 2020 16
2x2 4x4 8x8
Reconstruction error versus subimage size
DCT subimage size:
JPEG uses block DCT-based coding
CSE 166, Spring 2020 17
Compression reconstruction
Scaled error image
Zoomed compression
reconstruction
25:1
52:1
Compression ratio
Predictive coding model
CSE 166, Spring 2020 18
Encoder
Decoder
Predictive coding
CSE 166, Spring 2020 19
Input image
Prediction error image
Example: previous pixel coding
Histograms
Wavelet coding
CSE 166, Spring 2020 20
Encoder
Decoder
Wavelet coding
CSE 166, Spring 2020 21
Detail coefficients below 25 are truncated to zero
JPEG-2000 uses wavelet-based coding
CSE 166, Spring 2020 22
Compression reconstruction
Scaled error image
Zoomed compression
reconstruction
25:1
52:1
Compression ratio
JPEG-2000 uses wavelet-based coding
CSE 166, Spring 2020 23
Compression reconstruction
Scaled error image
Zoomed compression
reconstruction
75:1
105:1
Compression ratio
Image watermarking
• Visible watermarks
• Invisible watermarks
CSE 166, Spring 2020 24
Visible watermark
CSE 166, Spring 2020 25
Original image minus watermark
Watermarked image
Watermark
Invisible image watermarking system
CSE 166, Spring 2020 26
Encoder
Decoder
Invisible watermark
CSE 166, Spring 2020 27
Two least significant
bits
JPEGcompressed
Fragile invisible
watermark
Originalimage Extracted
watermark
Example: watermarking using two least significant bits
Invisible watermark
CSE 166, Spring 2020 28
Watermarked images
(different watermarks)
Example: DCT-based watermarking
Extracted robust
invisible watermark
Next Lecture
• Morphological image processing
• Reading
– Chapter 9: Morphological image processing
• Sections 9.1, 9.2, 9.3, and 9.5 (through subsection connected components)
CSE 166, Spring 2020 29