written 6.2 years ago by | modified 2.1 years ago by |
Subject: Digital Image Processing
Marks: 10,M
Difficulty: Medium / High
written 6.2 years ago by | modified 2.1 years ago by |
Subject: Digital Image Processing
Marks: 10,M
Difficulty: Medium / High
written 2.1 years ago by |
Solution:
$ \begin{array}{cc} \text { Symbol } & \text { Huffman code. } \\ a_1 & 1 \\ a_2 & 01 \\ a_3 & 001 \\ a_4 & 000. \end{array} $
$ \begin{aligned} \text { Length } &=\sum(\text { number of bits for each symbol }) \times \text { probabit } \\ &=1 \times 0.9+2 \times 0.06+3 \times 0.02+3 \times 0.02 \\ &=0.9+0.12+0.06+0.06 \\ &=1.14 \text { bits. } \end{aligned} $
Entropy:-
$ \begin{aligned} H(s)=&-\sum_{k=0}^{N-1} P_k \log _2 P_k \\ =&-\left[0.9 \log _2 0.9+0.06 \log _2 0.06+0.02 \log _2 0.02\right.\\ &\left.\quad+0.02 \log _2 0.02\right] \\ =&-[-0.1368-0.2435-0.1128-0.1128] \\ =& 0.6046 \end{aligned} $
$ \begin{aligned} \text { Efficiency } &=\frac{H(S)}{L}=\frac{\text { Entropy }}{\text { Average length }} \\ &=\frac{0.6046}{1.14}=0.5303 \\ &=53.03 \% . \end{aligned} $
Run length coding:-
It is the simplest dictonary-based data compression technique.
Images particularly. those having very few gray levels often contain regions of adjacent pixels, all with the same gray level.
Each row of such images can have long runs of the same gray value.
For example, Consider the first row of an image that has the following gray levels.
This row of an image has 15 gray values.
Using RLE.
Hence RLE of this row is
$ 2 3 5 8 6 4 \text {. } $
The RLE eliminates Inter -pixel redundancies.