55
10 July 2020 Image Compression Dr. C. Seldev Christopher, Professor , CSE Deparment, St.Xavier,s Catholic College of Engineering, Nagercoil.

Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Image Compression

Dr. C. Seldev Christopher,

Professor , CSE Deparment,

St.Xavier,s Catholic College of Engineering,

Nagercoil.

Page 2: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Contents

Why do we need to compress images?

Image types

Basic concept of compression

Classification of Compression Methods

Compression Methods

Conclusion

Page 3: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Image Compression

Everyday an enormous amount of information is

stored, processed, and transmitted

Financial data

Reports

Inventory

Cable TV

Online Ordering and tracking

0

2 0

4 0

6 0

8 0

10 0

1st

Qt r

2 nd

Qt r

3 r d

Qt r

4 t h

Qt r

Ea st

We st

Nor t h

Page 4: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

What is Image Compression?

Image compression is the art and science of representing information in a compact form. It plays an important role in Video Conferencing, remote

sensing, satellite TV, FAX, document and medical

imaging.

The goal of image compression is to reduce the amount of data required to represent a digital image.

Page 5: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Why do we need Image Compression?

1) Storage 2) Processes 3) Communication 2000-2020

Disc capacities : 20 GB -> 2 TB (100 times!) but seek time : 10 milliseconds 05 milliseconds

and transfer rate : 2MB/sec ->200 MB/sec. Compression improves overall response time in some applications.

Page 6: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

What is Image Compression? Still image data, that is a collection of 2-D arrays (one for each color plane) of values representing intensity (color) of the point in corresponding spatial location (pixel).

•Data and information are not synonymous terms!

•Data is the means by which information is conveyed.

•Data compression aims to reduce the amount of data

required to represent a given quantity of information while

preserving as much information as possible.

Page 7: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

.

10 July 2020

Why do we need Image Compression? Data vs Information

The same amount of information can be

represented by various amount of data,

e.g.:

Your wife, Helen, will meet you at Logan Airport in Boston at

5 minutes past 6:00 pm tomorrow night

Your wife will meet you at Logan Airport at 5 minutes past

6:00 pm tomorrow night

Helen will meet you at Logan at 6:00 pm tomorrow night

Ex1:

Ex2:

Ex3:

Page 8: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Source of images

•Image scanner

•Digital camera

•Video camera,

•Ultra-sound (US), Computer Tomography (CT),

Magnetic resonance image (MRI), digital X-ray (XR),

Infrared. etc.

Page 9: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Image types

Why do we need special algorithms for images?

Page 10: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

Basic concept of compression

Data might contain elements that provide

no relevant information : data redundancy

Data redundancy is a central issue in

image compression. It is not an abstract

concept but mathematically quantifiable

entity

10 July 2020

Page 11: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

Data redundancy

Data redundancy occurs when the same

piece of data exists in multiple places,

whereas data inconsistency is when the

same data exists in different formats in

multiple tables.

Unfortunately, data redundancy can cause

data inconsistency, which can provide a

company with unreliable and/or meaningless

information.

10 July 2020

Page 12: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

Data redundancy

Spatial redundancy

Temporal redundancy

Psycho-visual redundancy

10 July 2020

Page 13: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Spatial redundancy

Page 14: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Spatial Redundancy

Page 15: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Page 16: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Temporal redundancy

Next frame

Page 17: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Temporal redundancy

• Consecutive images

of a video stream do

not vary much.

– Some areas don’t

change at all

(background).

– Others only

change

their spatial location

(moving objects).

Page 18: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Psycho-visual redundancy

more detail in section “human visual system”

Page 19: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Psycho visual redundancy

• Human visual system

– Different sensitivity to different information.

• Human processing

– We only see some

parts of the image.

– Our brain completes

the rest.

Page 20: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Psycho visual redundancy

• We notice errors in

homogenous regions.

– Low frequencies.

• We notice errors in

edges.

– High frequencies.

• We don’t notice noise

in textured areas.

– Medium frequencies.

Page 21: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Fidelity Criteria

How close is to ?

Measured in terms of the “closeness” of an image to an original source

Criteria

Subjective: based on human observers

Objective: mathematically defined criteria

Page 22: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

Fidelity Criteria

Page 23: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Rate measures

Bitrate:

Compression ratio:

N

C

image in the pixels

file compressed theof size

C

kN

file compressed theof size

file original theof size

bits/pel

Page 24: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Distortion measures

Mean average error (MAE):

N

i

ii xyN 1

1MAE

Mean square error (MSE):

N

i

ii xyN 1

21MSE

MSElog10PSNR 2

10 APulse-signal-to-noise ratio (PSNR):

(decibels)

A is amplitude of the signal: A = 28-1=255 for 8-bits signal.

Page 25: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other issues

Coder and decoder computation complexity

Memory requirements

Fixed rate or variable rate

Error resilience

Symmetric or asymmetric

Decompress at multiple resolutions

Decompress at various bit rates

Standard or proprietary

Page 26: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Human visual system

Human eye is less sensitive to chrominance

than to luminance.

Less sensitive to high and low spatial

frequency than to mid-spatial frequency.

Sensitivity to quantizing distortion decreases

with increasing luminance levels. (noise

masking property).

Page 27: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Compression method

Classification 1

Lossy

Lossless

Classification 2

Spatial methods

Transform methods

Hybrid methods

There are more classifications in other survey

paper

Page 28: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Loss-less Compression Methods

