Novel image compression method using edge-
oriented classifier and novel predictive noiseless
coding method
C.-H. Lee L.-H.Chen
Abstract: A iiew image compression approuch is
proposed in hich variable block sire techniqiie is adopted . ti si 11 g cl ti ad t rcc decom pssi t io ti. for
coding images at Ion, bil rates. In the proposed
;I p proiich
.
LI s u a 1 l y occiip) large :ireas in ; i n image. were coded with ii larger block \i7c and the block mean is used to represent each pixel i n the block. T o pi-cscrvc edge i i i t egri t ,L.
t lie cI assi fied vector cl i i a 11 t i s a t ion( C ' V Q ) tcchniqtic is L i d t o code high-activity regions. A new edge-oriented classificr without emploq ing an! thresholds is proposed for edge clas\ilic;ition. A novel predictive noiseless coding
(NI"(') method \+hicl1 exploits the redundancy
bet \veeii neigh bo uri ng blocks is also presented t o ellicicnllq code 111e ine;in values of' low-activity blocks a n d the addresses of edge blocks. The bit rates reqiiired I'or coding the mean val~tes and addresses caii be signillcantly rediiced by the p r o po\ed N P N met hod. Ex peri men t a I res til t s show t h a t cxccllent reconstructed images and
highei- P S N K \vcrc obt;iincti.
I o u -;IC t i vi t y 1-egi on s. w h ich
1 Introduction
of training vectors. This algorithm is ii codebook
i m provemen t procedure t li ;i t i t c m t i vel y i i i i 11 i i i i i se5 the o v era I I d ist o 1-1 ion o 1' repi-cscn t i ng t he t r;i i n i ng vectors
b y their col-responding codcuords.
Direct application 01' V Q to image coding h a s a verq si i i i pl c h ;I rd w ;I re s t I- uc t ti re. es pec i :I 1 I
>
t he decod er. N ev- ertheless. due t o high comput~itional complexity. most of the V Q techniques encode small and fixed s i x blocks throughout the coding proces\. The compression ratio is thus limited. To solve this problem. kariable block siLe image coding tecliniq~~es [ S 91. using the quadtrcc decomposition method [ I O ] . have been adopted t o further rediice the bit rates. The qLiiidtree decomposition technique is attractiLc Ibr low bit-rate image compression. since i t LIXS I'ewer bits to code low- activity regions mhich iisually occup)' large iirc;is in an Image.Edges are very important t o human observer in the perccp t ion of' i magc q ual i t y . A It ti i, ugh edge block s occupy o n l y ;I small fraction of the image. the
I-cconstructeci image quality will be \cry annoq'ing i f the
edge blocks are n o t coded accurately. M a n y researcher\ have exploited the edge inl'oi-mation l b r iniageivideo coding [ I 1. 121. Conventional VQ siil.lkrs I'roni the edge
degradation problem because the measure criterion
M S E for searching the closest codeword does not preserve the edge inforniation accurately. Therefore. m a n y \uriant classitled V Q (C'VQ) techniques [ 13-21] h a w been developed t o w l v c the poor edge reproduction problem. A C'VQ coder consists o f ;I
classifier and separate subcodebooks. Each vector is cl ;I ss i I'i e r , Se pa r ~ i t e s 11 bcod c bo o k s i b e re d cs i g ned Ih r
each o f the cI:isses. Subcodebook\ \\ere dc\igncci
i nde pen den t I y by t he L BC; ;I Igori t h i i i [3]. using t ra i t i i ng vectors belonging o n l y to the appropriate cl:iss. In C'VQ. a p a r t from well edge i-ePi-('diictioii. the computational complexity can also be rcdiiced since
o n l y o n e appropriate subcociehooh has to be searched Ibt- the closest codcwoid to each input \'ector.
However. the design of a n edge-oriented classilier based on edge detection in the spatial domain is n o t ;I simple task. i t is iisiially necessary t o employ se\er;il thresholds in the gradient comparison process. T ~ L I S .
some CVQs in the traiisfo~-m domain have been proposed [ 19- 2 I]. A good energy-compaction propert) c;i ti be o b t ;I i ned in t he t r;i n sl'orni doni ii i n . There fore.
the classification in the traiisl'orii~ domain. i n M hich ;I few transform coefficients are used ;IS edge orientation and location features. is rclati\oly simpler t h a n t h a t in the spatia I d 0111 ai n . H o weve r, the c I a s s i ti c;i t i o n c ] . l . ' s s i .'f' led i n t o one 01' the appropriate classes by ;I
complexity in transform domain is higher than that in spatial domain.
To achieve high compression ratios and preserve edge integrity, a new image compression approach will be proposed in this paper. Each vector will be decomposed into one of the variable block sizes depending on its activity. Low-activity blocks will be coded with larger block sizes while high-activity blocks with small block sizes. For a low-activity block, the mean value is used to represent each pixel in the block. A high-activity block will be coded using a CVQ technique to preserve the edge integrity property. A
simple edge-oriented classifier in the spatial domain will be proposed for block classification. In addition, a novel predictive noiseless coding method is adopted to further reduce the number of bits required for transmitting or storing the mean values of low-activity bloclts and the addresses of edge blocks.
2 Proposed technique
In the proposed technique, variable block size technique is adopted for image compression. An image to be encoded is first divided into blocks of size 16 x 16 and then each block is further decomposed into blocks of sizes 8 x 8 and 4 x 4, using a quadtree decomposition technique, depending on the activity of the block. In the quadtree decomposition, each block is repeatedly divided into four equal quadrants if the variance of the block is above a predefined threshold T,. On the other hand, the decomposition process will stop if the variance of the block is below T,, this block is regarded as a low-activity block and all the pixels in the block will be represented by the block mean. The variance of an 1 x 1 block is given by
where xd is the grey value of the (i, j)th pixel in the block and p is the block mean. In this paper, the block mean has been uniformly scalar quantised. If the small- est block size 4 x 4 is reached and its variance is above the threshold T,, it is regarded as a high-activity block. An edge-oriented classifier is then provided to classify the high-activity block into one of the four edge classes: horizontal, vertical and two diagonal edges (45" and 135"), depending on its edge orientation. The pro- posed classifier will be described in the next Section. After block classification, this block will then be encoded by the subcodebook specifically designed for the class it belongs to. These edge codebooks are designed independently by the LBG algorithm [4] using training vectors belonging only to the appropriate class. The search algorithm adopted here is the mean- pyramid method [22] which can greatly reduce the com- putation time in codebook design as well as encoding phases. The mean-pyramid method uses the mean pyra- mids of codewords to reject many codewords which are definitely not candidates for the closest codeword to the input vector. This process starts from the top level down to the bottom level to gradually reject more and more codewords. Since a lot of codewords have been rejected, the search process can be sped up greatly.
In the proposed technique, the quadtree structure code is transmitted to the decoder as side information to convey the size and position of the decomposed blocks. Besides the quadtree structure code, the class 362
indexes and codeword addresses of edge blocks and the mean values of low-activity blocks have to be transmitted to reconstruct the image. To further use the redundancy between neighbouring blocks, the mean values of low-activity blocks and the addresses of edge blocks will be efficiently coded using a novel predictive noiseless coding (NPNC)) method. This method will be described in Section 4. Since the pixels in each low- activity block are represented by the block mean, the blocking effect between the boundaries of two blocks occurs unavoidably. To remove the blocking effect, a simple smoothing filter is provided for low-activity blocks and will be described in Section 5. In the next Section, we will first describe the edge-oriented classifier design method in the spatial domain.
3 Edge-oriented classifier design
As mentioned previously, the classifier based on edge detection in the spatial domain [13] needs to employ several thresholds in the gradient comparison process. Nevertheless, it is difficult to determine these thresholds, CVQ in the transform domain have been proposed [19-211 to avoid this problem. However, the classification complexity in transform domain is higher than that in spatial domain. In this Section, a simple approach to block classification will be proposed. The classifier determines the class of an edge block, based
on the edge orientation, in the spatial domain and without employing any thresholds. All edge blocks are divided into four classes: horizontal, vertical and two diagonal edges (45" and 135"). This is done by convolving the edge block with the following four convolutional masks: -2 -1 1 2 -2 -1 1 2 -2 -1 1 2 mask 1 =
[
-2 -1 1 2]
r 2 2 2 2 L-2 -2 -2 -2 5 2 1 m a s k 3 =[
p
-1 -2''1
0 -1 -2 -5 r 0 1 251
As we can see from the four masks, these masks can determine the block shape. The absolute values of the four convolution results are defined as AC1, AC,, AC3
and AC4. These four values are used to determine the block class according to the following rules:
Rule I (class 1, vertical class): AC1 > AC2 and IAC, -
AC21
'
IAC3 - AC41,Rule 2 (class 2, horizontal class): AC2 > ACI and lAC2
Rule 3 (class 3, 45" diagonal class): AC3 > AC4 and
Rule 4 (class 4, 135" diagonal class): AC4 > AC3 and
- ACll > (AC3 - AC4(,
IAC3 - AC4I >
I
AC, - AC21, lAC4 - AC3I >I
AC1- AC2l4 Encoding of mean values and addresses
4. I Proposed novel noiseless coding method
l'hc basic idea 01' t h e proposcocl now1 n o i s e l e s s coding method is \ e r ) s i m p l e . Suppose \\e IiiiLc to t r a n s m i t ;I (/-bit hiliar! c o d c 101. c;ich n u m b c r . I I ' t h i s ntimhci. i s
\er! s m a l l . i t \\ill h a \ c ;I long rut1 length prcI.i\ iii
i t s h i n a i - 1 codc r e i ~ i ' e s e i i t a t i o i i . Thcrcl'orc. i t \ull~iccs t o
transmit t h e length / 01. t h e Os pi-cl'is anti t h e r c i i i a i n i i i g
( t l I I ) sul'l'i* h i t s . A n c\amplc \\otild h c binar! codc: 00000 IO I
length 01' Os prcl'i.\: S
stiITix: 01
2 d -1 0
,
the neighbouring blocks depending on the edge type of the current edge block. Variant edge types will use var- iant sets of neighbouring pixels to predict the mean val- ues and variances. Let
y,,
&,h, p.pUpd45, and ,upUpd135 be the predicted mean values for the vertical, horizontal, 45" diagonal and 135" diagonal edge blocks, respectively. Similarly, let o$, o&,, 0&45, and o&135 be the predicted variances.a b
t d
Fig.3
mean value
a Vertical edge block b Horizontal edge block
c 45" diagonal edge block d 135" diagonal edge block
Pixels of neighbouring blocks used to predict the current block
These values can be formulated as follows:
i = l - z=1
(6)
where the xis are the grey values of the previously decoded pixels bordering the current block as shown in Fig. 3. The mean difference between the predicted mean value pp and the mean value p, of codeword y, is defined as
P d ( 4 = P p - Pz
and the variance difference is defined as
Further, the predicted difference is defined as
For each codeword y,, the mean value difference pdi) and variance difference
odi)
between predicted values and actual values are calculated. The predicted differ- ence p d i ) is then calculated and the codebook is reor- dered in an non-decreasing order of pd(i). The address of the nearest codeword to the edge block is then found and coded by the proposed noiseless coding method.g d ( z ) g p - B,
p d ( i ) = P d ( i )
+
g d ( i )5 Smoothing algorithm
Since the pixels in each low-activity block are repre- sented by the block mean, the blocking effect between the boundaries of two blocks occurs unavoidably. To remove the blocking effect, a simple smoothing filter is provided. Since only low-activity blocks are smoothed, the high-activity blocks will not be blurred and edges will be preserved. The smoothing filter uses three vari- ous mask sizes (3 x 3, 5 x 5, and 9 x 9) for the post- processing of three different block sizes (4 x
4,
8 x 8,and 16 x 16). It adopts a simple average operation over the pixels in the area of the mask. The response of the smoothing operation is given by
( 7 )
z = l 3 = 1
where x' represents the smoothed grey value of the present pixel at which the centre of the mask is located,
xY denotes the grey level of (i, j)th pixel in the mask,
wY
denotes the weight of (i, j)th pixel defined as follows: 1 0 if zz3 E low-activity block if xz3 E high-activity block 1 1
i
WZJ = andw
=CXWz3
2=13=1With the above operation, the grey level of each pixel in low-activity blocks only changes slightly and is not affected by any edge pixels.
6 Experimental results
The performance of the proposed method has been evaluated on several images. A training set of twelve 512 x 512 monochrome images with 256 grey levels were used to generate edge codebooks. In codebook design phase, each image is divided into 4 x 4 blocks. Each block is then checked to see if it is a high-activity block. If a block is a high-activity block, it is further
Table 1: Comparison of classifiers
Codebook Lena Jet
Size Proposed classifier BTC classifier [I71 Proposed classifier BTC classifier I171
b p p PSNR b p p PSNR b p p PSNR b p p PSNR 64 0.201 30.70 0.216 30.47 0.207 29.56 0.219 29.27 128 0.212 31.20 0.231 31.08 0.220 30.23 0.237 29.98 256 0.228 31.69 0.247 31.59 0.237 30.80 0.254 30.57 512 0.244 32.12 0.264 31.98 0.254 31.12 0.271 31.07 1024 0.261 32.45 0.282 32.35 0.273 31.54 0.291 31.43
0 b
C d
e
classified i n t o one of the four edge types using the pro- robustness o f the proposed method. the two images re posed classilicr. Each edge codebook is designed inde- outside the training set.
pendently bl, the L B G algorithm using the blocks Table 1 compares the proposed classifier with the
\vhich belongs to the edge class ;is the training set. Two BTC‘ classifier proposed i n [I71 i n terms of the bit rates
512 x 517 images ( L e n a and l e t ) shown i n Fig. 4ri and (bpp) ;is well ;IS P S N R f o r the t u o test images. From
Fig. %/ were ~ised i n the simulations. To show the this Table. we can see the proposed classil’ier can
a
b
c d
e Fig. 5 Reconstructed images
a Original image Jet
b JPEG, 0.267 bpp, PSNR = 30.24
c VBSVQ, 0.261 bpp, PSNR = 30.30, codebook size 512
d Quadtree map
e Proposed method, 0.254 bpp, PSNR = 31.12, codebook size 512
achieve lower bit rates and higher PSNR than the BTC classifier proposed in [17].
Table 2 gives the composition of output bits for the two test images, including quadtree, mean value, classi- fication, and address bits.
The number of bits required to transmit or store the mean values of all blocks using the proposed NPNC method is compared with that using fixed length coding method, and Huffman coding method. Table 3 shows the comparison results with various codebook sizes as
well a s Lurioiis test images. From this Table. u c can see t h a t tlie bit rates arc significantly rediiced by the pro- posed NPNC‘ method. / 33 0
r
3 2 5 1 32 0I
Z ln 31 30.5tr
nThe number ol’ bits required t o transmit o r store the addresses of all edge blocks using the proposed NPNC‘ method is CO ni pa red wit 11 that using fixed I c ng t 11 cod i 11 g
Table 2: Composition of output bits
met hod. H 11 I’l’ma ti coding met h od. ;I ti d ;I w x i g e neighbouring pixels a s shown i n !- ig. 2 l o predict the niean a n d variance valiies of a n edgc block. Table 4
shams tlie comparison results \\. i t h \ ai-ioiis c o d e b o o h siies ;is well ;IS various test images. t - r o m this Table. we can sec that tlie required bit rates can be reduced b! the proposed N P N C method. This Table also she\\ s
t lis t t lie pro posed edge t y pe g 11 ided p r-ed ic t o r outperforms t h a t proposed in [ 2 3 ] . I t is \ + o r t h noting t h a t the occiit-t-ciice probabilit> 01. each mean \,slue that necdx to be ti-ansmitted t o the dccodci- is n o t inclLided i n Tables 3 ancl 4.
JI’EG. variable block siic V Q ( V H S V Q )
[ X I
arc used to CO in pa re with t 11 e p r o posed i m ;i ge cod i n g ni e t I1 oci , Fig. 6 shows the 1-clntionship 01’ tlic bit r:itca i n termso f bits per pixel ( b p p ) and peak signal-to-noise r a t i o ( P S N K ) for the encoded image Lena \ i i t h these three methods. Define the mean square e r r o r ( M S E ) ;IS m i 1 o C i . n e Ltver:tgc mctiloci llscs Ot’ tiie
I I / I
where is the original pixel g r q Ie\el and . I . ~ , is tlie reconstructed pixel grey level. M N is the total number
Codebook
size Test image
Lena Jet
Quadtree Mean Class Address Total Quadtree Mean Class Address Total
-~ 64 10684 12911 9030 20160 52785 10284 11804 9512 22589 54189 128 10684 12721 0930 23136 55571 10284 11695 9512 26117 57608 256 10684 12699 9030 27253 59666 10284 11562 9512 30648 62006 512 10684 12675 9030 31565 63936 10284 11483 9512 35246 66525 1024 10684 12568 9030 36157 68437 10284 11439 9512 40252 71487
Table 3: Comparison of the number of bits required t o code the mean values of all blocks
Test image Codebook
size Lena Jet
Fixed Huffman NPNC Fixed Huffman NPNC
64 22524 11249 12911 19278 10517 11804
128 22524 11056 12721 19278 10383 11695
256 22524 10986 12699 19278 10257 11 562
512 22524 10965 12657 19278 10160 11483
1024 22524 10838 12568 19278 10125 11439
Table 4: Comparison of the number of bits required to code the addresses of all edge blocks
Codebook Test image
Lena Jet
size
Fixed Huffman Average NPNC Fixed Huffman Average NPNC
64 27090 18092 22358 20160 28536 20816 23783 22589 128 31605 21791 25943 23136 33292 24809 27572 26117 256 36120 25558 30241 27253 38048 28834 32207 30684 512 40635 29493 34655 31565 42804 32895 37049 35246 1024 45150 33061 39270 36157 47560 36667 42140 40252 ~
of pixels in the image. The PSNR is then defined as
The reconstructed images are shown in Figs. 4 and 5. From these Figures, we can see that the reconstructed images of the proposed technique will have higher PSNR and better visual quality.
7 Conclusions
In this paper, a new image compression approach will be proposed. Variable block size technique is adopted, using quadtree decomposition, for coding images at low bit rates. In the proposed approach, low-activity regions which usually occupy large areas in an image were coded with a larger block size and the block mean is used to represent each pixel in the block. To preserve edge integrity, classified vector quantisation (CVQ) technique is used to code high-activity regions. A new edge-oriented classifier without employing any thresh- olds is proposed for edge classification. Simulation results show that the proposed classifier outperforms the BTC classifier proposed in [17]. In addition, a novel predictive noiseless coding (NPNC) method which exploits the redundancy between neighbouring blocks is also presented to efficiently code the mean values of low-activity blocks and the addresses of edge blocks. The bit rates required for coding the mean values and addresses can be significantly reduced by the proposed NPNC method. Experiment results show that excellent reconstructed images and higher PSNR have been obtained at low bit rates.
8 Acknowledgment
This research was supported in part by the National Science Council of R. 0. C. under contract NSC-84- 0404-EOOS-038.
9 References
1 NASRABADI, N.M., and KING, R.A.: ‘Image coding using vector quantization: a review’, ZEEE Trans., 1988, COW-36, (8), GERSHO, A., and GRAY, R.M.: ‘Vector quantization and sig- nal compression’ (Kluwer, Boston, 1992)
pp. 957-971 2
3 GRAY, R.M.: ‘Vector quantization’, ZEEE ASSP Mag., 1984, 1,
pp. 4-29
4 LINDE, Y., BUZO, A., and GRAY, R.M.: ‘An algorithm for vector quantizer design’, ZEEE Trans., 1980, COh4-48, (1), pp. 8 4 9 5
5 NASRABADI, N.M., LIN, S E . , and FENG, Y.: ‘Interframe hierarchical vector quantization’, Opt. Eng., 1989, 28, (7), pp. 717-725
6 STROBACH, P.: ‘Quadtree-structured recursive plane decompo- sition coding of images’, ZEEE Trans., 1991, 39, (6), pp. 1380- 1397
7 BERGER, L., MARIOT, J.P., and LAUNAY, C.: ‘A new for- mulation for fast image coding using quadtree representation’,
Putt. Recog. Lett., 1992, 13, pp. 425432
8 VAISEY, J., and GERSHO, A.: ‘Image compression with varia- ble block size segmentation’, ZEEE Trans. Signal Process., 1992, 40, (S), pp. 2040-2060
9 LEE. M.H.. and GREBBIN. G.: ‘Classified vector auantization with’variable blocksize DCT’models’, ZEE Proc., Vis.’ Image Sig-
nal Process., 1994, 141, (l), pp. 3 9 4 8
10 SAMET, H.: ‘The quad-tree and related hierarchical data struc- tures’, A C M Comnut. Surv., 1984, 16, (2), DP. 188-260
11 ERYURTLU, F.,A KONDOZ, A.M., and EVANS, B.G.: ‘A sub- band image coding algorithm using vector quantization’. Proceed- ings of the IEEE international symposium on Multimedia technol-
ogies, Southampton, UK, 1993
12 MOHSENIAN, N., and NASRABADI, N.M.: ‘Edge-based sub- band VQ techniques for images and video’, ZEEE Trans. Circuits
Syst. Video Technol., 1994, 4, (I), pp. 53-67
13 RAMAMURTHI, B., and GERSHO, A.: ‘Classified vector quantization of images’, IEEE Trans., 1986, COM434, (ll), pp. 1105-1 115
14 KUBRICK, A., and ELLIS, T.: ‘Classified vector quantization of images: codebook design algorithms’, IEE Proc. Z, Commun.
Speech Vis., 1990, 137, (6), pp. 379-386
15 PO, L.M., and CHAN, C.K.: ‘Directionally classified image vec- tor quantization using Walsh Hadamard subspace distortion’,
Electron. Lett., 1991, 27, (21), pp. 1964-1967
16 NGAN, K.N., and KOH, H.C.: ‘Predictive classified vector quantization’, ZEEE Trans. Image Process., 1992, 1, (3), pp. 269- 280
17 LO, K.L., and CHAM, W.K.: ‘New predictive classified vector quantization scheme for image compression’, Electron. Lett., 18 ABBAS, H.M., and FAHMY, M.M.: ‘Classified vector quantiza- tion using variance classifier and maximum likelihood clustering’,
Pattern Recognit. Lett., 1994, 15, pp. 49-55
19 KIM, D.S., and LEE, S.U.: ‘Image vector quantizer based on a classification in the DCT domain’, ZEEE Trans. Commun., 1991, 39, (4), pp. 549-556
20 KIM, J.W., and LEE, S.U.: ‘A transform domain classified vec- tor quantizer for image coding’, IEEE Trans. Circuits Syst. Video
Technol., 1992, (l), pp. 3-14
21 HWANG. C.. VENKATRAMAN. S.. and RAO. K.R.: ‘Human 1994,30, (16), pp. 1280-1282
visual system weighted progress& ’image transmission using lapped orthogonal transformiclassified vector quantization’, Opt.
Eng., 1993, 32, (7), pp. 15241530
22 LEE, C.H., and CHEN, L.H.: ‘A fast search algorithm for vector quantization using mean pyramids of codewords’, ZEEE Trans.
Commun., 1995, 43, (2/3/4), pp. 1697-1702
23 NASRABADI. N.M., and FENG. Y.: ‘Image comoression using address vector’ quantization’, IEEE Trans. -Comnhn., 1990, 38:
(12), pp. 2166-2173