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

Dip Unit 5

The document covers various aspects of image compression, including techniques like Huffman coding, run length coding, and the need for compression in terms of storage and communication efficiency. It also discusses types of data redundancy, lossless vs lossy compression, and standards for image compression. Additionally, it outlines the applications of image compression and provides examples of coding methods and their limitations.

Uploaded by

rohithalex06
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 views21 pages

Dip Unit 5

The document covers various aspects of image compression, including techniques like Huffman coding, run length coding, and the need for compression in terms of storage and communication efficiency. It also discusses types of data redundancy, lossless vs lossy compression, and standards for image compression. Additionally, it outlines the applications of image compression and provides examples of coding methods and their limitations.

Uploaded by

rohithalex06
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/ 21

CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION

IMAGE PROCESSING

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


CS4503 / FUNDAMENTALS OF DIGITAL IMAGE PROCESSING
QUESTION BANK YEAR / SEM: II / 04
UNIT – 5 IMAGE COMPRESSION
(PART – A)

1. State whether the given Huffman code 1, 10, 01, 011 for symbol a1, a2, a3, a4 are
uniquely decodable or not?
a1 1
a2 10
a3 01
a4 011 it’s not uniquely decoded. Because 1 is prefix of 10 and 0 suffix.

2. What is a shift code? How this is used in image analysis?

A shift codes are generated by


• Arranging probabilities of the source symbols are monotonically decreasing
• Dividing the total number of symbols into symbol blocs of equal size
• Coding the individual elements within all blocks identically
• Adding special shift up / down symbols to identify each block.
3. What is need for compression?
In terms of storage, the capacity of a storage device can be effectively increased with
methods that compress a body of data on its way to a storage device and decompress it when it is
retrieved.
1. In terms of communications, the bandwidth of a digital communication link can be
effectively increased by compressing data at the sending end and decompressing data
at the receiving end.
2. At any given time, the ability of the internet to transfer data is fixed. Many files can be
combined into one compressed document making sending easier.
3.
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

4. List the basic types of data redundancy?


1. Statistical redundancy
i. Inter pixel redundancy
a. Spatial redundancy
b. Temporal redundancy
ii. Coding redundancy
2. Psycho visual redundancy

5. Give the loss less predictive model?


Predictive Coding
1. Lossless predictive coding
2. Optimum predictors
3. JPEGLS lossless compression standard
4. Lossy predictive coding: DPCM
5. Rate distortion performance of DPCM
6. Define coding redundancy?
If the gray level of an image is coded in a way that uses more code words than necessary to
represent each gray level, then the resulting image is said to contain coding redundancy.

7. What is inter pixel redundancy?


The value of any given pixel can be predicted from the values of its neighbors. The
information carried by is small. Therefore the visual contribution of a single pixel to an image is
redundant.
It is also called as spatial redundant, geometric redundant or inter pixel redundant.
Example: Run length coding.

8. What is the basic concept of run length coding?


• Run length coding or RLE is a technique used to reduce the size of a repeating string of
characters. This repeating string is called a run, typically RLE encodes a run of symbols into
two bytes, a count and a symbol.
• RLE can compress any type of data regardless of its information content, but the content of
data to be compressed affects the compression ratio. Compression is normally measured
with the compression ratio.
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

9. Mention the limitation of Huffman coding.

1. It requires the knowledge of the probabilistic model of the source. But the source statistics
in advance is not possible at all times.
2. With modeling text, the storage requirements prevent the Huffman code from capturing the
higher order relationship between words.
3. This coding algorithm does not uses fixed length codes, therefore it is not suitable for sync
transmission
To overcome these limitations, the Lempel ziv algorithm can be used, which is adaptive and
simpler to implement than Huffman Coding.
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

10. State the need for data compression and compare lossless and lossy Compression
technique

Lossy Compression Lossless Compression


The technique involves some loss of Involves no loss of information.
information.
Data that has been compressed using If data has been (lossless) compressed,
this technique can’t be recovered and the original data can be recovered from
reconstructed exactly the compressed data.
Used for application that can tolerate Used for application that can’t tolerate
difference between the original and any difference between original and
reconstructed data. reconstructed data.
Distortion Distortion less

11. Explain any four variable length coding compression schemes.


Variable length coding is used to reduce only coding redundancy. It is present in any
natural binary encoding of gray level in an image.
Variable length coding assigns shortest possible code words to the most probable
intensity levels and vice versa.
1. Huffman coding
2. Arithmetic coding
3. LZW coding

