0% found this document useful (0 votes)
32 views36 pages

Session 10

The document provides an introduction to color image processing, covering topics such as Fourier transforms, image reconstruction, and various compression techniques. It discusses the importance of low frequencies in image data and introduces methods like Huffman and arithmetic coding for effective image compression. Additionally, it highlights the significance of spatial and temporal redundancies in image data and concludes with acknowledgments for source materials used in the presentation.

Uploaded by

kimiarfaie76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views36 pages

Session 10

The document provides an introduction to color image processing, covering topics such as Fourier transforms, image reconstruction, and various compression techniques. It discusses the importance of low frequencies in image data and introduces methods like Huffman and arithmetic coding for effective image compression. Additionally, it highlights the significance of spatial and temporal redundancies in image data and concludes with acknowledgments for source materials used in the presentation.

Uploaded by

kimiarfaie76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Introduction to Color Image Processing

IDIG4321

Seyed Ali Amirshahi

Norwegian University of Science and Technology, Gjøvik, Norway

[email protected]

Norwegian University of Science and Technology Introduction to Color Image Processing


1 / 28

Summary of the previous
session(s)

Norwegian University of Science and Technology Introduction to Color Image Processing


2 / 28

Summary of the previous session(s)

Example
We normally use FFT shift so that the low frequency part of the image will be in the center.

Norwegian University of Science and Technology Introduction to Color Image Processing


3 / 28

Summary of the previous session(s)

Properties
Rotation in the image will result in rotation in the Fourier spectrum.

Norwegian University of Science and Technology Introduction to Color Image Processing


4 / 28

Summary of the previous session(s)

Properties
Original images are in the size of 256 × 256, Fourier spectrum of images in the logarithmic scale.
Maximum logarithmic value in each column from the center column moving to the right.

Norwegian University of Science and Technology Introduction to Color Image Processing


4 / 28

Summary of the previous session(s)

Image reconstruction using a limited number of DFT


values
As mentioned and showed earlier the low frequencies (center of DFT) are more important than
the surround.

Norwegian University of Science and Technology Introduction to Color Image Processing


5 / 28

Summary of the previous session(s)

Image reconstruction using a limited number of DFT


values
As mentioned and showed earlier the low frequencies (center of DFT) are more important than
the surround.

Norwegian University of Science and Technology Introduction to Color Image Processing


5 / 28

Summary of the previous session(s)

2D Discrete Cosine Transform


Bit allocation for DCT.
The image bellow shows the importance of the DCT coefficients for a 16 × 16 image.

Norwegian University of Science and Technology Introduction to Color Image Processing


6 / 28

Summary of the previous session(s)

2D Discrete Cosine Transform

Original image, DCT of the images, along with the maximum logarithmic DCT value in each
column.

Norwegian University of Science and Technology Introduction to Color Image Processing


6 / 28

Summary of the previous session(s)

Walsh transform

Norwegian University of Science and Technology Introduction to Color Image Processing


7 / 28

Summary of the previous session(s)

Example
From Top right to left:
Original image
H128 , R = 0.0077972, P128 = 91%, MSE = 0.028679
H64 , R = 0.015564, P64 = 94%, MSE = 0.017166
H32 , R = 0.031006, P32 = 96%, MSE = 0.011089
H16 , R = 0.061523, P16 = 97.6%, MSE = 0.0076097
H8 , R = 0.12109, P8 = 98.8%, MSE = 0.0066097
H4 , R = 0.43747, P4 = 99.5%, MSE = 0.0045335
H2 , R = 0.74982, P2 = 99.9%, MSE = 0.0030490

Norwegian University of Science and Technology Introduction to Color Image Processing


8 / 28

Summary of the previous session(s)

1D Haar transform

Norwegian University of Science and Technology Introduction to Color Image Processing


9 / 28

Summary of the previous session(s)

2D Haar transform
First we calculated the horizontal Haar transform for the image.

Then we calculate the vertical Haar transform

Norwegian University of Science and Technology Introduction to Color Image Processing


10 / 28

Summary of the previous session(s)

2D Haar transform

Norwegian University of Science and Technology Introduction to Color Image Processing


10 / 28

Summary of the previous session(s)

2D Haar transform

Importance of the coefficients:

Norwegian University of Science and Technology Introduction to Color Image Processing


10 / 28

Image compression

Norwegian University of Science and Technology Introduction to Color Image Processing


11 / 28

Image compression

Image compression

With a mathematical view, compression is the transform of a set of data with statistical
relationships to another set of data which does not have a statistical relationship
In image processing we have two types of image compression:
Lossless compression: is a type of image compression algorithms that allows the perfect
reconstruction of the original image from the compressed data.
Lossy compression: is a type of image compression that allows us to reconstruct an approximation
of the original image and not the original image itself.

Norwegian University of Science and Technology Introduction to Color Image Processing


12 / 28

Image compression

How can we implement compression?


Coding redundancy: Most 2-D intensity arrays contain more bits than are needed to represent
the intensities.
Spatial and temporal redundancy: Pixels of most 2-D intensity arrays are correlated spatially
and video sequences are temporally correlated.
Irrelevant information or Psychovisual redundancy: Most 2-D intensity arrays contain
information that is ignored by the human visual system.

Norwegian University of Science and Technology Introduction to Color Image Processing


13 / 28

Image compression

Measures of performance

compression measures:
Bits in the original image
Compression ratio: Bits in the compressed image

Relative data redundancy: 1 − 1/compressionratio

