You are on page 1of 4

AN INVERTIBLE TRANSFORM FOR IMAGE REPRESENTATION AND ITS

APPLICATION TO IMAGE COMPRESSION


Rajesh Cherian Roy, M. S. Anish Kumar, R. Gopikakumari
School of Engineering,
Cochin University of Science and Technology,
Kochi, Kerala, India
ABSTRACT
M-Dimensional Real Transform(MRT) is an alternate rep-
resentation of a signal which is derived from the equa-
tion for computation of the Discrete Fourier Transform
(DFT). The raw MRT representation has redundant el-
ements which makes it unsuitable for use in situations
where memory usage needs to be minimized. This pa-
per presents a procedure to obtain a lean MRT representa-
tion of an image. The lean MRT coefcients are unique,
numerically compact and require only the same memory
space as required for the original image. Each MRT co-
efcient is formed by unique, linear, multiplication-less
combinations of image data and thus has spatial signi-
cance. The inverse transformation to obtain the original
signal from the lean MRT is also presented. The inverse
transform involves only additions and subtractions. The
lean MRT representation is applied to a few images and
the resulting coefcients quantized. The performance of
this approach to obtain compression is studied, and the re-
sults obtained are presented. It is seen that the proposed
lean MRT representation can be used effectively to com-
press images.
1. INTRODUCTION
Frequency domain analysis is often important in extract-
ing vital information from a signal. There are a variety
of frequency domain transformations in use, like the Dis-
crete Fourier Transform (DFT), Discrete Cosine Trans-
form (DCT) etc. In general, transforms are formed by the
inner product of the image data and basis elements of the
transform kernels. Integer versions of various transforms
have been studied in [1],[2]. Integer transforms serve to
simplify the transformprocess by eliminating oating point
arithmetic. Thus integer-based transforms are preferable
when complexity is to be avoided. In transforms formed
from trigonometric functions, the basis elements exhibit
symmetries which result in the linear combination of im-
age data in particular orders. No multiplication is involved
in these combinations, thus ensuring simplicity in case
these were to be used to represent the image. The trans-
formation can then be seen in this light to be inner prod-
ucts of these combinations and unique basis elements. The
values of these linear combinations thus form another rep-
resentation of the image. M-dimensional Real Transform
(MRT) is a representation for the linear combinations of
image coefcients when the frequency transform in ques-
tion is the Discrete Fourier Transform (DFT)[3]. MRT,
in the raw form contains signicant redundancy. A nor-
malized representation of the MRT with all redundancies
eliminated is presented in this paper. Also presented is an
algorithm to obtain this normalized representation of the
MRT, and an algorithm to compute the inverse MRT. In
[4] MRT has been applied to image compression on the
basis of applying a threshold to the raw unique MRT co-
efcients and storing positions and values of coefcients
greater than the threshold. In this paper, all the normal-
ized MRT coefcients are divided by a quantization ma-
trix, scanned and encoded using Huffman encoding.
2. LEAN MRT VECTOR
2.1. Unique Coefcients
The MRT coefcients [3] of an image block x of size N
N are given by
X(k
1
, k
2
, p) =

z=p
x(n
1
, n
2
)