LZW

Huffman coding

Run-length coding

Arithmetic coding

Predictive coding

Page 29: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

LZW Coding

Works by coding short strings of data

Used in GIF, TIFF, and PDF file formats

Creates a “dictionary” of code words For an 8-bit image, the first 256 words are

assigned to the gray values 0,1,2, … , 255

As sequences are discovered, new code words are assigned to represent them

Eg: The sequence 126-126 may be assigned to code word 256

Page 30: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

Huffman Coding

(coding redundancy)

A variable-length coding technique.

Symbols are encoded one at a time! There is a one-to-one correspondence between

source symbols and code words

Optimal code (i.e., minimizes code word length per source symbol).

Page 31: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Arithmetic Coding

A sequence of values is assigned a single

arithmetic code word

The code word is a fractional number

between 0 and 1

Each symbol is assigned an interval based

on its probability of occurrence

Page 32: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Run-length coding (RLC)

(interpixel redundancy)

Used to reduce the size of a repeating string of

symbols (i.e., runs):

1 1 1 1 1 0 0 0 0 0 0 1 (1,5) (0, 6) (1, 1)

a a a b b b b b b c c (a,3) (b, 6) (c, 2)

Encodes a run of symbols into two bytes: (symbol,

count)

Can compress any type of data but cannot achieve

high compression ratios compared to other

compression methods.

Page 33: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Lossless Compression method

Predictive coding (DPCM)

Also called “differential pulse-coded modulation”

Prediction error = true value - prediction value

Only prediction error are coded

Prediction error’s dynamic range is smaller than

true value’s

Sensitivity to transmission and statistic error

Temporal predictive coding is difficult to random

accessing

Page 34: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Predictive coding

Page 35: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

Lossy Compression Methods

Transform coding

Lossy Predictive Coding

Hybrid coding

10 July 2020

Page 36: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Compression method

Transform coding

To compact the energy of image in a few

coefficients

To decorrelate the image pixels

Block size matter! (block size is 8x8 in JPEG)

Compact

energy Decorrelate

pixels

compromise

complexity Decorrelation

ability compromise

transform

Block size

Page 37: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Transform Coding

Operates on the transform of an image,

rather than the original pixels

Page 38: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

DCT

Concentrate energy into a smaller number of coefficients

Page 39: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Discrete Cosine Transform (DCT)

Most popular transform (used in JPEG)

Kernels:

1,...,2,1for2

0for1

)(

where

2

)12(cos

2

)12(cos)()(

),,,(),,,(

NuN

uNu

N

vy

N

uxvu

vuyxhvuyxg

Page 40: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Quantization

Lossy Process!

Give higher importance to low spatial frequencies

Page 41: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Zig-Zag scanning

Create long sequences of zeros – Huffman Coding

Page 42: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Considerations

• We can control compression via a quantization

factor.

• The higher the factor, the higher the number of zeros

in the DCT > Better Huffman coding.

• Problem: High quantization factors produce

compression artifacts.

Page 43: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Lossy Predictive Coding

Error values are quantized

Predictions by encoder and decoder must be same to prevent

error buildup

Page 44: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Compression method

Hybrid coding

Combine transform and predictive coding

techniques

Ex: In video coding, DCT in the spatial plane

while DPCM in the temporal direction

Page 45: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other Compression methods

Vector quantization

X is set of values which will be coded

Y is output of “vector quantizer” Q

C is the codebook

Transmit the index of Y in the codebook

NwithiRYYC

yyyyXQY

xxxxX

k

ii

k

k

,....,2,1 ,|

,...,,)(

,...,,

321

321

Page 46: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other Compression methods

Vector quantization

Better performance can always be achieved by coding vectors instead of scalars. (Shannon’s rate-distortion theory)

Relatively high compression ratio

Computational demanding at encoding process

Major problem of VQ: how to design a good codebook

Fast search algorithms are being developed ( in 1993)

Page 47: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other Compression methods

Fractal image coding

Extract self similarity in the image

Describe an image region with a simple

transformation of another region

Transmit only the sequence of transformation

Relatively high compression ratios (about 70~80)

Encoding process is complex

Complexity of decoding process is relatively reasonable

Page 48: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other Compression methods

Model/knowledge-based coding

Transmitter and receiver agree on the basic

model for the image

Transmit the parameters to manipulate this model

Application example: teleconferencing system

Page 49: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other Compression methods

Sub-band coding

A set of band-pass filters divide the image into

different sub-band (spectral component)

Then code each component

Progressive coding

Example: wavelet coding

Image

LPF

HPF

Page 50: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Wavelet Coding

Page 51: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other Compression methods

Contour-texture oriented techniques

Segment the image into texture and contour,

coded separately

Whole picture = texture + contour

How to extract Contour?

Region growing

Edge detection

Page 52: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Other Compression methods

Other technique

Adaptive coding

Coding parameters are adjusted according to the data

statistics

Page 53: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Applications

Videoconferencing and videophone

Speed

Compression ratio

progressive

Multimedia electronic mail

Compression ratio

Picture archiving and information distribution

Reliability

Compression ratio

Page 54: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020

Conclusion

We had review many compression methods

Cost of

compression

Cost of

Transmission and

storage

compromise

Page 55: Image Compression - St. Xavier's College of Engineering · 2020. 7. 11. · 10 July 2020 Image Compression Everyday an enormous amount of information is stored, processed, and transmitted

10 July 2020