12. List the applications of image compression

Televideo conferencing,
Remote sensing (satellite imagery),
Document and medical imaging,
Facsimile transmission (FAX),
Control of remotely piloted vehicles in military, space, and hazardouswaste management.
13. State Fidelity criteria?
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

14. Define Coding Efficiency?

15. Define quantization?


The process of mapping a large set of possible pixel values to a smaller, finite set of discrete
values. Essentially, it reduces the number of distinct intensity levels or colors in an image, making it
easier to process, compress, or store.

16. State linear Prediction?


linear combination of m previous pixels.
Use local neighbourhoods (e.g., pixels-1,2,3,4) for prediction of pixel-X in 2-D images
special case : previous pixel predictor

17. State the concept oof variable length code.


Variable Length Code (VLC) is a method of encoding data in which symbols are represented by codes of
varying lengths, depending on their frequency or probability of occurrence. This concept is widely used
in data compression algorithms to minimize storage or transmission costs.

5
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

PART – B

1. Explain Huffman coding with example


Huffman coding
1. The most popular method to yield the smallest possible number of code symbols per source
symbol
2. construct the Huffman tree according to source symbol probabilities
3. Code the Huffman tree
4. Compute the source entropy, average code length, and code efficiency
6

Huffman code is :
a block code (each symbol is mapped to a fixed sequence of bits) instantaneous (decoded
without referencing succeeding symbols) uniquely decodable (any code word is not a prefix
of another)

for example : 010100111100 a3 a1 a2 a2 a 6

2. What is the need for image compression? Explain image compression standards
In details.
Need for image compression
In terms of storage, the capacity of a storage device can be effectively increased with
methods that compress a body of data on its way to a storage device and decompress it when it is
retrieved.
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

1. In terms of communications, the bandwidth of a digital communication link can be


effectively increased by compressing data at the sending end and decompressing
data at the receiving end.
2. At any given time, the ability of the internet to transfer data is fixed. Many files can
be combined into one compressed documents making sending easier.
Image compression standards
An image file format is a standard way to organize and store image data. It defines how to
data is arranged and the type of compression if any that is used. An image contains is similar to a
file format but handles multiple types of image data.
Image compression standards define procedures for compressing and decompressing
images i.e., for reducing the amount of data needed to represent an image. These standards are the
underpinning of the widespread acceptance of image compression technology.
Image compression standards

Still image Video


1. DV
2. H.261
3. H.262
Binary image compression Cont.tone still image compression
4. H.263
5. H264
6. MPEG – 1
7. MPEG – 2
8. MPEG – 3
9. MPEG – 4
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

Binary image compression


1. CCITT Group 3
2. CCITT Group 4
3. JBIG or JBIG 1
4. JBIG 2
Cont.tone still image compression
1. JPEG
2. JPEG – LS
3. JPEG – 2000

Image compression standards are sanctioned by the international Standards Organization


(ISO), the international Electro technical Commission (IEC), or the international
Telecommunications Union (ITU-T) a United Nations (UN) organization that was once
called the consultative committee of the International Telephone and Telegraph (CCITT).
Binary image compression standards

Two of the oldest and most widely used image compression standards are the CCITT group
3 and group 4 standards for binary image compression.
They have been used in a variety of computer applications and they were originally
designed as facsimile (FAX) coding methods for transmitting documents over telephone
networks.
The group 3 standard uses a 1-D run length coding technique in which the last K-1
lines of each group of Kline (for K = 2 or 4) can be optionally coded in a 2-D manner.
The group 4 standard is a simplified or streamlined version of the group 3 standard
in which only 2-D coding is allowed.
Both group 3 and group 4 standards are use the same 2-D coding approach, in that
two dimensional in the sense information from the previous line is used to encode the
current line.

One dimensional CCITT compression


The 1-D compression approach adopted for only the CCITT group 3 standards. Here each
line of an image is encoded as a series of variable length Huffman code words.
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

These code words represent the run lengths of alternating white and black runs in a left to
right scan of the line. The compression method employed is commonly referred to modify
Huffman (MH) coding. It has two types of code.
1. Terminating codes
2. Makeup codes
Depending on the run length value, two types of variable length code words are used.
1. If run length < 63 - then modified Huffman code is used as a terminating code.
2. If run length > 63 - then two codes are used makeup code for quotient and terminating
code
For remainder r mod 64.
The main requirements of 1-D compression standard are that each line begins with a white run
length code word. For zero run length, the white code word is 00110101.

End – of - Line (EOL) code word


