FELICS
FELICS
k=
x[k]g[n k] (3.1)
The signal is also decomposed simultaneously using a high-pass lter h. The
outputs giving the detail coecients (from the high-pass lter) and approximation
coecients (from the low-pass). It is important that the two lters are related to
each other and they are known as a quadrature mirror lter.
However, since half the frequencies of the signal have now been removed, half
the samples can be discarded according to Nyquists rule. The lter outputs are
then subsampled by 2 (Mallats and the common notation is the opposite, g- high
pass and h- low pass):
y
low
[n] =
k=
x[k]g[2n k] (3.2)
y
high
[n] =
k=
x[k]h[2n k] (3.3)
This decomposition has halved the time resolution since only half of each lter
output characterises the signal. However, each output has half the frequency band
of the input so the frequency resolution has been doubled.
3.3 The Haar wavelet
The Haar sequence was proposed in 1909 by Alfrd Haar. Haar used these
functions to give an example of a countable orthonormal system for the space of
square-integrable functions on the real line. As a special case of the Daubechies
wavelet, the Haar wavelet is also known as D2.
In mathematics, the Haar wavelet is a sequence of rescaled square-shaped
functions which together form a wavelet family or basis. Wavelet analysis is sim-
ilar to Fourier analysis in that it allows a target function over an interval to be
represented in terms of an orthonormal function basis. The Haar sequence is now
Department of Electronics, Walchand College of Engineering, Sangli 16
3.3 The Haar wavelet
recognised as the rst known wavelet basis and extensively used as a teaching
example.
The Haar wavelet is also the simplest possible wavelet. The technical dis-
advantage of the Haar wavelet is that it is not continuous, and therefore not
dierentiable. This property can, however, be an advantage for the analysis of
signals with sudden transitions, such as monitoring of tool failure in machines.
For an input represented by a list of 2
n
numbers, the Haar wavelet transform may
be considered to simply pair up input values, storing the dierence and passing
the sum. This process is repeated recursively, pairing up the sums to provide the
next scale: nally resulting in 2
n1
dierences and one nal sum. it is used for
signal coding, to represent a discrete signal in a more redundant form, often as a
preconditioning for data compression.
Figure 3.1: The Haar wavelet
The Haar wavelets mother wavelet function (t) can be described as
(t) =
_
_
1 0 t < 1/2,
1 1/2 t < 1,
0 otherwise.
Its scaling function (t) can be described as
(t) =
_
1 0 t < 1,
0 otherwise.
Haar matrix
The 2 2 Haar matrix that is associated with the Haar wavelet is
Department of Electronics, Walchand College of Engineering, Sangli 17
3.4 Haar transform
H
2
=
_
1 1
1 1
_
Using the discrete wavelet transform, one can transform any sequence
(a
0
, a
1
, . . . , a
2n
, a
2n+1
)of even length into a sequence of two-component-vectors
((a
0
, a
1
) , . . . , (a
2n
, a
2n+1
)). If one right-multiplies each vector with the matrix H
2
,
one gets the result ((s
0
, d
0
) , . . . , (s
n
, d
n
)) of one stage of the fast Haar-wavelet
transform. Usually one separates the sequences s and d and continues with trans-
forming the sequence s.
3.4 Haar transform
The Haar transform is the simplest of the wavelet transforms. This trans-
form cross-multiplies a function against the Haar wavelet with various shifts and
stretches, like the Fourier transform cross-multiplies a function against a sine wave
with two phases and many stretches.
The Haar transform can be thought of as a sampling process in which rows of
the transformation matrix act as samples of ner and ner resolution.
The resulting decomposition after 1-level and 2-level is visible in the Fig. 3.2
Figure 3.2: (a) Original image (b) Image after 1-level decomposition (c) Image
after 2-level decomposition
The LL1 block in Fig. 3.2(b), has the approximate information after 1-level
decomposition, while HH1 block has the detail information after 1-level decompo-
sition. Similarly, LL2 block in Fig. 3.2(c), has the approximate information after
2-level decomposition, while HH2 block has the detail information after 2-level
decomposition.
Department of Electronics, Walchand College of Engineering, Sangli 18
Chapter 4
Background of FELICS
Algorithm
The FELICS algorithm, proposed by P. G. Howard and J. S. Vitter in 1993,
is a lossless compression algorithm with the advantage of fast and ecient coding
principle. In FELICS, three primary techniques, including intensity distribution
model, adjusted binary code and Golomb-Rice code, are incorporated to construct
complete coding ow.
Figure 4.1: Illustration of prediction template used in FELICS
As shown in Fig. 4.1, FELICS utilizes two reference pixels around current
pixel to yield the prediction template, and it can be divided into four cases. In
case 1, since surrounding reference pixels are not available for the rst two pixels,
P1 and P2, both current pixels are directly packed into bitstream with original
pixel intensity. For case 2, successive pixels, N1 and N2, are regarded as reference
pixels for current pixel P5. For non-rst row, cases 3 and 4 clearly dene the
relationship between current pixel and reference pixels. Between N1 and N2, the
smaller reference pixel is represented as L, and the other one is H. As depicted in
Fig. 4.1, the intensity distribution model is exploited to predict the correlation
between current pixel and reference pixels. In this model, the intensity that occurs
19
between L and H is with almost uniform distribution, and regarded as in range.
The intensity higher than H or smaller than L is regarded as above range and
below range, respectively. For in range, the adjusted binary code is adopted, and
Golomb-Rice code is for both above range and below range [5].
Figure 4.2: Probability distribution model of intensity in FELICS
Figure 4.3: Main owchart for FELICS Algorithm
Fig. 4.3 shows the main owchart of the FELICS algorithm. Here, the rst
two pixels are directly encoded because no reference pixels are available to those
pixels. Then next pixel is encoded, taking previous two pixels as reference pixels.
The greater one of two pixels is assigned to H, while smaller one is assigned to
L. Now, if the value of current pixel is between H and L, then adjusted binary
coding is used for encoding of that pixel, else that pixel is encoded by Golomb-Rice
coding.
Department of Electronics, Walchand College of Engineering, Sangli 20
4.1 Adjusted Binary Code
4.1 Adjusted Binary Code
Fig. 4.2 shows that the adjusted binary code is adopted in in-range, where
the intensity of current pixel is between H and L. For in range, the probability
distribution is slightly higher in the middle section and lower in both side sections.
Therefore, the feature of adjusted binary code claims that the shorter codeword
is assigned to the middle section, and longer one is assigned to both side sections.
To describe the coding ow of adjusted binary code, the coding parameters should
be rst declared as follows:
delta = H L
range = delta + 1
upperbound = (log
2
(range))
lowerbound = (log
2
(range))
threshold = 2
upperbound
range
shiftnumber =
range threshold
2
Figure 4.4: Flowchart for Adjusted Binary Codes
The adjusted binary code takes the sample of P L to be encoded, and range
indicates that the number of possible samples should be encoded for a given delta.
The upperbound and lowerbound denote the maximum and minimum number of
bits to represent the codeword for each sample, respectively. Particularly, the
lowerbound is identical to upperbound, while the range is exactly equal to the
power of two. The threshold and shiftnumber are utilized to determine which
sample should be encoded with upperbound bit or lowerbound bit. After com-
puting the various parameters required for adjusted binary codes, the samples
Department of Electronics, Walchand College of Engineering, Sangli 21
4.2 Coding Example of Adjusted Binary Coding
are available in the range 0 to delta. If the samples are kept as it is i.e. in the
ascending order starting from zero, then the number of bits required to represent
a particular sample will go on increasing as value of sample increases.
If the residual has a smaller sample value then, it can be encoded using less
number of bits, but if the residual has larger sample value then it requires more
number of bits. Thus, if there is an image having smaller residual values, then
the image will be compressed with higher compression ratio. On the other hand,
if the image is having higher values of residuals, then the codewords required for
representing such residuals require more number of bits and hence, for such an
image, instead of compression, the image will get expanded.
To avoid such a situation, the residuals having smaller as well as larger sample
values are shifted to the centre by the amount equal to shift number which is
calculated previously.
If delta = 4, the range is equal to [0, 4]. The required number of bits is 2 for
lowerbound and 3 for upperbound. With the intensity distribution in in-range, 2
bits are allocated for the middle section, including sample of [1, 2, 3], and 3 bits
for side section, including sample of [0, 4].
4.2 Coding Example of Adjusted Binary Coding
Figure 4.5: Reference pixels and Current pixel adjusted binary code example
Fig. 4.5 shows the block of pixels from other than rst row and left edge of
image template i.e. case 4.11 of image template. The current pixel has a value
46; its neighboring pixels 40 and 47 are considered as the reference pixels.
Since, the value of current pixel is between the values of two reference pixels;
adjusted binary coding is used for encoding of the current pixel.
So here,
P = 46, N1 = 40, N2 = 47
where, P : Current pixel
N1, N2: Reference pixels
Now, H = max(N1, N2) and L = min(N1, N2), so we have H = max(40, 47) = 47
and L = min(40, 47) = 40. Parameters required are computed as follows,
delta = H L = 7
range = delta + 1 = 7 + 1 = 8
Department of Electronics, Walchand College of Engineering, Sangli 22
4.3 Golomb-Rice Code
upperbound = log
2
(range) = log
2
(8) = 3
lowerbound = log
2
(range) = log
2
(8) = 2
threshold = 2
upperbound
range = 2
3
8 = 0
shiftnumber =
(range threshold)
2
=
(8 0)
2
= 4
Samples: 0 1 2 3 4 5 6 7
Samples shifted 4 5 6 7 0 1 2 3
by shift number
threshold is added 4 5 6 7 0 1 2 3
to samples threshold
The residual of pixel to be encoded is x = P L = 46 40 = 6.
Now the sample 6, is encoded as 2, so we have the binary equivalent of 2,as
the codeword, 10. To indicate that the current pixel is encoded using adjusted
binary coding, another 1 is prexed to the codeword. So the codeword becomes
110. The pixel 46 is encoded as 110.
4.3 Golomb-Rice Code
Figure 4.6: Flowchart for Golomb-Rice Codes
For both above range and below range, the probability distribution sharply
Department of Electronics, Walchand College of Engineering, Sangli 23
4.4 Coding Example of Golomb-Rice Coding
varies with exponential decay rate, and the ecient codeword should be more
intensively assigned to the intensity with high probability. Therefore, Golomb-
Rice code is adopted as the coding tool for both above range and below range.
With Golomb-Rice code, the codeword of sample x is partitioned into unary and
binary parts
Golomb-Rice Code
_
_
Unary part : floor(
x
2
k
)
Binary part : x mod 2
k
(4.1)
where, x is the value of residual and k is a positive integer and it is called as
Golomb-Rice coding parameter. The entire codeword is concatenated with unary
part and binary part, and two bits are pre-xed for identication. Therefore, the
Golomb-Rice code is a special case of Golomb code, and its k parameter, exactly
equal to power of 2, is ecient for hardware implementation.
4.4 Coding Example of Golomb-Rice Coding
Figure 4.7: Reference pixels and Current pixel for Golomb-Rice code example
Fig. 4.7 shows the block of pixels from other than rst row and left edge of
image template i.e. case 4 of image template. The current pixel has a value 183;
its neighboring pixels 177 and 179 are considered as the reference pixels.
Since, the value of current pixel is not in between the values of two reference
pixels; Golomb-Rice coding is used for encoding of the current pixel.
So here, P = 183, N1 = 177, N2 = 179
where, P : Current pixel
N1, N2: Reference pixels
Now, H = max(N1, N2) and L = min(N1, N2), So we have H = max(177, 179) =
179 and L = min(177, 179) = 177. The current pixel is above range since it is
greater than H, so we have to apply Golomb-Rice coding for encoding it. The
residual for above range is given by x = P H 1 = 183 179 1 = 3
The Golomb-Rice code has three parts: a) prex code b) unary part c) binary
part.
In the prex code rst bit is always 0 and second bit depends on whether the
current pixel is above range or below range. Second bit is 1 for above range and
0 for below range.
Department of Electronics, Walchand College of Engineering, Sangli 24
4.5 Coding Flow of FELICS Algorithm
The second part of code is unary part. Unarypart :
x
2
k
=
3
2
2
= 0, 0 in unary
is encoded as 0.
Binary part: x mod 2
k
= 3 mod 2
2
= 3, 3 in binary is encoded as 11.
So the complete codeword for current pixel 183 becomes 01011.
4.5 Coding Flow of FELICS Algorithm
Based on intensity distribution model, adjusted binary code and Golomb-Rice
code, the FELICS coding ow can be summarized as following steps.
1. The rst two pixels at rst row are directly packed into bitstream without
any encoding procedure.
2. According to the prediction template in Fig. 4.1, nd the corresponding two
reference pixels, N1 and N2.
3. Assign L = min(N1, N2), H = max(N1, N2) and delta = H L.
4. Apply adjusted binary code for P L in in-range, Golomb-Rice code for
L P 1 in below range, and Golomb-Rice code for P H 1 in above
range.
Except rst two pixels at rst row, the others are directly started from step 2
to step 4. The entire coding ow can be reversely performed as decoding ow.
4.6 General Example of Coding
There are dierent cases available for image template. Consider I be any gen-
eral matrix of size 4 4, from an image matrix, which is to be encoded. Since the
image is going to be a gray-scale image of bit depth 8, so the pixel values range
from 0 to 255. A 0 value indicates a black pixel and a 255 indicates a white pixel.
I =
_
_
254 251 245 220
244 220 244 200
250 210 220 238
200 222 219 180
_
_
Department of Electronics, Walchand College of Engineering, Sangli 25
4.6 General Example of Coding
Case 1
Figure 4.8: Pixels in Case 1
In case 1, the two pixels from left top corner are selected, according to image
template in Fig. 5.7, the rst two pixels i.e 254 and 251 are directly encoded using
8 bits and are sent directly without any encoding procedure. So the codewords
for 254 and 251 are 11110101 and 11111011 respectively.
Case 2
Now, according to case 2 from image template in Fig. 5.7, 245 is the current
pixel, P and previous two pixels are the reference pixels, N1 and N2. The circled
pixel is the current pixel and since it is in rst row it belongs to case 2 and
remaining pixels are the reference pixels for this case.
Figure 4.9: Pixels in Case 2
The greater of the two reference pixels is assigned to H and smaller is assigned
to L. So H has a value 254 and L has a value 251. Since the current pixel is
in between H and L, adjusted binary coding is applied to encoded that pixel.
The parameters required for encoding are computed as shown in section 4.2. We
get the values of the parameters as delta = 6, range = 7, lowerbound = 2,
upperbound = 3, threshold = 1 and shiftnumber = 3. So the codeword for cur-
rent pixel is evaluated to 1101, according to section 4.2.
Similarly, the next pixel 220 is also included in case 2. For this pixel the previous
two pixels i.e. 251 and 245 are the reference pixels and rest of the encoding pro-
cedure is same.
Case 3
In case 3, the current pixel is present at the left edge of the image matrix.
Now the next pixel which is to be encoded is 244. This pixel belongs to case 3,
according to Fig. 4.1.
For case 3, the reference pixels are the pixels to the top and top right of current
pixel.So we have 245 and 251 as reference pixels. Since the current pixel is less
Department of Electronics, Walchand College of Engineering, Sangli 26
4.6 General Example of Coding
Figure 4.10: Pixels in Case 3
than lower reference pixel L, it is regarded as out of range and hence it is encoded
using Golomb-Rice coding.Golomb-Rice code has three parts. In rst part there
are two bits, rst bit is always 0 to indicate that the current pixel is encoded
using Golomb-Rice coding. The second bit is to indicate whether the current pixel
is above range or below range. Now here since the current pixel is below range,
the second bit will be 0. So, rst part of Golomb-Rice code consists of 00.
The second part of Golomb-Rice code is the unary part. It is calculated according
to equation 4.1. A unary number, say x is represented by x, 1s followed by a 0.
Here the value of residual is x = L P 1 = 245 244 1 = 0, 0 in unary is
represented by 0. So the unary part has a 0.
The third part of Golomb-Rice code is the binary part.It is calculated according
to equation 4.1. The binary part is represented using minimum possible binary
bits. 0 in binary is represented by 0. So the binary part has a 0.
Now, the total codeword is formed by concatenating all the three parts of Golomb-
Rice code, so we get the codeword for 244 as 0000.
Case 4
The next pixel which is to be encoded, comes from case 4 category of image
template of Fig. 4.1. The current pixel value is 220. The reference pixels to this
current pixel are the pixels to the left and top of current pixel. So we have 251
and 244 as reference pixels.
Figure 4.11: Pixels in Case 4
Since the current pixel is less than lower reference pixel L, it is regarded as
out of range and hence it is encoded using Golomb-Rice coding.Golomb-Rice code
has three parts. In rst part there are two bits, rst bit is always 0 to indicate
that the current pixel is encoded using Golomb-Rice coding. The second bit is
to indicate whether the current pixel is above range or below range. Now here
since the current pixel is below range, the second bit will be 0. So, rst part of
Golomb-Rice code consists of 00.
The unary part is calculated according to equation 4.1. Here the value of residual
Department of Electronics, Walchand College of Engineering, Sangli 27
4.6 General Example of Coding
is x = L P 1 = 244 220 1 = 23, for this the unary number will be 5. So
the unary part has a 111110.
The third part of Golomb-Rice code is the binary part.The binary number will be
3, it is represented by 11. So the binary part has a 11.
Now, the total codeword is formed by concatenating all the three parts of Golomb-
Rice code, so we get the codeword for 220 as 0011111011.
Similarly, the remaining pixels are also encoded and their codewords along
with the length of each codeword is also sent to the decoder for reconstruction of
compressed image. The Table 4.1 shows the pixels from the image matrix and the
corresponding codeword for that particular pixel.
Table 4.1: Pixels and corresponding Codewords
Pixel Codeword
254 11111110
251 11111011
245 001001
220 00111111000
244 001010
220 0011111011
244 110100
200 001111011
250 011001
210 0011001
220 1111
238 011111001
200 0011001
222 0111011
219 0000
180 00111111111010
Department of Electronics, Walchand College of Engineering, Sangli 28
Chapter 5
2D-DWT - FELICS Algorithm
The proposed technique for image compression uses two techniques, rst , 2D-
DWT which provides lossy image compression and second, FELICS algorithm
which provides lossless image compression. As discussed in chapter 3, the wavelet
decomposition is done using haar wavelet. The level of decomposition depends
on the desired image compression ratio or image quality. Higher the level of
decomposition, higher is the compression, and poorer is the image quality. The
lossless FELICS algorithm uses adjusted binary codes and Golomb-Rice codes for
compression as discussed in chapter 4. FELICS is a predictive coding algorithm.
It reduces the number of bits required for representing a pixel, by prediction. The
codewords generated by FELICS algorithm are of variable length. The minimum
codeword length is 2 bits and maximum codeword length can be as long as 30
bits.
The proposed technique has two main blocks an encoder and a decoder. The
encoder compresses the image using a 2D-DWT and encodes it losslessly , while
decoder decodes it losslessly and then reconstructed using 2D-IDWT.
5.1 Encoder of Proposed Technique
Figure 5.1: Block Diagram of Encoder
The encoder has two main blocks, rst a 2D-DWT and second, a FELICS
encoder as shown in Fig. 5.1.
29
5.1 Encoder of Proposed Technique
5.1.1 2D-DWT Block
The image which is to be compressed, is given as input to the 2D-DWT block.
The 2D-DWT block performs the DWT on the image and decomposes it in 4
bands, LL, LH, HL and HH. The LL band is called the approximate band, since
it has most of the information of the image. It is obtained by passing the image
through low pass lter. First, the image is ltered row-wise and then coloumn-
wise. After single level decomposition all the 4 bands obtained have exactly half
the dimensions of the original image. Out of these 4 bands only LL band is used
in the proposed technique and other bands are discarded i.e they are made zero.
Now input to the FELICS encoder is only LL band. Similarly , if we apply 2-level
or 3-level decomposition to the image, the dimensions of LL band go on reducing
accordingly. In the 2D-DWT block, the image which is to be compressed is given
as input.
Figure 5.2: Block Diagram of 2D-DWT Block
Suppose the input image has dimensions 512 512, then after 1-level decom-
position using haar wavelet, image will have four bands. Each band will have
dimensions of 256 256.
Now if further decomposition is required then only the LL block, i.e. approx-
imate band is used. This 256 256 block of LL band is again decomposed using
2D-DWT. This is called 2-level decomposition. Now the dimensions of LL band
after 2-level decomposition will be 128 128.
Generally, the wavelet decomposition upto 2-level is used. If we further de-
compose the image, the dimensions of LL block will get reduced but the quality
of image gets degraded drastically. So after 2-level decomposition, the LL band is
given as input to next block of FELICS encoder. Generally only upto 2-level de-
composition of image is prefered, unless using this technique for surveillance kind
of application, where only detection is required and not exact image. For 3-level
decomposition, the image compression increases drastically but at the same time
image quality gets poorer.
Department of Electronics, Walchand College of Engineering, Sangli 30
5.2 Decoder of Proposed Technique
5.1.2 FELICS Encoder
The LL band obtained after desired decomposition level from 2D-DWT block,
has both positive and negative decimal point values. So before applying FELICS
encoding procedure we have to rst round-o the values in LL band to the nearest
integers. Then use that matrix as original image matrix. Now the values from
this matrix are encoded according to four cases as shown in g 4.1.
Figure 5.3: Block Diagram of FELICS Encoder
The FELICS encoder further compresses the band in lossless manner. It applies
adjusted binary coding and Golomb-Rice coding to compress. After compression,
the generated codewords are sent to decoder along with the length of each code-
word, since the codewords are of variable length. So the output of encoder is
compressed image data which consists of codewords and their lengths.
5.2 Decoder of Proposed Technique
Figure 5.4: Block Diagram of Decoder
The decoder has two main blocks, rst a FELICS decoder and second a 2D-
IDWT block as shown in Fig. 5.4. The compressed image data from output of
encoder is given as input to decoder.
5.2.1 FELICS Decoder
Here in FELICS decoder, the codeword is taken from codewords le and its
corresponding length is taken from length le. After getting the codeword and
and its length, the reverse coding ow of FELICS is applied. The rst bit of
codeword indicates whether that current pixel is encoded using adjusted binary
code or Golomb-Rice code. If the rst bit is 1, then that pixel is encoded using
adjusted binary coding and if it is 0, pixel is encoded using Golomb-Rice coding.
Department of Electronics, Walchand College of Engineering, Sangli 31
5.2 Decoder of Proposed Technique
Figure 5.5: Block Diagram of FELICS Decoder
If the pixel is encoded using Golomb-Rice coding, then again we must know
whether the pixel is above range or below range. For that we have to check the
second bit of codeword.
Now if the second bit is 1, then that current pixel is above range i.e. it is
greater than the higher reference pixel H and if if the second bit is 0, then that
pixel is below range i.e. it is less than the smaller reference pixel L.
After that the binary and unary parts are obtained from codeword and the
corresponding residual is generated. Finally the pixel value ia calculated. For a
pixel below range we can calculate the actual pixel value as L1 residual and
for the above range, the pixel value is calculated as, residual + H + 1.
In this way the pixel values are reconstructed using FELICS decoder and whole
matrix is then given to the 2D-IDWT block.
5.2.2 2D-IDWT Block
In 2D-IDWT block, the actual image is reconstructed. The image matrix which
is formed by the FELICS decoder is actually the LL band which was formed after
2-level decomposition of image during encoding. The other bands i.e. LH, HL
and HH are considered to be zero. So the zero matrices of same dimensions as LL
band are appended to LL band as shown in g. . Then the total appended matrix
is given as input to 2D-IDWT block.
Figure 5.6: Block Diagram of 2D-IDWT Block
The image which is constructed, has dimensions equal to those of the appended
matrix which is given as input to 2D-IDWT block. The LL band obtained at the
output of FELICS decoder is given as input to 2D-IDWT block. In the 2D-DWT
block, LL band of higher level is reconstructed by considering other three bands
Department of Electronics, Walchand College of Engineering, Sangli 32
5.3 Modied Image Template
as zero. Finally, at the output of decoder, we get the reconstructed compressed
image.
5.3 Modied Image Template
The image template which is used in original FELICS algorithm has 4 cases
as shown in Fig.5.7 Case 1 is for rst two pixels of the left corner of the image.
Case 2 is for pixels in 1st row other than rst two pixels. Case 3 is for pixels at
the left edge of the image and Case 4 is for pixels which are not in rst row and
at the left edge of image.
Figure 5.7: Original prediction template used in FELICS
Figure 5.8: Modied prediction template used in FELICS
In the modied image template, as shown in Fig. 5.8, we have added one more
case in the template. The rst two cases are same as original template. In case 4
of original template, two reference pixels were used. But here in new template we
are using 4 pixels as reference pixels. The highest of four pixels is assigned to H
and lowest of the four pixels is assigned to L.
Department of Electronics, Walchand College of Engineering, Sangli 33
5.3 Modied Image Template
The case 5 was not included in original template. The case 5 is for pixel at
the right edge of the image. For a pixel at the right edge, three reference pixels
are taken and highest of those pixels is assigned to H and lowest is assigned to L.
The template is just used to decide the reference pixels. The encoding procedure
is same as in original FELICS algorithm.
Department of Electronics, Walchand College of Engineering, Sangli 34
Chapter 6
Results Analysis
6.1 Image Quality Parameters
For comparing the images obtained from the three techniques we have consid-
ered various image quality parameters such as Compression Ratio (CR), Mean
Square Error (MSE), Peak Signal to Noise Ratio (PSNR), Normalized Cross-
Correlation (NCC), Average Dierence (AD), Structural Content (SC) and Nor-
malized Absolute Error (NAE) [7]. Here for calculating various image quality pa-
rameters original image matrix and compressed image matrix are used. I
1
(m, n)
indicates an element of original image matrix and I
2
(m, n) indicates an element
from compressed image matrix. Also M and N indicate the number of rows and
columns of image matrix. For calculating the image quality parameters the di-
mensions of original and compressed images must be same.
1. Compression Ratio (CR)
The compression ratio is calculated as the ratio of the le size of original
image to le size of reconstructed image.
CR =
Original image le size
Compressed image le size
(6.1)
Higher value of compression ratio indicates that the reconstructed image is
more compressed. As the compression ratio increases the quality of image
degrades.
2. Mean Square Error (MSE)
The Mean Square Error is dened as,
MSE =
M,N
[I
1
(m, n) I
2
(m, n)]
2
M N
(6.2)
The large value of MSE indicates that image is of poor quality.
35
6.1 Image Quality Parameters
3. Peak-Signal to Noise Ratio (PSNR)
Peak Signal to Noise Ratio (PSNR) is dened as,
PSNR = 10 log
10
(
255
2
MSE
) (6.3)
PSNR should be as high as possible, low value of PSNR means the image
quality is poor.
4. Normalized Cross-Correlation (NCC)
Normalized Cross-Correlation (NCC) is dened as,
NCC =
M,N
[I
1
(m, n). I
2
(m, n)]
M,N
[I
1
(m, n). I
1
(m, n)]
(6.4)
Value of NCC close to 1, means the image quality is good.
5. Structural Content (SC)
Structural Content is dened as,
SC =
M,N
[I
1
(m, n). I
1
(m, n)]
M,N
[I
2
(m, n). I
2
(m, n)]
(6.5)
The large value of Structural Content (SC) means that image is of poor
quality.
6. Average Dierence (AD)
Average Dierence is dened as,
AD =
M,N
[I
1
(m, n) I
2
(m, n)]
M N
(6.6)
The large value of AD means that the pixel values in the reconstructed image
are more deviated from actual pixel value. Larger value of AD indicates
image is of poor quality.
7. Normalized Absolute Error (NAE)
Normalized Absolute Error (NAE) is dened as,
NAE =
M,N
[abs(I
1
(m, n) I
2
(m, n))]
M,N
I
1
(m, n)
(6.7)
Value of NAE close to 0, means the image is of good quality.
Department of Electronics, Walchand College of Engineering, Sangli 36
6.2 Results
6.2 Results
Here, a same image is compressed by three dierent image compression tech-
niques. First technique consists of FELICS algorithm, second technique consists
of JPEG. The third technique is the proposed technique which consists of the
DWT technique followed by the FELICS algorithm. This third technique has two
variants, rst is having 2-level 2D-DWT and the second having 3-level 2D-DWT.
This experiment is carried out on dierent class of images these images are
taken from the website http://sipi.usc.edu/database and the performance of
these techniques is compared on the basis of various image quality measures such
as Compression Ratio (CR), Mean Square Error (MSE), Peak-Signal to Noise
Ratio (PSNR), Normalized Cross-Correlation (NCC), Average Dierence (AD),
Structural Content (SC) and Normalized Absolute Error (NAE).
Here, six dierent types of images are used. Standard images like Lenna, Ba-
boon, Bridge, Boat, Medical image and Satellite image are used for analysis. The
Lenna image contains a nice mixture of detail, at regions, shading, and texture
that do a good job of testing various image processing algorithms. The Baboon
image has details and texture information. The Bridge and Boat images have
mixture of detail, edges and shading. The Medical image has at regions and
minute edges.
Department of Electronics, Walchand College of Engineering, Sangli 37
6.2 Results
Figure 6.1: Lenna image compressed using (a) FELICS (b) JPEG (c) 2-level
DWT+FELICS (d) 3-level DWT+FELICS
Table 6.1: Results for Lenna image
Technique/
Parameter
FELICS JPEG 2-level
DWT+FELICS
3-level
DWT+FELICS
CR 1.72 11.13 14.8 33.38
MSE 0 17.16 132.26 279.806
PSNR 99 35.43 26.91 23.66
NCC 1 0.999 0.9947 0.9861
SC 1 1 1.003 1.012
AD 0 0.004 -0.3107 -0.2781
NAE 0 0.024 0.0509 0.0769
Department of Electronics, Walchand College of Engineering, Sangli 38
6.2 Results
Figure 6.2: Baboon image compressed using (a) FELICS (b) JPEG (c) 2-level
DWT+FELICS (d) 3-level DWT+FELICS
Table 6.2: Results for Baboon image
Technique/
Parameter
FELICS JPEG 2-level
DWT+FELICS
3-level
DWT+FELICS
CR 1.26 5.3 11.84 34.13
MSE 49.22 101.3 540.11 700
PSNR 31.2 27.17 20.8 19.679
NCC 0.9988 0.9971 0.9732 0.964
SC 0.9995 1.0001 1.0249 1.0352
AD 0.0017 -0.0113 -0.3108 -0.2707
NAE 0.0414 0.0581 0.1268 0.1484
Department of Electronics, Walchand College of Engineering, Sangli 39
6.2 Results
Figure 6.3: Bridge image compressed using (a) FELICS (b) JPEG (c) 2-level
DWT+FELICS (d) 3-level DWT+FELICS
Table 6.3: Results for Bridge image
Technique/
Parameter
FELICS JPEG 2-level
DWT+FELICS
3-level
DWT+FELICS
CR 1.37 5.8 12.22 32.6
MSE 0 72.23 358.26 609.02
PSNR 99 29.54 22.27 20.28
NCC 1 0.996 0.9772 0.9629
SC 1 1.001 1.0217 1.0371
AD 0 0.0085 -0.2048 -0.1682
NAE 0 0.054 0.1192 0.1558
Department of Electronics, Walchand College of Engineering, Sangli 40
6.2 Results
Figure 6.4: Boat image compressed using (a) FELICS (b) JPEG (c) 2-level
DWT+FELICS (d) 3-level DWT+FELICS
Table 6.4: Results for Boat image
Technique/
Parameter
FELICS JPEG 2-level
DWT+FELICS
3-level
DWT+FELICS
CR 1.55 8.67 14.51 35.43
MSE 0 29.07 225.593 406.35
PSNR 99 33.49 24.59 22.041
NCC 1 0.9989 0.9902 0.9805
SC 1 1 1.0076 1.0177
AD 0 0.0097 -0.311 -0.2856
NAE 0 0.031 0.06885 0.096
Department of Electronics, Walchand College of Engineering, Sangli 41
6.2 Results
Figure 6.5: Medical image compressed using (a) FELICS (b) JPEG (c) 2-level
DWT+FELICS (d) 3-level DWT+FELICS
Table 6.5: Results for Medical image
Technique/
Parameter
FELICS JPEG 2-level
DWT+FELICS
3-level
DWT+FELICS
CR 2.32 18.19 21.09 52.84
MSE 1.44 2.82 73.006 130.17
PSNR 46.53 43.62 29.49 26.98
NCC 1.0003 0.9995 0.9976 0.9974
SC 0.9993 1 1.0027 1.0016
AD -0.059 0.0685 0.3802 0.1901
NAE 0.0044 0.0064 0.0318 0.039
Department of Electronics, Walchand College of Engineering, Sangli 42
6.2 Results
Figure 6.6: Satellite image compressed using (a) FELICS (b) JPEG (c) 2-level
DWT+FELICS (d) 3-level DWT+FELICS
Table 6.6: Results for Satellite image
Technique/
Parameter
FELICS JPEG 2-level
DWT+FELICS
3-level
DWT+FELICS
CR 0.99 3.52 12.145 33.61
MSE 0.2144 302.787 1002.5 1134.34
PSNR 54.8185 23.31 18.119 17.58
NCC 1 1.0078 0.99293 0.9202
SC 0.99 0.96 1.0796 1.0905
AD -0.005 -0.15 1.0369 0.9991
NAE 0.0004 0.1147 0.198 0.2313
Department of Electronics, Walchand College of Engineering, Sangli 43
Chapter 7
Conclusion and Future Scope
7.1 Conclusion
The 2D-DWT (lossy technique) and FELICS (lossless technique) are used to
develop the proposed technique which provides high compression ratio, while main-
taining considerable image quality. Since 2D-DWT is a lossy technique, it provides
high compression ratio with some loss in image quality. At the same time, since
FELICS is a lossless technique it provides small compression ratio but maintains
the image quality. Thus using this technique which is a combination of lossy
and lossless techniques, we can get high compression ratio which is desired for
surveillance kind of applications.
Dierent parameters are used for comparison of images produced by dierent
techniques. We have considered seven dierent parameters like CR, MSE, PSNR,
NCC, SC, AD and NAE for dierent Class of Images (COI). We have included
images like Lenna, Boat, Baboon, Bridge, Medical image and Satellite image as
dierent Class of Images. The compression ratio for all these images is higher
for DWT+FELICS technique than for JPEG. All the image parameter values are
within acceptable range for DWT+FELICS technique. For Baboon, Medical and
Satellite image, even the FELICS algorithm cannot reconstruct the image without
loss. Particularly, for Satellite image, using original FELICS algorithm, the image
was not compressible instead it was expanding with CR of 0.99. So after using
the new modied image template, the FELICS algorithm was able to compress
Satellite image with CR of 1.15. So the new image template will denitely increase
the CR by small amount.
44
7.2 Future Scope
7.2 Future Scope
The technique using 2D-DWT and FELICS gives gives better compression
ratios than other techniques. But the quality of image and compression ratio
can be further improved by employing encoding techniques like Human encoding
or Arithmetic encoding. These encoding techniques are lossless, so using these
techniques can improve compression ratio at the same time the image quality is
maintained.
Department of Electronics, Walchand College of Engineering, Sangli 45
References
[1] Information Technology-Digital Compression and Coding of Continuous-Tone
Still Image, ISO/IEC 10918-1 and ITU-T Recommendation T.81, 1994.
[2] JPEG 2000 Part 1 Final Draft International Standard, ISO/IEC FDIS15444-1,
Dec. 2000.
[3] P.-C. Tseng, Y.-C. Chang, Y.-W. Huang, H.-C. Fang, C.-T. Huang, and L.-G.
Chen, Advances in hardware architectures for image and video coding-a survey,
Proc. IEEE, vol. 93, no. 1, pp. 184197, Jan. 2005.
[4] D. Human, A method for the construction of minimum redundancy codes,
Proc. IRE, vol. 140, pp. 10981011, Sep. 1952.
[5] T.Welsh, A technique for high-performance data compression IEEE Comput.,
vol. 17, no. 6, pp. 810, Jun. 1984.
[6] P. G. Howard and J. S. Vitter, Fast and Ecient lossless image compres-
sion,Proc. IEEE Int. Conf. Data Compression, 1993, pp. 501510.
[7] X. Wu and N. D. Memon, Context-based, adaptive, lossless image coding,
IEEE Trans. Commun., vol. 45, no. 4, pp. 437444, Apr. 1997.
[8] M. J. Weinberger, G. Seroussi, and G. Sapiro, The LOCO-I lossless image
compression algorithm: Principles and standardization into JPEG-LS , IEEE
Trans. Image Process., vol. 9, no. 8, pp. 13091324, Aug. 2000.
[9] Yi-Qiang Hu, Hung-Hseng Hsu and Bing-Fei WuAn, Integrated Method to Im-
age Compression Using the Discrete Wavelet Transform, IEEE International
Symposium on Circuits and Systems, June 9-12, 1997, Hong Kong.
[10] Tsung-Han Tsai, Yu-Hsuan Lee, and Yu-Yu Lee, Design and Analysis of High-
Throughput Lossless Image Compression Engine using VLSI-Oriented FELICS
Algorithm, IEEE trans. on VLSI Systems, Vol. 18, No.1, January 2010.
[11] Vellaiappan Elamaran and Angam Praveen, Comparison of DCT and
Wavelets in Image coding, 2012 International Conference on Computer Com-
munication and Informatics (ICCCI -2012), Jan. 10 12, 2012, Coimbatore,
INDIA.
46
REFERENCES
[12] V.S.Vora, Prof.A.C.Suthar, Y.N.Makwana, and S.J. Davda Analysis of Com-
pressed Image Quality Assessments, Published in International Journal of Ad-
vanced Engineering and Application, Jan. 2010.
Books:
1. Rafael Gonzalez, Richard E. Woods, Digital Image Processing, Pearson
Education, India (2002).
Department of Electronics, Walchand College of Engineering, Sangli 47
REFERENCES
Department of Electronics, Walchand College of Engineering, Sangli 48
Publication
49