spandana image processing and compression techniques (7840228)

89
IMAGE PROCESSING AND COMPRESSION TECHNIQUES By T. Spandana 094D1A0426 E.C.E SSIET,Vadiyampeta. 1

Upload: indianspandana

Post on 07-May-2015

2.188 views

Category:

Education


1 download

DESCRIPTION

this is my technical seminar....

TRANSCRIPT

Page 1: Spandana   image processing and compression techniques (7840228)

1

IMAGE PROCESSING AND COMPRESSION

TECHNIQUES

By T. Spandana094D1A0426

E.C.ESSIET,Vadiyampeta.

Page 2: Spandana   image processing and compression techniques (7840228)

2

Objective

The objective of image processing is to sharpen, minimize the effect

of degradation, reduce the amount of memory to store the image

information (image compression).

Page 3: Spandana   image processing and compression techniques (7840228)

3

Introduction

Image processing pertains to the alteration and analysis

of pictorial information.

Common case of image processing is the adjustment

of brightness and contrast controls on a television set by

doing this we enhance the image until its subjective

appearing to us is most appealing.

Page 4: Spandana   image processing and compression techniques (7840228)

4

What is the Digital Image Processing?

Digital: Operating by the use of discrete signals to represent data in

the form of numbers. Image: An image (from Latin imago) or picture is an artefact, usually

two-dimensional. Processing:

To perform operations on data according to programmed instructions.

Terminology

Page 5: Spandana   image processing and compression techniques (7840228)

5

Thus the definition of the digital image processing may be given

as:

“Digital image processing is the use of computer  algorithms to perform image processing on digital images ”

Definition

Page 6: Spandana   image processing and compression techniques (7840228)

6

Digital image: An image may be defined as a two-

dimensional function, f(x, y).

A digital image is composed of a finite number of elements.

These elements are referred to as picture elements, image elements, pels, and pixels.

Page 7: Spandana   image processing and compression techniques (7840228)

7

Digital image processing sequence

Page 8: Spandana   image processing and compression techniques (7840228)

8

Key Stages in Digital Image Processing

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 9: Spandana   image processing and compression techniques (7840228)

9

Key Stages in Digital Image Processing:Image acquisition

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 10: Spandana   image processing and compression techniques (7840228)

10

Key Stages in Digital Image Processing:Image Enhancement

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 11: Spandana   image processing and compression techniques (7840228)

11

Key Stages in Digital Image Processing:Image Restoration

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 12: Spandana   image processing and compression techniques (7840228)

12

Key Stages in Digital Image Processing:Morphological Processing

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 13: Spandana   image processing and compression techniques (7840228)

13

Key Stages in Digital Image Processing:Segmentation

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 14: Spandana   image processing and compression techniques (7840228)

14

Key Stages in Digital Image Processing:Object Recognition

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 15: Spandana   image processing and compression techniques (7840228)

15

Key Stages in Digital Image Processing:Representation & Description

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 16: Spandana   image processing and compression techniques (7840228)

16

Key Stages in Digital Image Processing:Image Compression

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 17: Spandana   image processing and compression techniques (7840228)

17

Key Stages in Digital Image Processing:Colour Image Processing

Image Acquisition

Image Restoration

Morphological

Processing

Segmentation

Representation &

Description

Image Enhancemen

t

Object Recognition

Problem Domain

Colour Image

Processing

Image Compression

Page 18: Spandana   image processing and compression techniques (7840228)

18

Image Compression

Image compression addresses the problem of reducing the

amount of data required to represent a digital image.

It is the sub areas of image processing.

The underlying basis of the reduction process is the removal of the

redundant data.

Page 19: Spandana   image processing and compression techniques (7840228)

19

Goal of Image CompressionDigital images require huge amounts of space for storage and large

bandwidths for transmission.

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

Page 20: Spandana   image processing and compression techniques (7840228)

20

The Flow of Image Compression

To store the image into bit-stream as compact as