z=p+N/2
x(n
1
, n
2
)
(1)
z =< n
1
k
1
+ n
2
k
2
>
N
(2)
k
1
= 0, 1..N 1, k
2
= 0, 1..N 1, p = 0, 1..N/2 1
As pointed out in [3], the raw MRT signal has a con-
siderable amount of redundancy. For a two-dimensional
signal of size (N,N), the total number of MRT coefcients
is N
3
/2, from N/2 MRT matrices of size (N,N). How-
ever, only N
2
coefcients are unique. Hence, in order to
save memory space and make it simpler to use, it is nec-
essary to eliminate the redundancy in the MRT vector and
retain only the unique coefcients so that a lean MRT rep-
resentation is obtained. In the following discussion, N is
assumed to be a power of 2
MRT coefcients are unique for certain values of k
1
and k
2
: for k
2
= 0 and all powers of 2 upto and including
N/2 and all or certain values for k
1
fromamong 0,1,2,3..N-
1 depending on the value of p. Thus it is sufcient to com-
pute the MRT coefcients for these specic values of k
1
,
k
2
and p. The values of k
1
, k
2
and p which yield unique
MRT coefcients for an image block of size 8 8 are
shown in Fig. 1.
1-4244-0779-6/07/$20.00 2007 IEEE
k
1
k
2
p
0,4 0 0
1 0 0,1,2,3
2 0 0,2
0,1,2,3,4,5,6,7 1 0,1,2,3
0,2,4,6 2 0,2
1,3 2 0,1,2,3
0,4 4 0
1 4 0,1,2,3
2 4 0,2
Fig. 1. Values of k
1
, k
2
, p which form unique MRT coef-
cients for an 8 8 image block.
Given a block of size N N, there are N
2
unique
MRT coefcients. N coefcients are contributed by a
value of k
2
= 0 and N coefcients by k
2
= N/2. For
k
2
= 1, each value of k
1
= 0, 1, 2, 3..N 1 forms N/2
unique coefcients, one for each value of p = 0, 1, 2..N/2
1. Thus, there are N
2
/2 coefcients formed from combi-
nations of k
1
, k
2
and p when k
2
= 1. In general, N
2
/2k
unique coefcients are formed from combinations of k
1
,
k
2
and p when k
2
= k. Thus, an N N matrix can be
formed by computing only the unique MRT coefcients.
After the unique coefcients have been computed, they are
then normalized by dividing each coefcient by the num-
ber of image data which are involved in the computation
of the MRT coefcient. The matrix of MRT coefcients
thus obtained may be called a lean MRT matrix. This nor-
malization makes the MRT coefcients numerically more
compact, and the inverse MRT operation becomes sim-
pler because the original image data can be obtained by
simple additions and subtractions of these normalized co-
efcients.
2.2. Algorithm
The algorithmto compute the coefcients of the lean MRT
of an image block of size N N is as follows:
Initialize y
1
(N, log
2
N, N/2) = 0,y(N, N) = 0,
k = [0, 1, 2, 4, 8, ..N/2],q = [1, 2, 4..N/4],i = 1
For j
2
= 0 to log
2
N, step log
2
N
For j
1
= 0 to log
2
N, step 1
For p = 0 to N/2 1, step 1
include = 0, count = 0
For n
1
= 0 to N 1, step 1
For n
2
= 0 to N 1, step 1
z =< n
1
k(j
1
) + n
2
k(j
2
) >
N
If z = p
include = 1, count = count + 1
y
1
(k(j
1
), j
2
, p) = y
1
(k(j
1
), j
2
, p) + A(n
1
, n
2
)
elseif z = p + N/2
include = 1, count = count + 1
y
1
(k(j
1
), j
2
, p) = y
1
(k(j
1
), j
2
, p) A(n
1
, n
2
)
If include = 1
i
1
= round((i 1)/N), i
2
= i i
1
(N 1)
y(i
1
, i
2
) = y
1
(k(j
1
), j
2
, p)
k
1index
(i
1
, i
2
) = k(j
1
)
k
2index
(i
1
, i
2
) = k(j
2
), p
index
(i
1
, i
2
) = p
000 100 101 102 103 200 202 400
040 140 141 142 143 240 242 440
010 011 012 013 110 111 112 113
210 211 212 213 310 311 312 313
410 411 412 413 510 511 512 513
610 611 612 613 710 711 712 713
020 022 120 121 122 123 220 222
320 321 322 323 420 422 620 622
Fig. 2. Positional details of 8 8 MRT matrix. 000
means that the MRT coefcient at that position is formed
from values of k
1
= 0, k
2
= 0, p = 0, and similarly for
the other entries .
elementcount(i
1
, i
2
) = count
i = i + 1
For j
2
= 0 to log
2
N 2, step 1
maxrange = log
2
q(j
2
), bottomofrange = 0
For numberofranges = 0 to maxrange, step 1
topofrange = N/(2
maxrangenumberofranges
),
k
1
step = 2
numberofranges
For k
1
= bottomofrange to
topofrange k
1
step, step k
1
step
For p = 0 to N/2 1, step 1
include = 0, count = 0
For n
1
= 0 to N 1, step 1
For n
2
= 0 to N 1, step 1
z =< n
1
k
1
+ n
2
q(j
2
) >
N
If z = p
include = 1, count = count + 1
y
1
(k
1
, j
2
, p) = y
1
(k
1
, j
2
, p) + A(n
1
, n
2
)
elseif z = p + N/2
include = 1, count = count + 1
y
1
(k
1
, j
2
, p) = y
1
(k
1
, j
2
, p) A(n
1
, n
2
)
If include = 1
i
1
= round((i 1)/N), i
2
= i i
1
(N 1)
y(i
1
, i
2
) = y
1
(k
1
, j
2
, p)
k
1index
(i
1
, i
2
) = k
1
k
2index
(i
1
, i
2
) = q(j
2
), p
index
(i
1
, i
2
) = p
elementcount(i
1
, i
2
) = count
i = i + 1
y(i
1
, i
2
) =
y(i
1
,i
2
)
elementcount(i
1
,i
2
)
Arrays p
index
, k
1index
, k
2index
and elementcount in
the algorithm are used in the computation algorithm for
inverse MRT. For a given block-size N, these arrays can
be pre-calculated and stored and used directly in both al-
gorithms. Fig. 2 shows the values of (k
1
, k
2
, p) for the
lean MRT matrix computed by applying the above algo-
rithm to an image block of size 8 8.
2.3. Signicance of MRT coefcients
Since MRT coefcients are formed from simple addition
and subtraction of image data, each unique MRT coef-
cient signies a particular manner of combination of im-
age data and thus a unique pattern in the image domain.
Thus, the N
2
MRT coefcients of an N N image block
are in fact strenth-indicators of N
2
different patterns in
+ 0 0 0 - 0 0 0
+ 0 0 0 - 0 0 0
+ 0 0 0 - 0 0 0
+ 0 0 0 - 0 0 0
+ 0 0 0 - 0 0 0
+ 0 0 0 - 0 0 0
+ 0 0 0 - 0 0 0
+ 0 0 0 - 0 0 0
Fig. 3. Combinational pattern in 8 8 image block for
MRT coefcient formed from k
1
= 0, k
2
= 1, p = 0
the image block. The MRT thus becomes a suitable tool
for image analysis to determine the existence of N
2
well-
dened patterns in an image. Fig. 3 shows the pattern
associated with the MRT coefcient for values of k
1
= 0,
k
2
= 1 and p = 0. The + sign indicates that the im-
age data at that position is an addend in the formation of
this MRT coefcient, and - denotes a subtrahend. 0 in-
dicates positions of image data that do not contribute to
the MRT coefcient. In image blocks with strong verti-
cal structure of the kind shown, this MRT coefcient will
have a signicant value. The N
2
patterns can be consid-
ered to be the basis vectors of the lean MRT. An important
consideration here is that the number of image data el-
ements which contribute to MRT coefcient formation is
not equal for all MRT coefcients. This number can range
from N
2
downward to binary fractions of N
2
. This factor
is used to perform the normalization of the MRT coef-
cient obtained from simple additions and subtractions of
the image data. If this division is not performed in the for-
ward transform, then it needs to be done while performing
the inverse MRT.
3. INVERSE TRANSFORM
The image data are obtained by the inverse MRT. Each co-
efcient is obtained by simple additions and subtractions
involving only those MRT coefcients in whose forma-
tion this image data has played a part. If an image domain
coefcient was an addend (or subtrahend) in forming an
MRT coefcient, then the same MRT coefcient will be
an addend (or subtrahend) in the inverse operation to ob-
tain the image data element.
The inverse transform is performed by the following
algorithm (y is the lean MRT matrix):
Initialize vector x with size (N, N)
For n
1
= 0 to N 1, step 1
For n
2
= 0 to N 1, step 1
For i
1
= 0 to N 1, step 1
For i
2
= 0 to N 1, step 1
p = p
index
(i
1
, i
2
)
z =< n
1
k
1index
(i
1
, i
2
) + n
2
k
2index
(i
1
, i
2
) >
N
If z = p
x(n
1
, n
2
) = x(n
1
, n
2
) + y(i
1
, i
2
)
elseif z = p + N/2
x(n
1
, n
2
) = x(n
1
, n
2
) y(i
1
, i
2
)
52 55 61 66 70 61 64 73
63 59 66 90 109 85 69 72
62 59 68 113 144 104 66 73
63 58 71 122 154 106 70 69
67 61 68 104 126 88 68 70
79 65 60 70 77 68 58 75
85 71 64 59 55 61 65 83
87 79 69 68 65 76 78 94
(a)
76 -9 4 9 6 -2 -5 -2
-1 -1 0 0 1 0 0 0
-15 -9 -1 5 4 -6 -14 -13
-2 1 1 2 -1 -1 2 -2
-1 0 0 0 1 1 -1 1
-1 -1 -2 0 6 12 11 3
9 -5 -3 1 4 4 -1 -1
-5 5 -4 -1 -1 -1 -1 0
(b)
Fig. 4. (a) An 8 8 block of image data (b) Lean MRT
coefcients of the block after rounding
4. IMAGE COMPRESSION USING LEAN MRT
4.1. Motivation
The motivation for using a lean MRT representation for
image compression can be best explained by an example.
Fig. 4(a) shows an 8 8 image block. The rounded lean
MRT coefcients of the image block are shown in Fig.
4(b). It is seen that a few MRT coefcients have sig-
nicant magnitudes while most coefcients are of small
magnitudes. This scenario can be utilized for compress-
ing images by ne quantization of signicant coefcients
and coarse quantization of the remaining coefcients.
4.2. Method
The image to be compressed is rst divided into subim-
ages of size 8 8. The forward MRT is applied to each
subimage block. The MRT coefcients of each block is
then quantized. The quantization method applied here is
to divide all the MRT coefcients by a positive integer and
round off the result. For most image blocks, MRT coef-
cients at positions (0,0), (2,0), (2,1), (2,2), (2,3), (6,0) and
(6,2) in Fig. 2 have the greatest magnitudes owing to the
particular image block patterns they represent. (0,0) con-
tains the mean intensity of the image. The remaining coef-
cients cited above correspond to vertical structure which
is strong in most natural images. Hence these coefcients
are divided by half the quantization factor used to divide
all the other coefcients. Typical values for this quantiza-
tion factor lie in the range from 5 to 50. The coefcients at
(0,0), (2,0), (2,1), (2,2), (2,3), (6,0) and (6,2) are scanned
rst followed by the remaining coefcients in sequential
PSNR(dB)
0.25 0.50 0.75 1.0
Image bpp bpp bpp bpp
Lenna 28.34 31.54 33.72 35.55
Barbara 22.84 25.96 28.27 30.59
Mandrill 22.28 24.22 25.93 27.41
Goldhill 26.81 29.18 30.41 32.11
Cameraman 27.98 32.06 34.79 38.14
Fig. 5. Compression results obtained using lean MRT on
5 test images
order starting from the top row. Long runs of zeros will
result for each sub-block as a result of this scanning order.
The coefcient at (0,0) is a DC coefcient. Single-delay
DPCM differences are taken for DC coefcients. Combi-
nations of non-zero AC coefcients and zero run-lengths
are grouped. These are then coded using Huffman tables
specied in the sequential mode of the JPEG standard [5].
At the decoder, the compressed bitstream is decoded and
the coefcients are then re-arranged using the same scan-
ning order and multiplied by the same quantization matrix
used at the encoder. Next, inverse MRT is applied to each
block to obtain the reconstructed image.
5. RESULTS AND CONCLUSION
The results obtained when using lean MRT to compress
images is shown in Fig. 5. The test images used were
of size 512 512. The MRT method provides satisfctory
compression performance. Fig. 6(b) and 6(c) show the
Lenna image reconstructed at 0.5 bpp and 1.0 bpp re-
spectively. In [4], Lenna was compressed at 1.07 bpp
for a PSNR of 27.88 dB, and Cameraman at 0.91 bpp
for 28.91 dB. In this paper, a normalized representation of
MRT has been presented. This representation provides a
compact representation for image signals, with each co-
efcient conveying information about the strength of a
unique pattern in the image. Algorithms to compute unique
normalized MRT coefcients directly from an image sig-
nal (of size N N, N being a power of 2) and to compute
inverse MRT from normalized MRT coefcients have also
been presented. The lean MRT representation is compu-
tationally simple as it involves only additions and subtrac-
tions and no multiplications, except for division by a nor-
malizing factor. The inverse transform requires absolutely
no multiplication or division. The lean MRT has been ap-
plied to image compression satisfactorily. The quantiza-
tion and scanning strategies need to be studied in further
detail. The MRT has potential applications in pattern anal-
ysis and merits further investigation.
6. REFERENCES
[1] Wai-Kuen Cham and Percy Pui-Chiu Yip, Integer
sinusoidal transforms for image processing, Int. J.
Electronics, volume 70, no. 6, 1991, pp. 1015-1030.
(a) Original
(b) 0.5 bpp, 31.54 dB (c) 1 bpp, 35.55 dB
Fig. 6. Original and reconstructed images, Lenna
[2] Soo-Chang Pei and Jian-Jiun Ding, The inte-
ger transforms analogous to discrete trigonometric
transforms, IEEE Transactions on Signal Process-
ing, volume 48, no. 12, December 2006, pp. 3345-
3364.
[3] Rajesh Cherian Roy and R. Gopikakumari, A new
transform for 2-D signal representation (MRT) and
some of its properties, Proceedings of Interna-
tional Conference on Signal Processing & Commu-
nications, 2004, pp. 363-367.
[4] M. S. Anish Kumar, Rajesh Cherian Roy and R.
Gopikakumari, A new image compression and de-
compression technique based on 8x8 MRT, Inter-
national Journal on Graphics, Vision and Image Pro-
cessing, volume 6, no. 1, July 2006, pp. 51-53.
[5] William B. Pennebaker and J. L. Mitchell, JPEG
still image data compression standard, New York:
Van Nostrand Reinhold, 1993.

You might also like