ρi Li , where ρi is the probability of the i th symbol.


P
Average bits per symbol:
i

Fidelity measures
Mean Square error (MSE): Avg(original - reconstructed)2
Signal to Noise Ratio (SNR): 10 log10 (Signal Power/Noise power)
Peak Signal to Noise Ratio (PSNR): 10 log10 (Peak Signal Power/Peak Noise Power)
Human Visual System (HVS) based: Assignments of image quality measure.

Norwegian University of Science and Technology Introduction to Color Image Processing


14 / 28

Image compression

Coding redundancy?

The average number of bits required to represent each pixel is:


L−1
P
Lavg = l(rk )pr (rk ) = 0.25(2) + 0.47(1) + 0.24(3) + 0.03(3) = 1.81bits
k=0
8
C= 1.81

R = 1 − 1/4.42 = 0.7474

Norwegian University of Science and Technology Introduction to Color Image Processing


15 / 28

Image compression

Spatial redundancy?
All 256 intensities are equally probable.
The pixels along each line are identical.
The intensity of each line was selected randomly.

Run length pair specifies the start of a new intensity and the number of consecutive pixels that
have the intensity.
Each 256 pixel line of the original representation is replaced by a single 8 bit intensity value and
length 256 in the run-length representation.

Norwegian University of Science and Technology Introduction to Color Image Processing


16 / 28

Image compression

Spatial redundancy?

Norwegian University of Science and Technology Introduction to Color Image Processing


16 / 28

Image compression

Temporal redundancy?

Consecutive frames in video have temporal redundancy.

Norwegian University of Science and Technology Introduction to Color Image Processing


17 / 28

Image compression

Image compression model

Norwegian University of Science and Technology Introduction to Color Image Processing


18 / 28

Image compression

Measuring image information

A random event E with probability P(E ) is said to contain the following units of information:
1
I (E ) = log P(E ) = − log P(E )

We can use the histogram of the observed image to estimate the symbol probabilities of the
source.
Assuming that pr (rk ) is the normalized histogram, the intensity source’s entropy is equal to:
L−1
P
H=− pr (rk ) log pr (rk )
k=0

Norwegian University of Science and Technology Introduction to Color Image Processing


19 / 28

Image compression

Huffman codes

Developed in 1952 by D. A. Huffman.


Assume the source alphabet be s1 , s2 , · · · , sN with probability of occurance p1 , p2 , · · · , pN .
We will take the following steps for the compression of the data:
1 Sort symbols in decreasing order of probability
2 Merge two symbols with lowest probabilities, say sN−1 and sN .
3 Replace the pair by HN−1 which is equal to sN−1 + sN .
4 Now the new set of symbols has N − 1 members (s1 , s2 , · · · , HN−1 ).
5 repeat previous steps until all symbols merged.
Process viewed as construction of a binary tree. On completion, all symbols si will be leaf nodes.
Code word for si obtained by traversing tree from root to the leaf node corresponding to si .

Norwegian University of Science and Technology Introduction to Color Image Processing


20 / 28

Image compression

Huffman code example

Norwegian University of Science and Technology Introduction to Color Image Processing


21 / 28

Image compression

Huffman code example

Norwegian University of Science and Technology Introduction to Color Image Processing


21 / 28

Image compression

Arithmetic coding
Blocking symbols prior to coding can lead to coding efficiency
Not practical with Huffman coding
Arithmetic coding allows you to do precisely this
Basic idea - map data sequences to sub-intervals in (0,1) with lengths equal to probability of
corresponding sequence.
To encode a given sequence transmit any number within the sub-interval
In practice, for images, arithmetic coding gives 10-20% improvement in compression ratios over
a simple Huffman coder. The complexity of arithmetic coding is however 50 - 300% higher.

Norwegian University of Science and Technology Introduction to Color Image Processing


22 / 28

Image compression

Arithmetic coding

Norwegian University of Science and Technology Introduction to Color Image Processing


22 / 28

Image compression

Run-length codes

Encode runs of symbols rather than symbols themselves: bbbaaadddddcfffffffaaaaaddddd will be


encoded as 3b3a4d1c7f 5a5d
Especially suitable for binary alphabet: 001111111000000011011111100000 will be encoded as
2, 7, 7, 2, 1, 6, 5
Run lengths can be further encoded using a VLC (Variable Length Code).

Norwegian University of Science and Technology Introduction to Color Image Processing


23 / 28

Image compression

Bit plane coding

Norwegian University of Science and Technology Introduction to Color Image Processing


24 / 28

Final points

Norwegian University of Science and Technology Introduction to Color Image Processing


25 / 28

Final points

Reference group

Go to menti.com and use code 6771 5444

Norwegian University of Science and Technology Introduction to Color Image Processing


26 / 28

Final points

Final notes

We will have a small quiz next session


Next lecture will be Friday the 27th of October at 12:15 in K102

Norwegian University of Science and Technology Introduction to Color Image Processing


27 / 28

Final points

Acknowledgment

Some of the slides, figures, and images are inspired and/or used from slides created by:
Professor Azeddine Beghdadi, University of Paris 13.
Dr. Onur G. Guleryuz, Google Daydream R&D team
Professor Gordon Wetzstein, Stanford University
Dr. Frank (Qingzhong) Liu, New Mexico Tech
Dr. Farah Torkamaniazar, Shahid Beheshti University

Norwegian University of Science and Technology Introduction to Color Image Processing


28 / 28

You might also like