possible and to display the decoded image in

the monitor as exact as possible

Encoder 0101100111... Decoder

Original Image Decoded ImageBitstream

Figure: Flow of compression

Page 21: Spandana   image processing and compression techniques (7840228)

21

Different Compression Techniques Mainly two types of data Compression techniques are

there.

Loss less Compression.

Lossy Compression.

Page 22: Spandana   image processing and compression techniques (7840228)

22

Figure : Data compression methods

Page 23: Spandana   image processing and compression techniques (7840228)

23

Page 24: Spandana   image processing and compression techniques (7840228)

24

Lossless Compression

Page 25: Spandana   image processing and compression techniques (7840228)

25

Page 26: Spandana   image processing and compression techniques (7840228)

26

Run-length:

•Simplest method of compression.

• It can be used to compress data made of any combination of symbols.

•It does not need to know the frequency of occurrence of symbols and

can be very efficient if data is represented as 0s and 1s.

•The general idea behind this method is to replace consecutive repeating

occurrences of a symbol by one occurrence of the symbol followed by

the number of occurrences.

Page 27: Spandana   image processing and compression techniques (7840228)

27

Figure : Run-length encoding example

For instance,

Page 28: Spandana   image processing and compression techniques (7840228)

28

Page 29: Spandana   image processing and compression techniques (7840228)

29

Huffman coding

Huffman coding assigns shorter codes to symbols that occur more

frequently and longer codes to those that occur less frequently.

Page 30: Spandana   image processing and compression techniques (7840228)

30

Figure Huffman coding

Page 31: Spandana   image processing and compression techniques (7840228)

31

Figure Final tree and code

A character’s code is found by starting at the root and following the

branches that lead to that character. The code itself is the bit value of each

branch on the path, taken in sequence.

Page 32: Spandana   image processing and compression techniques (7840228)

32

Encoding

Figure Huffman encoding

Let us see how to encode text using the code for our five

characters. Figure shows the original and the encoded text.

Page 33: Spandana   image processing and compression techniques (7840228)

33

Decoding

Figure : Huffman decoding

The recipient has a very easy job in decoding the data it receives.

Figure shows how decoding takes place.

Page 34: Spandana   image processing and compression techniques (7840228)

34

Page 35: Spandana   image processing and compression techniques (7840228)

35

Lempel Ziv encoding

Lempel Ziv (LZ) encoding is an example of a category of algorithms

called dictionary-based encoding.

The idea is to create a dictionary (a table) of strings used during the

communication session.

Page 36: Spandana   image processing and compression techniques (7840228)

36

The LZW Algorithm (Compression) Flow ChartSTART

W= NULL

IS EOF?

K=NEXT INPUT

IS WKFOUND

?

W=WK

OUTPUT INDEX OF W

ADD WK TO DICTIONARY

STOP

W=K

YES

NO

YES

NO

Page 37: Spandana   image processing and compression techniques (7840228)

37

The LZW Algorithm (Compression) ExampleInput string is

The Initial Dictionarycontains symbols like a, b, c, d with their index values as 1, 2, 3, 4 respectively.

Now the input string is read from left to right. Starting from a.

a b d c a d a c

a 1

b 2

c 3

d 4

Page 38: Spandana   image processing and compression techniques (7840228)

38

The LZW Algorithm (Compression) Example

W = NullK = aWK = aIn the dictionary.

a b d c a d a c

a 1

b 2

c 3

d 4

K

Page 39: Spandana   image processing and compression techniques (7840228)

39

The LZW Algorithm (Compression) Example

K = b.WK = ab is not in the

dictionary.Add WK to

dictionaryOutput code for

a. Set W = b

a b d c a d a c

K

1

ab 5a 1

b 2

c 3

d 4

Page 40: Spandana   image processing and compression techniques (7840228)

40

The LZW Algorithm (Compression) Example

K = dWK = bdNot in the

dictionary.Add bd to