The unique End of Line (EOL), code word is 12 bit code 000000000001. It is used for
1. To terminate each line
2. To indicate the first line of each new image
3. The end of a sequence of images is indicated by six EOLs.

Two dimensional CCITT compressions


• The 2-D compression approach is adopted for both the CCITT group 3 and 4 standards is a
line by line method in which the position of each black to white or white to black run
transition is coded with respect to the position of a reference element ao.
• The previously coded line is called the reference line and the reference line for the first line
of each new image is an imaginary white line.
• Group 3 Two-Dimensional (G32D)
• Group 3 One-Dimensional (G31D) encoding, which we've discussed above, encodes each
scan line independent of the other scan lines. Only one run length at a time is considered
during the encoding and decoding process. The data occurring before and after each run
length is not important to the encoding step; only the data occurring in the present run is
needed.
• With Group 3 Two-Dimensional (G32D) encoding, on the other hand, the way a scan line is
encoded may depend on the immediately preceding scan-line data. Many images have a

10
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

high degree of vertical coherence (redundancy). By describing the differences between two
scan lines, rather than describing the scan line contents, 2D encoding achieves better
compression.

3. Explain the procedure for obtaining Run length coding (RLC). What are the
advantages if any?
One dimensional Run length coding
• This is an effective alternative approach area coding (CSC)
• The repeating string or sequence of pixels is called a run and their length is called the run
length. The run length of a white run is assumed to be zero and of a black run is assumed to
be one.
• Here, a sequence of length describing the successive runs of black and white pixels is used
to represent each row of an image or bit plane.
• It is mainly applied for facsimile (FAX) coding.

Run length coding is a Consultative Committee of the International Telegraph and


Telephone (CCITT), new standard that is used to encode binary and gray level images. The
technique scans the image row by row and identifies the run. The output run length vector specifies
the pixel value and the length of the run.
Concept
The 1-D run length coding concept is based on scanning a bit plane row by row. At last, the
value of the run is found using any one of the following conventional methods.
• Specify the value of the first run of each row.
• Assume that each row begins with a white run, whose run length is zero.
Two dimensional RLC
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

Two-dimensional run length coding technique is developed by extending the 1-D run length
coding concepts.
A good example of 2-D run length coding is relative address coding (RAC).
Relative Address Coding (RAC)
Example

Concept
RAC is based on the principle of tracking the binary transitions at which each black and
white runs start and end.
To handle the boundaries properly, an imaginary starting line as well as imaginary
transitions at the start and end of each line is assumed.
Coding line
The Modified READ (MR) algorithm is based on the relative positions of pixel changes. If a
2-D image needs to be codes, then a single line is chosen for encoding. This is called coding line.
The coding is done with respect to another line called reference line.
𝐻𝑜+𝐻1
Hrun-length =
𝐿𝑜+𝐿1

CCITT standards include Group 1 (G1), Group 2 (G2), Group 3 (G3) and Group 4 (G4)
standards for facsimile transmission. The groupings are based on the apparatus used. G1 and G2
standards are for analog fax devices, G3 and G4 are for digital transmission. G3 standard aims to
transmit an A4-sized document in one minute.
If the run length is less than 63, only termination codes are used. If the run length is more than
63, the H algorithm represents it as,
Run length = (M x 64) + T
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

2. What is arithmetic coding? Illustrate


Arithmetic coding is one of the variable length coding method which is used to reduce the
coding redundancies present in an image.
It was developed by Elias 1063.
Method
Unlike other variable length codes, arithmetic coding generates nonblack codes. It does not
have one to one correspondence between source and code symbols in which a code word is present
for each source symbol. Instead, a set or sequence of source symbols is assigned a single arithmetic
code word.
Features
➢ An interval of real numbers between 0 and 1 defined by the code words for each sequence
of source symbols.
➢ When the number of symbols in the message becomes smaller according to the probability
of each symbol.
➢ The number of bits for representing the interval becomes larger.
➢ This coding method satisfies the noiseless coding theorem.

Procedure
Consider a source with four symbols S1, S2, S3, and S4. Now, the sequence or message with five
symbols S1 S2 S3 S4 is required to be coded.
1. First, the message is assumed to occupy the entire interval [0, 1].
2. Now, the probabilities of each symbol in the message are found and according to these
probabilities each symbol is allotted an interval between 0 and 1.
Arithmetic coding example

Source symbol Probability Initial subinterval


