Signal Processing 23 (1991) 1-14 Elsevier
1
Character generation and scaling through fast transform techniques Gregory N. Stainhaouer and George Carayannis Computer Science Division, Department of Electrical Engineering, National Technical University of Athens, Athens, Greece Received 3 January 1990 Revised 4 July 1990
Abstract. This paper focuses on the study of some key properties of transform coding techniques, for efficient object manipulation and reconstruction. Two-dimensional binary objects are considered and represented by their one-dimensional contour signals. The expression of these contours in the transform domain has several advantages: generation of the object without destroying the key shape features, easy smoothing and high quality scaling. These operations can be realized directly from the chain code, as proposed here by using fast techniques. The performance of two very popular transform techniques is compared with respect to the quality of the reconstructed object expressed with objective measures (SNR).
Zusammenfassung. Dieser Beitrag konzentriert sich auf die Untersuchung einiger Schlfissel-Eigenschaftenvon Verfahren zur Transformations-Kodierung, die fiir effiziente Manipulation und Rekonstruktion von Objekten geeignet sind. Zweidimensionale biniire Gegenstiinde werden fiber ihre eindimensionalen Konturensignale dargestellt und als dadurch hinreichend beschrieben erachtet. Die Darstellung dieser Konturen im Bildbereich der Transformation hat mehrere Vorteile: die Erzeugung des Objekts ist mi~glich, ohne die wesentlichen Merkmale der Form zu zerstfren und ebenso sind eine Gliittung und eine qualitativ hochwertige Gr6Jlenverfi'nderung leicht zu verwirklichen. Diese Operationen k6'nnen, wie hier vorgeschlagen, mit schnellen Verfahren direkt fiber den Kettenkode vorgenommen werden. Die Leistungsf'fihigkeit zweier sehr verbreiteter Transformationsverfahren wird im Hinblick auf die objektiv gemessene Qualitiit (SNR) des rekonstruierten Objektes verglichen. R6sum6. Cet article porte sur l'6tude d'un certain nombre de propri6t6s des techniques de transformation pour la manipulation et la reconstuction efficace des objects. Des objets binaires a deux dimensions sont consider6s et r6present6s par leur contours monodimensionels. L'expression de ces contours dans le domaine transform6, a comme cons6quence les possibilit6s suivantes: g6n6ration de l'objet sans destruction des caract6ristiques importantes de sa forme; le lissage et la mise en 6chelle, avec pr6servation de la qualit6 de l'objet, deviennent tr~s faciles. Des techniques rapides, pour r6aliser ces op6rations au d6part des signaux de contour sont aussi propos6es dans cet article. Les performances de deux techniques tr~s connues de transformation sont compar6es finalement, en ce qui concerne la qualit6 de I'objet reconstitu6, exprim6e par une mesure objective comme le rapport signal sur bruit.
Keywords. Contour, transform coding, DCT, DFT, character reconstruction.
1. Introduction
Several contour analysis methods [4, 12, 14, 15] are well-known from the literature and used efficiently for the description of the shape of objects found in bilevel images. At the lowest level these methods are based on a primitive representation such as chain code or differential chain code 0165-1684/91/$03.50 O 1991 - Elsevier Science Publishers B.V.
[13], while at a higher level the representation consists of an approximation by pieces of smooth curves or polygons [6, 16]. Here, another approach is used, where approximations in both the x and y directions of the contour of characters are considered by using the DFT and DCT, as described in the next sections. The advantage of this approach is due to the fact
2
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
that low dimensionality representations can be obtained, since exterior and interior contours of almost all the characters (of various fonts of the Roman alphabet) can be represented and regenerated by a few DFT or DCT coefficients. Several works on this subject can be found in [3, 5, 7, 8, 10, 18, 20], where Fourier descriptors are defined in different ways and distinguished by their invariance to affine shape transformations and to the shifts in the starting point. Here, an alternative approach is proposed as described in Sections 3 and 4, where the 'cosine descriptors' are also investigated. One of the objectives of this paper is to compare the two previously mentioned transforms of the contour sequences, with respect to character reconstruction. In an application, such as character reconstruction from a small number of transform coefficients, a criterion is necessary to measure the quality of the coded signal. The truly measures are perceptual ones, and can be obtained by careful subjective experimentation. However, in other applications, such as speech or image coding, a standard objective measure of coded waveform quality is used. This is the ratio of the signal variance to the reconstruction error variance, known also as signal-tonoise ratio (SNR). SNR, as described in Section 3, is proposed as a measure for the particular application which we are dealing with, and invoked in this paper in an attempt to make this quantity subjectively meaningful. Based on the results of this study, an algorithm for character reconstruction is presented. In this algorithm, the information reduction achieved after contour signal transformation in the frequency domain is used for character generation without destroying the key shape features. Furthermore, an efficient scaling algorithm for characters with variable magnification (reduction) factors, based on transform coding, is proposed. The algorithm can be used in applications, such as phototypesetting, where high quality characters are required. Another objective of this paper is the fast calcuSignal Processing
lation of the DFT or DCT coefficients. A variety of fast algorithms for the computation of the DFT and DCT coefficients can be found in the literature. The DFT coefficients of the contour sequences may also be calculated directly from the chain code, as discussed in [8]. Here, a more efficient algorithm for the computation of the D F F and DCT coefficients of the contour sequences is proposed. The paper is organized as follows. In Section 2 the properties of contour sequences are briefly presented. DFT and DCT representations of contour are also introduced. Furthermore, a new algorithm for the fast computation of the Fourier and cosine descriptors is proposed. The third section is concerned with the reconstruction of the characters after coefficient selection in the transform domain. Several figures and SNR curves are illustrated, in order to understand which is the 'parsimonious' number of coefficients associated with the transform coding of the character contours. Such a number represents the character efficiently and economically without destroying key shape features. In Section 4 a new scaling algorithm for characters with variable magnification (reduction) factors, based on transform coding, is proposed.
2. Contour based 1-D transform techniques
2.1. Contour signals The examination of the object boundaries is extremely important and adequate for many applications such as recognition of characters, silhouettes of human profiles, chromosomes, etc. Here, the boundary of a closed planar shape is expressed as an ordered sequence of all boundary pixels in the discrete plane. The terms contour and contour sequence, widely used in the literature, are also reserved here in order to characterize the boundary of a discrete shape and the resulting ordered sequence respectively. Definitions of the contour and algorithms for contour tracing can be found in many papers [11, 13, 15].
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
3[2, 4
P
0
5
6
7
In what follows, the contour is expressed by the parametric equations
Fig. 1. Chain code.
The contour can be expressed as a sequence
c, ={(x,,y,)li=o, 1 , . . . , N - l } ,
(1)
where (xi, yi), i = 0, 1 , . . . , N - 1 are the coordinates of the contour pixels ordered in a clockwise fashion. (The contour can also be expressed by the sequence cd(n), n = 0 , . . . , N - 1, where cd(n) is the chain code of the nth pixel of the contour. The chain code is shown in Fig. 1.) The contour closure yields the following property: c,+N = c,,
(2)
which means that the sequence c~ is circular. Furthermore, if the traversal algorithm starts from pixel (xr, yr) where O<~r<~N-1, the new sequence c~ is given by (3)
C; = el+r,
which implies that the sequence c~ is circular shifted by r points. If a shape is uniformly scaled by a factor a, the perimeter is also scaled by a. In the discrete plane, an approximation of the scaled contour can be given by
c T = { ( x T , y T ) l i = o , 1. . . . , N a - 1 } ,
(4)
where Na = int(aN), int(x) is defined as int(x) = ~[x] [[x]+l
if x - [ x ] ~ 0 . 5 , if x - [ x ] > 0.5,
x = x(n),
(6a)
y =y(n),
(6b)
where n =0, 1 , . . . , N - 1 and x(n), y(n) are considered as data sequences with the properties (2), (3), (4) mentioned previously, and obtained by using an appropriate data acquisition mechanism which is adequate for the preservation of shape [15].
2.2. D F T of contour sequences The D F T of an N data sequence x(n), n = 0, 1 , . . . , N - 1, is defined as 1
N
1
X(m)=---~T ~ x ( n ) w " ' ,
m=0,1,...,N-1,
n =0
(7) where w = e -j2~r/N and X ( m ) is the mth DFT coefficient. The D F T of x(n) may also be expressed by a matrix product as
(8)
x = Wx,
where x and X are vector representations of sequences x(n) and X ( m ) , respectively, and W=
w m" ,
m, n = 0 , 1 , . . ., N - 1 .
(9) The inverse DFT has the transformation kernel W -~, which is the conjugate transpose of the forward kernel W *T, and because of the symmetry of W we obtain
(10) (5)
[x] is the integer part of x, and x~ = axe/a, y~ = ayi/a. If m < (i/a) < rn + 1, where m is an integer, then c~/a corresponds to an interpolated value between c,, and cm+~.
Figure 2(b, c) show the sequences x(n) and y (n) of the contour of character of Fig. 2(a). The magnitude of the D F T of x(n) and y(n) is illustrated in Fig. 3(a, b), respectively. The first M (where M = 20) coefficients appear to have a large magnitude in comparison with the Vol. 23, No. 1. April 1991
4
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
(a)
x
--a
Fig. 2. (a) Character a of the Helvetica font. The print A has been selected to be the starting pixel of the contour tracing algirithm. (b) The sequence x(n) of the exterior contour of character a. (c) The sequence y(n) of the exterior contour of character a.
remaining ½N-M (=132) components of the DFT, as depicted in Fig. 3(a). This interesting property is also valid for many characters of different fonts and sizes of the Roman alphabet, where the quantity M takes small values. A natural sequel to the above observations is data compression, in the sense that the data sequences x(n), y(n) can be represented by a few terms of the DFT expansion and that this data sequence representation can be used for the reconstruction of characters without introducing objectionable errors, as discussed in Section 3. The next sections are concerned with the data sequences x(n),y(n) and c(n)=x(n)+jy(n) of the contour.
2.3. A computational efficient algorithm The D F T of a real or complex sequence x(n), n =0, 1 , . . . , N - l , is given by (7). By using the sequence xl(n) derived from x(n), as shown in the
(a) 28.5
3.1~t,-, -34 . 6 1
28
56
83
iii
138
1
28
56
83
iii
138
(b) 31.3
3.2
"37.8
Fig. 3. The amplitude in (dB) of the discrete Fourier transform of the sequence (a) x(n) and (b) y(n) of Fig. 2. Signal Processing
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
following equation: 0, xl(n)=
x(n)-x(n-1),
n = 0, n=l,...,N-1, (11)
the mth D F T coefficient of x(n) can be expressed
The same algorithm can be used for the computation of the DFT of the sequence y(n) of the contour. In this case, the sequence y l ( n ) = y ( n ) - y ( n - 1 ) , n = l . . . . , N - 1 ( y l ( 0 ) = 0 ) , can also be found from the chain code, as shown in the following:
as
wm - 1
Z x,(n)w °m- Y.
n=o
n=o
xl(n)
m = 1,..., N-l, .
,
(12)
N--I
where the quanUty ~n=o x~(n) = x ( N - 1) - x(0). As shown in (12), the D F T of x(n) can be calculated from the D F T of x~(n) (except of the DC component X(0)). This property of the DFT corresponds to that of the Fourier transform of a continuous signal x(t), where the computation of the Fourier transform of x(t) can be performed via the Fourier transform of the first derivative of
x(t). In the special case, where x(n), n = 0 , 1 , . . . , N - 1 , corresponds to the x-coordinate of the nth pixel of the contour, x~(n) can take only the values - 1 , 0, +1. Using this property of the contour pixels, the computation of the nth D F T coefficient of xl(n), involved in (12), requires only subtractions and additions, the total number of which is less than or equal to N - 1 (since for some n, where n =0, 1 , . . . , N - l , the value of x~(n) may be equal to zero). In practice, it is not necessary to compute the sequence x~(n) by (11), since the value of x~(n) can be found directly from a lookup table indexed by the chain code entry: cd(n) Xl(n )
0 1
1 2 1 0
3 -1
4 -1
5 -1
6 0
7 1
where cd(n) denotes the chain code of the nth pixel of the contour as traversed by a contour tracing algorithm. Thus, the computation of the coefficient X(m) of the D F T of the sequence x(n) (12) of the contour, requires 1 complex multiplication and K < N subtractions and additions (when N - K samples of the sequence xl(n) are equal to zero).
cd(n)
0
1
2
3
y~(n)
0 -1
-1
-1
4
5
6
7
0 1 1 1
Furthermore, the D F T coefficients C(m), m = 1 , 2 , . . . , N - l , of the complex sequence c ( n ) = x(n) + j y ( n ) of the contour, can be derived by using the linear property of the DFT, i.e.,
C(m) = ( R e [ X ( m ) ] - Im[ Y(m)]) +j(Im[X(m)]+Re[Y(m)]).
(13)
The above algorithm, for the computation of the D F T of the contour sequences, is superior (faster) in comparison to others proposed in the literature [8, 21] when one of the following conditions are valid: (1) A small number M<< N of transform coefficients are required (as in the case of characters); (2) The sequences xl(n), yl(n), where n = 0 , 1 , . . . , N - 1, consist of a large number of zero samples.
2.4. DCT of contour sequences Many versions of the discrete cosine transform have been reported [1, 21]. In this study, the even version II of the DCT or simply DCT-II is used, as introduced into digital signal processing by Ahmed et al. [1] and defined as
T
X ( m ) = ~ / ~ a(m) N--1
x Z x(n) cos((2n + 1)'rrm/2N), n=O
m =0, 1,..., N-l,
(14)
where a(0) = 1/x/2 and a(m) = 1 for m ~ 0, while Vol. 23. No. 1, April 1991
6
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
the inverse DCT is given by
contour. The values of the first derivative xl(n) or yl(n) can be found directly from the chain code, as described in the previous paragraph. Thus, the computation of the ruth DCT coefficient of the sequence x(n) or y(n) of the contour, requires 1 multiplication and a number ( < N - 1) of subtractions and additions. The magnitude of the DCT coefficients of the sequences x(n), y(n) of the character of Fig. 2(a) is illustrated in Fig. 4(a, b), respectively. As can be observed from these figures, the energy of the sequences is 'packed' into a few DCT coefficients. Similar results are obtained for most of the characters. Based on the observation that the energy of the above sequences is essentially contained in a few DCT or D F T components, a data compression algorithm for characters is considered in the next section.
x(n)=~/~ N--1
× ~ a(m)X(m) cos((2n + 1),rrm)/2N), m=0
n = 0 , 1 , . . . , N - 1.
(15)
The DCT of the sequences y(n), c(n) of the contour is also given by (14), where the sequence x(n) must be replaced by y(n) and c(n), respectively. The basis vectors of DCT are derived from a class of discrete Chebyshev polynomials and the DCT of a sequence x(n) can be computed via the D F T of x(n). By using the first derivative x,(n) of x(n), as shown in (11), the ruth D C T coefficient can be expressed by the following equation: X(m) =- ~/~
1
2 sin(m,n/2N)
N_,
.
X ~
xl(n)sln~/,
3. Reconstruction of characters after coefficient selection in the transform domain
(16)
\
n=0
iv i
where m = l , . . . , N - 1 . The above equation can be used for the computation of the DCT of the sequence y(n) of the
As already commented, an important consideration is the number of D F T and DCT coefficients
19.9
-34.si -88.8
.
.
.
.
.
2o.8i~ 1
.
.
.
.
.
56
.
.
.
.
iii
.
.
.
.
.
.
166
.
221
276
(b)
(V
--57.9
. 1
.
.
.
. 56
.
.
.
. Ill
.
.
.
. 166
.
.
.
.
. 221
.
.
. 276
Fig. 4. The amplitude (in dB) of the discrete cosine transform of the sequence (a) x(n) and (b) y(n) of Fig. 2. Signal Processing
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
required to adequately represent the contour sequences. In the simplest approach, data sequences x(n) and y(n) of the character contours are processed separately. The objective here is to select a subset of M components of the N transform coefficients, where M is substantially less than N. This strategy, called zonal sampling in transform coding, can be implemented very simply if coefficient variance distributions are known, a priori, to have a given structure. In the case of an input that is expected to be lowpass, it is possible to obtain data reduction by simply retaining M (where M < N ) coefficients in the transform representation. This may occur, if basis vectors are chosen so that low indices of vectors indicate low frequencies, as in the case of D F T and DCT. In order to compare the reconstructed, by this method, sequence ~(n) or vector ~ to the original x, a mean-square error criterion based on the following formula can be used: 2 1 o-~ = ~ (x - x)T(x -- X),
(17)
where x is the input vector, which can be described as N-1
x= ~ X(m)b,,,
(18)
m=0
b,,,, X(m) are the orthonormal basis vectors and the transform coefficients, respectively, while ~ is the approximation of x obtained by superposing a subset only of M < N basis vectors, that is, M
~= Y X(m)bm.
(19)
m=0
Here, we use an S N R measure as defined in the following: S N R = 10 log
O" x
,
(20)
where 1 N-I
1
N-1
o'~,=~,2 o (x(n) - /z) 2 and tz = ~ , = oE
x(n).
Curves of S N R for the sequences x(n) and y(n) of the character contour of Fig. 2(a), are illustrated
7
as a function of M in Fig. 5(a, b). The x-axis of these figures represents the D C T coefficients in decreasing order (the higher indices are closer to the origin) which are discarded in the reconstructed data sequences ~(n) and )3(n). Results for the D F T are illustrated in Fig. 6(a, b). Similar curves of S N R can be obtained for all characters of different fonts and sizes of the Roman alphabet. In almost all the cases, two regions of these curves are of great importance. In the first region, where x varies from coordinate N up to M (where M is 30-50 for DFT), the slope of the curve is low and almost constant, while in the second region, from point M up to 1, the S N R curve falls rapidly to zero. This implies that high indices of the transform coefficients can be rejected in the reconstructed contours, without producing 'severe' errors, in the sense that the initial shape is preserved. For the exterior contour of some characters, such as O, o and the interior contour of almost all the characters of several fonts, the quantity M takes small values (2-10), since in such cases the corresponding waveforms are close to sines or cosines. A simple method for the reconstruction of character contours is to compute the first M transform coefficients of the given sequences x(n) and y(n), setting all the remaining components equal to zero. The new sequences ~(n), 33(n) are extracted by taking the inverse transform of X(m) and Y(m), respectively, where X(m), Y ( m ) = 0 for
m>M. When the D F T is used, the sequences x(n) and y(n) are reconstructed from the - M , . . . , - 1 , 0, 1. . . . , M transform coefficients, since X(m)= X*(-m) and Y(m)= Y*(-m). In the case of DCT, only the first M coefficients are used. In order to completely reconstruct the character, a rounding process is performed on the real numbers of the sequences ; ( n ) and ~(n) and a filling algorithm [17] is necessary. A block diagram of this method is depicted in Fig. 7. Figure 8 shows several characters reconstructed from 50, 40, 30, 20, 10, 7 complex coefficients of the DFT, respectively. The leftmost character is Vol. 23, No. 1, April 1991
8
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
73.8
59.1
44.4
29.7
15.0
0.3 304
249
194
139
84
29
139
84
29
(a)
62.7
50.7
38.7
26.7
14.7
2.7 304
249
194
(b) Fig. 5. S N R curve for the sequence (a) x(n) and (b) y(n) of Fig. 2, using the discrete cosine transform. For example, if the first 57 D C T coefficients are used for the reconstruction of the character, the value of SNR is 42 dB.
Signal Processing
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
9
56.5i
45.6
34.8
23.9
13.1
2.2 304
249
195
140
86
31
(a)
59.4i
49.4
39.3
29.3
19.2
9.2 304
249
195
140
86
31
(b) Fig. 6. SNR curve for the sequence (a) x(n) and (b) y(n) of Fig. 2, using the discrete Fourier transform.
Vol. 23, No. 1, April 1991
10
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
character
1 Contours
1 Transform
Selection of transform coefficients
Inverse Transform
Rounding
1
Filling
]
I
the character is recognizable by humans when only 6-7 DFT (12-14 DCT) coefficients are selected. In some cases, where very few components (less than 6) are used, the exterior and interior contours may overlap. Another rational criterion for selecting transform components is to retain the set of components with the M largest variances and discard the N - M remaining components. This strategy, known as threshold coding [19] in images, gives better results than those of the previous method. For example, selecting the 30 components of DCT with the largest absolute values, the image of Fig. 10(c) is closer to the original image (Fig. 10(a)) in comparison to that of Fig. 10(b), where the first 30 components are used. On the other hand, in this technique, one needs side information about the indices k of the transform components in order to reconstruct the character. In all cases, a large number of the indices k are found in the interval 1 , . . . , M, where M is 40-60 for DFT and 80-120 for DCT. Thus, if K < M components have to be selected, a method which can be implemented in order to have a 'good' reconstruction and reduce the time of searching, is to retain the K, among the first M coefficients, with the largest variances.
Reconstructed Character Fig. 7. Block diagram of the reconstruction of characters.
the original character as obtained from a 300 dpi (dots per inch) scanner. The reconstruction of the same character using the DCT is illustrated in Fig. 9. By observing Figs. 8 and 9, it can be found that similar results are obtained, when M and 2 M coefficients of D F T and DCT are selected, respectively. This is due to the fact that the D F T coefficients are generally complex numbers. Another important result is that 30-50 (60-100) coefficients of DFT (DCT) of the sequences x(n) and y(n) suffice for a high quality reconstruction of the exterior contour of Roman characters, while Signal Processing
4. Efficient scaling of characters with variable magnification (reduction) factor Font scaling methods [2, 9] are required in many applications, such as phototypesetting or desktop publishing, in order to scale characters, that is, to reduce or increase the number of pixels per row (or column) in an image (containing a character). Here, a simple but efficient scaling technique based on the transform (DCT or DFT) components and on the property (4) of the contour sequences, is proposed. By taking into account the linear property of DCT or D F T and the scaling property (4) of the contour, an approximation of the sequences x(n) and y(n) of the scaled contour can be based on
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
ll
AAAAAAA AAAAAAA aaaaaaa
WWWWWWW WWW
WWW
W
aaaaaaa
bbbbbbb Fig. 8. R e c o n s t r u c t i o n of characters using 50, 40, 30, 20, 10, 7 D F T coefficients. The lefimost character is the original character.
the
calculation
of the
inverse
transform of Xa(m) = aX(m) (Ya(n) = aY(m)), where a is the scaling factor and m = 0, 1 , . . . , Na - 1 with Na = int(aN). For example, using the DCT, xa(n) is calculated by '~N a 1
x"(n)=
r, a(m)X~(m)
m=0
x cos((2n + 1)'rrm/2N~),
(21)
where X a ( r n ) = aX(m), Na = i n t ( a N ) . When a is greater than 1, the components Xa(m), m= N , . . . , N~ are set to zero. For reduction, that is when a <1, the components Xa(m), where m = N , , . . . , N - 1 , are discarded.
In order to completely reconstruct the character, the same method as discussed in the previous section is implemented. Scaled characters with variable magnification (reduction) factors are illustrated in Fig. 11, where the DCT is used. In each case, the leftmost character is the original character as obtained from a 300 dpi scanner. Figure 12 shows scaled characters, using the DFT. As discussed in Section 3, a few coefficients suffice in order to adequately represent a character. By using these results, the scaling algorithm can be based on the first M transform coefficients of the sequences x(n) and y(n). By setting the N - M remaining components equal to zero, the scaled Vol. 23, No. 1, April 1991
12
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
AAAAAAA AAAAAAA aaaaaaa
WWWWWWW WWWWWWW aaaaaaa
bbbbbbb Fig. 9. Reconstruction of characters using 100, 80, 60, 40, 20, 14 DCT coefficients.The leftmost character is the original character.
(a) g
(b)g
(C)g I
Fig. 10. (a) Original character. (b) Reconstructed character, by using the first 30 DCT coefficients. (c) Reconstructedcharacter, by selectingthe 30 DCT coefficientswith the largest absolute variances.
that for a high quality in magnification, the original characters must have a point size greater than 10-12. For reduction, characters with size greater than 10 points can also be produced on a laser printer with a 300 dpi resolution.
5. Conclusion contours are smoothed and very good quality characters can be obtained. This case is depicted in Fig. 13, where variable scaling factors are used. In order to generate high or very good quality characters the acquisition or display devices must have a high resolution in association with the point size of characters. Experimenting with a 300 dpi scanner and with several different fonts, we found
SignalProcessing
1-D transform coding techniques have been discussed here, as a tool for 2-D binary object representation. Many alternatives are provided for the computation of critical, shape preserving parameters, which can be used later on both for object synthesis and recognition. The parsimonious number of parameters in the frequency domain has
G.N. Stainhaouer, G. Carayann& / Character generation and scaling
'a'aaaaa ' ' bbb , eee
'a'eeeeee aaaaaa
,bbb
, ,aaa Fig. 11. Magnification and reduction experiments using the DCT. The leftmost character is the original character. The scaling factor is (a) 1, 1.2, 1.4, 1.6, 2, 3; (b) 1, 0.9, 0.8, 0.7, 0.6, 0.5; (c) 1, 2, 3; (d) 1, 2, 3.
13
Fig. 13. Magnification experiments using the DCT. The leftmost character is the original character. The scaling factor is (a) 2, 3, 4, 5; (b) 2, 3, 4; (c) 2, 3. The first (a) 60, (b) 60 and (c) 50 DCT coefficients are used' for the reconstruction of the exterior contour of the scaled characters, while the first (a) 25 (b) 30 (c) 30 DCT coefficients are used for the interior contour.
References
a, bb
' eeeeee Fig. 12. Magnification experiments using the DFT. The leftmost character is the original character. The scaling factor is (a) 1, 2, 3; (b) 1, 1.2, 1.4, 1.6, 2, 3.
been defined. A computational
efficient algorithm
h a s b e e n p r e s e n t e d . F u r t h e r r e s e a r c h is f o c u s e d o n recognition
applications
on
the
algorithms presented in this paper.
basis
of
the
[1] N. Ahmed, T. Natarayin and K.R. Rao, "Discrete cosine transform", 1EEE Trans. Comput., Vol. C-23, 1974, pp. 8893. [2] K.L. Anderson, F.C. Mintzer, G. Goertzel, J.L. Mitchell, K.S. Pennington and W.B. Pennebaker, "Binary-image manipulation algorithms in the image view facility", I B M J. Res. Develop., Voh 31, No. 1, 1987, pp. 16-31. [3] K. Arbter, Affine-invariant Fourier descriptors, in: J.C. Simon, ed., From Pixels to Features, North-Holland, Amsterdam, 1987, pp. 153-164. [4] K.S. Fu, Syntactic Methods in Pattern Recognition, Academic Press, New York, 1974. [5] F. Gorbel et al., "Similarity-invariant analysis of handwritten zip code using Fourier descriptors", Internat. J. Research Engrg., Vol. 1, 1989, pp. 1-5. [6] J.W. Gorman, O.R. Mitchell and F.P. Kuhl, "'Partial shape recognition using dynamic programming"', IEEE Trans. Pattern Anal. Machine IntelL, Vol. PAMI-10, No. 2, 1988, pp. 257-266. [7] G.H. Granlund, "Fourier preprocessing for handprint recognition", IEEE Trans. Comput., Vol. C-21, 1972, pp. 195201. [8] T.A. Grogan and O.R. Mitchell, Shape recognition and description: A comparative study, School Electrical Engineering, Purdue Univ., West Lafayette, IN, Tech. Rep. Tr.-EE 83-22, 1983. Vol. 2~. No. 1, April 1991
14
G.N. Stainhaouer, G. Carayannis / Character generation and scaling
[9] M. Kikutani, "Image scaling", IBM Techn. Disclosure BulL, Vol. 27, No. 5, 1984, pp. 2984-2986. [10] A. Krsyzak, S. Leung and C.Y. Suen, "Reconstruction of two-dimensional patterns from Fourier descriptors", Machine Vision Appl., Vol. 2, 1989, pp. 123-140. [ 11 ] T.H. Morrin, "Chain link compression of arbitrary blackwhite images", Comput. Graph. Image Process., Vol. CGIP-5, 1976, pp. 172-189. [12] T. Pavlidis, "A review of algorithms for shape analysis", Comput. Graph. Image Process., Vol. CG1P-7, 1978, pp. 243-258. [13] T. Pavlidis, "A minimum storage boundary tracing algorithm and its application in automatic inspection", IEEE Trans. Systems Man Cybernet., Vol. SMC-8, 1978, pp. 66-69. [14] T. Pavlidis, "Algorithms for shape analysis of contours and waveforms", IEEE Trans. Pattern Anal, Machine lntell., Vol. PAMI-2, 1980, pp. 301-312. [15] T. Pavlidis, "Algorithms for Graphics and Image Processing", Computer Science Press, Rockville, MD, 1982.
Signal Processing
[16] U. Ramer, "An iterative procedure for the polygonal approximation of plane closed curves", Comput. Graphics Image Process., Vol. 1, 1972, pp. 244-256. [17] V. Shani, "Filling regions in binary raster images--A graph-theoretic approach", SIGGRAPH, 1980, pp. 321327. [18] M. Shridhar and A. Badreldin, "High accuracy character recognition algorithm using Fourier and topological descriptors", Pattern Recognition, Vol. 17, No. 5, 1984, pp. 515-524. [19] P.A. Wintz, "'Transform picture coding", Proc. IEEE, 1972, pp. 809-820. [20] G.T. Zahn and R.Z. Roskies, "Fourier descriptors for plane closed curves", IEEE Trans. Comput., Vol. C-21, 1972, pp. 269-281. [21] Zhongde Wang, Fast algorithms for the discrete W transform and for the discrete Fourier transform, IEEE Trans. Acoust. Speech Signal Process., Vol. ASSP-32, No. 4, 1984, pp. 803-816.