dictionary.Output code bSet W = d

a b d c a d a c

1

K

2

ab 5a 1

b 2

c 3

d 4

bd 6

Page 41: Spandana   image processing and compression techniques (7840228)

41

The LZW Algorithm (Compression) Example

K = aWK = da not in the

dictionary.Add it to

dictionary.Output code dSet W = a

a b d a b d a c

1

K

2 4

ab 5a 1

b 2

c 3

d 4

bd 6

da 7

Page 42: Spandana   image processing and compression techniques (7840228)

42

The LZW Algorithm (Compression) Example

K = bWK = ab It is in the

dictionary.

a b d a b d a c

1

K

2 4

ab 5a 1

b 2

c 3

d 4

bd 6

da 7

Page 43: Spandana   image processing and compression techniques (7840228)

43

The LZW Algorithm (Compression) Example

K = dWK = abd Not in the

dictionary.Add W to the

dictionary.Output code for

W.Set W = d

a b d a b d a c

1

K

2 4 5

ab 5a 1

b 2

c 3

d 4

bd 6

da 7

abd 8

Page 44: Spandana   image processing and compression techniques (7840228)

44

• K = a• WK = da In the dictionary.

a b d a b d a c

1

K

2 4 5

ab 5a 1

b 2

c 3

d 4

bd 6

da 7

abd 8

The LZW Algorithm (Compression) Example

Page 45: Spandana   image processing and compression techniques (7840228)

45

The LZW Algorithm (Compression) Example• K = c• WK = dac Not in the

dictionary.• Add WK to the

dictionary.• Output code for

W.• Set W = c• No input left so

output code for W.

a b d a b d a c

1

K

2 4 5

ab 5a 1

b 2

c 3

d 4

bd 6

da 7

abd 8

7

dac 9

Page 46: Spandana   image processing and compression techniques (7840228)

46

• The final output string is

1 2 4 5 7 3• Stop.

cadbadba

1

K

2 4 5

5ab

4d

3c

2b

1a

6bd

7da

8abd

7

9dac

3

The LZW Algorithm (Compression) Example

Page 47: Spandana   image processing and compression techniques (7840228)

47

LZW Decompression Algorithm Flow Chart

START

Output K

IS EOF?

K=NEXT INPUT

ENTRY=DICTIONARY INDEX (K)

ADD W+ENTRY[0] TO DICTIONARY

STOP

W=ENTRY

K=INPUT

W=K

YES

NO

Output ENTRY

Page 48: Spandana   image processing and compression techniques (7840228)

48

The LZW Algorithm (Decompression) Example

• K = 1• Out put K (i.e. a)• W = K

1

K

2 4 5

4d

3c

2b

1a

7 3

a

Page 49: Spandana   image processing and compression techniques (7840228)

49

• K = 2• entry = b• Output entry• Add W + entry[0]

to dictionary• W = entry[0] (i.e.

b)

1

K

2 4 5

4d

3c

2b

1a

7 3

a b

5ab

The LZW Algorithm (Decompression) Example

Page 50: Spandana   image processing and compression techniques (7840228)

50

• K = 4• entry = d• Output entry• Add W + entry[0]

to dictionary• W = entry[0] (i.e.

d)

1

K

2 4 5

4d

3c

2b

1a

7 3

a b

5ab

6bd

d

The LZW Algorithm (Decompression) Example

Page 51: Spandana   image processing and compression techniques (7840228)

51

• K = 5• entry = ab• Output entry• Add W + entry[0]

to dictionary• W = entry[0] (i.e.

a)

1

K

2 4 5

4d

3c

2b

1a

7 3

a b

5ab

6bd

d a b

7da

The LZW Algorithm (Decompression) Example

Page 52: Spandana   image processing and compression techniques (7840228)

52

• K = 7• entry = da• Output entry• Add W + entry[0]

to dictionary• W = entry[0] (i.e.

d)

1

K

2 4 5