S1 0.2 [0.0, 0.2]
S2 0.2 [0.2, 0.4]
S3 0.4 [0.4, 0.8]
S4 0.2 [0.8, 1.0]

3. The first symbol S1 of the message is narrowed to the initial sub interval.

17
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

4. The interval [0, 0.2] is subdivided according to the probability of the next symbol S2.
Minimum value + [difference x sub interval] = New interval
0 + [(0.2 – 0) x 0.2] = 0.04
0 + [(0.2 – 0) x 0.4] = 0.08
Thus, S2 narrows the subinterval [0.04, 0.08]
5. The interval of S2 is subdivided according to the probability of S3
0.04 + [(0.08 – 0.04) x 0.4] = 0.056
0.04 + [(0.08 – 0.04) x 0.8] = 0.072
Thus, S3 narrows the subinterval [0.056, 0.072]
6. Similarly, the last symbol S4 narrows the interval [0.0624, 0.0688]
0.056 + [(0.072– 0.056) x 0.8] = 0.0688
0.04 + [(0.072 – 0.056) x 0.4] = 0.0624
7. Finally,
0.0624 + [(0.0688 – 0.0624) x 1] = 0.0688
0.0624 + [(0.0688 – 0.0624) x 0.8] = 0.06752
Then, the final message symbol is reserved with a special end of message indicator, which
is here 0.06752. the S4 narrows the range [0.06752, 0.0688]
Arithmetic coding procedure

Number of source symbols = 5


Number of decimal digits used to represent = 3
Adhi College of Engineering & Technology 18
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

Number of decimal digits / source symbol = 3/5


= 0.6 digits / symbol
Limitations
There are two practical factors which affect the performance efficiency of arithmetic coding.
They are,
1. The addition of the end to end message indicator which is required to separate two
messages.
2. The use of finite precision arithmetic.
This problem can be handled by using a scaling strategy and a rounding strategy.
i. Scaling strategy
ii. Rounding strategy

3. Briefly describe the image compression models with neat diagrams?


Image compression is the process of reducing the amount of data required to represent an
image. All the compression techniques are combined to form practical image compression systems.
▪ Encoder
▪ Decoder

◼ Source encoder
◼ Remove input redundancies
◼ Channel encoder
◼ Increase the noise immunity of the source encoder’s output
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

• Mapper
◼ Transform the input data into a format designed to reduce interpixel redundancies in
the image (reversible)
◼ Quantizer
◼ Reduce the accuracy of the mapper’s output (reduce the psychovisual redundancies) –
irreversible and must be omitted on error-free compression
◼ Symbol encoder
◼ Fixed or variable-length coder (assign the shortest code words to the most frequently
occurring output to reduce coding

Lossless predictive coding


The system consists of an encoder and a decoder, each containing an identical predictor. As
successive samples of discrete time input signal, f (n ), are introduced to the
encoder, the predictor generates the anticipated value of each sample based on a
specified number of past samples. The output of the predictor is then rounded to the
nearest integer, denoted f ˆ( n), and used to form the difference or prediction error
e(n)=f(n)-f^(n).
reconstructs e (n) from the received variable-length code words and performs the inverse
operation.
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

• Eliminating the interpixel redundancies of closely spaced pixels by extracting and coding only
the new information (the difference between the actual and predicted value) in each pixel
• System architecture
• rounding the predicted value
• RLC symbol encoder
• Due to removal of interpixel redundancies by prediction, first- order entropy of difference
mapping will be lower than the original image (3.96 bits/pixel vs. 6.81 bits/pixel)
• The probability density function of the prediction errors is highly peaked at zero and
characterized by a relatively small variance (modeled by the zero mean uncorrelated Laplacian
pdf)

Lossy predictive coding

• Error-free encoding of images seldom results in more than 3:1 reduction in data
• A lossy predictive coding model
o the prediction in the encoder and decoder must be equivalent (same)
• placing encoder’s predictor within a feedback loop
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

Delta modulation (DM) is a simple but well-known form of lossy predictive coding in which the predictor
and quantizer are defined as

where a is a prediction coefficient (normally less than 1), and z is a positive constant. The output of the
quantizer, e(n ),
CS4503/ FUNDAMENTALS OF DIGITAL UNIT – 5 / IMAGE COMPRESSION
IMAGE PROCESSING

◼ Slope overload effect


◼ V is too small to represent input’s large changes, lead to blurred object edges
◼ Granular noise effect
◼ V is too large to represent input’s small change, lead to grainy or noisy surfaces

IMAGE COMPRESSION STANDARDS

You might also like