4d

3c

2b

1a

7 3

a b

5ab

6bd

d a b

7da

d a

8abd

The LZW Algorithm (Decompression) Example

Page 53: Spandana   image processing and compression techniques (7840228)

53

• K = 3• entry = c• Output entry• Add W + entry[0]

to dictionary• W = entry[0] (i.e.

c)

1

K

2 4 5

4d

3c

2b

1a

7 3

a b

5ab

6bd

d a b

7da

d a

8abd

c

9dac

The LZW Algorithm (Decompression) Example

Page 54: Spandana   image processing and compression techniques (7840228)

54

Page 55: Spandana   image processing and compression techniques (7840228)

55

Information loss is tolerable.

Many-to-1 mapping in compression eg. Quantization

LOSSY COMPRESSION METHODS

Page 56: Spandana   image processing and compression techniques (7840228)

56

Several methods have been developed using lossy compression

techniques.

JPEG (Joint Photographic Experts Group) encoding is used to

compress pictures and graphics.

MPEG (Moving Picture Experts Group) encoding is used to compress

video.

MP3 (MPEG audio layer 3) for audio compression.

LOSSY COMPRESSION METHODS

Page 57: Spandana   image processing and compression techniques (7840228)

57

Page 58: Spandana   image processing and compression techniques (7840228)

58

JPEG Compression

image, ~150KB

JPEG compressed, ~14KB

Page 59: Spandana   image processing and compression techniques (7840228)

59

Image compression – JPEG encoding

JPEG encoding is done in four steps:

1. Image preparation

2. Discrete Cosine Transform (DCT)

3. Quantization

4. Entropy Encoding

Page 60: Spandana   image processing and compression techniques (7840228)

60

Figure : JPEG grayscale example, 640 × 480 pixels

Page 61: Spandana   image processing and compression techniques (7840228)

61

Block diagram for JPEG encoder.

The JPEG compression process

Page 62: Spandana   image processing and compression techniques (7840228)

62

Discrete cosine transform (DCT)In this step, each block of 64 pixels goes through a transformation

called the discrete cosine transform (DCT).

The transformation changes the 64 values so that the relative

relationships between pixels are kept but the redundancies are

revealed.

P(x, y) defines one value in the block, while T(m, n) defines the value

in the transformed block.

Page 63: Spandana   image processing and compression techniques (7840228)

63

Page 64: Spandana   image processing and compression techniques (7840228)

64

Quantization

After the T table is created, the values are quantized to reduce the

number of bits needed for encoding.

Quantization divides the number of bits by a constant and then drops

the fraction. This reduces the required number of bits even more.

.

Page 65: Spandana   image processing and compression techniques (7840228)

65

Reading the table

Zig zag recording

Page 66: Spandana   image processing and compression techniques (7840228)

66

Block diagram for JPEG Decoder.

Page 67: Spandana   image processing and compression techniques (7840228)

67

Examples of varying JPEG compression ratios

500KB image, minimum compression

40KB image, half compression

11KB image, max compression

Page 68: Spandana   image processing and compression techniques (7840228)

68

Page 69: Spandana   image processing and compression techniques (7840228)

69

Video compression – MPEG encoding

The Moving Picture Experts Group (MPEG) method is used to

compress video.

Principle, a motion picture is a rapid sequence of a set of frames in

which each frame is a picture.

Compressing video, then, means spatially compressing each frame

and temporally compressing a set of frames.

Page 70: Spandana   image processing and compression techniques (7840228)

70

Spatial compressionThe spatial compression of each frame is done with JPEG, or a

modification of it. Each frame is a picture that can be independently

compressed.

Temporal compression

In temporal compression, redundant frames are removed. When we

watch television, for example, we receive 30 frames per second.

However, most of the consecutive frames are almost the same.

Page 71: Spandana   image processing and compression techniques (7840228)

71

Figure MPEG frames

Page 72: Spandana   image processing and compression techniques (7840228)

72

Page 73: Spandana   image processing and compression techniques (7840228)

73

Audio compression

Audio compression can be used for speech or music. For speech

we need to compress a 64 kHz digitized signal, while for music we

need to compress a 1.411 MHz signal.

Two categories of techniques are used for audio compression:

predictive encoding and perceptual encoding.

Page 74: Spandana   image processing and compression techniques (7840228)

74

Predictive encoding

In predictive encoding, the differences between samples are

encoded instead of encoding all the sampled values.

This type of compression is normally used for speech. Several

standards have been defined such as GSM (13 kbps), G.729 (8 kbps),

and G.723.3 (6.4 or 5.3 kbps).

Page 75: Spandana   image processing and compression techniques (7840228)

75

Perceptual encoding: MP3

The most common compression technique used to create CD-

quality audio is based on the perceptual encoding technique.

This type of audio needs at least 1.411 Mbps, which cannot be sent

over the Internet without compression. MP3 (MPEG audio layer 3)

uses this technique.

Page 76: Spandana   image processing and compression techniques (7840228)

76

Advantages:In medicine Vision Systems are flexible, inexpensive, powerful tools that can

be used with ease.In Space Exploration the robots play vital role which in turn use

the image processing techniques Astronomical Observations.Used in Remote Sensing, Geological Surveys for detecting

mineral resources etc.Also used for character recognizing techniques, inspection for

abnormalities in industries.

Page 77: Spandana   image processing and compression techniques (7840228)

77

Disadvantages:

A Person needs knowledge in many fields to develop an application /

or part of an application using image processing.

Calculations and computations are difficult and complicated so needs

an expert in the field related. Hence it’s unsuitable and unbeneficial to

ordinary programmers with mediocre knowledge

Page 78: Spandana   image processing and compression techniques (7840228)

78

ApplicationsOne of the most common uses of DIP techniques: improve quality,

remove noise etc

Page 79: Spandana   image processing and compression techniques (7840228)

79

The Hubble TelescopeLaunched in 1990 the Hubble telescope can take images of very distant objectsHowever, an incorrect mirror made many of Hubble’s images uselessImage processing techniques were used to fix this

Page 80: Spandana   image processing and compression techniques (7840228)

80

MedicineTake slice from MRI scan of canine heart, and find boundaries between types of tissues

Original MRI Image of a Dog Heart Edge Detection Image

Page 81: Spandana   image processing and compression techniques (7840228)

81

GIS Geographic Information Systems

Digital image processing techniques are used extensively to manipulate satellite imagery

Terrain classificationMeteorology

Page 82: Spandana   image processing and compression techniques (7840228)

82

PCB Inspection Printed Circuit Board (PCB) inspection

Machine inspection is used to determine that all components are present and that all solder joints are acceptable

Both conventional imaging and x-ray imaging are used

Page 83: Spandana   image processing and compression techniques (7840228)

83

HCITry to make human computer interfaces

more natural

Face recognition

Gesture recognition

Page 84: Spandana   image processing and compression techniques (7840228)

84

Inserting Artificial Objects into a Scene

Page 85: Spandana   image processing and compression techniques (7840228)

85

Human Activity Recognition

Page 86: Spandana   image processing and compression techniques (7840228)

86

CONCLUSION: Image processing plays a vital role in many applications such

asFingerprint Identification SystemMedicineGeographic Information SystemsPrinted Circuit Board (PCB) inspectionhuman computer interfacesInserting Artificial Objects into a SceneHuman Activity Recognitionsoon…….

Page 87: Spandana   image processing and compression techniques (7840228)

87

Future scope The digital Image Processing is now finding wide range of uses in

different modern applications. Few of them (in which researcher are trying developments)include:

Expert Systems

Parallel Processing

Neural Networks

Page 88: Spandana   image processing and compression techniques (7840228)

88

Page 89: Spandana   image processing and compression techniques (7840228)

89