+ All Categories
Home > Documents > Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

Date post: 06-Nov-2016
Category:
Upload: herbert
View: 217 times
Download: 1 times
Share this document with a friend
7
IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 5, SEPTEMBER 1981 [71 -, "Stochastic texture fields synthesis from a priori given second order statistics," presented at the PRIP Conf., Chicago, IL, Aug. 6-8, 1979. [8] R. M. Haralick, K. Shanmugan, and I. Dinstein, "Texture features for image classification," IEEE Trans. Syst., Man, Cybern., vol. SMC-3, pp. 610-621, 1973. [91 M. Rosenblatt and D. Slepian, "Nth order Markov chains with any set of N variables independent," J. Soc. Indust. Applied Math., vol. 10, pp. 537-549, September 1962. [10] G. B. Dantzig, "Linear program and extensions," Princeton Univ. Prep., pp. 12-31, 1963. [11 S. R. Purks and W. Richards, "Visual texture discrimination using random dot patterns," J. Opt. Soc. Amer., vol. 67, June 1977. [121 W. K. Pratt and 0. D. Faugeras, "Development and evaluation of stochastic based visual texture features," presented at the IJCPR Conf., Kyoto, Japan, Nov. 3-13, 1978. [131 R. M. Haralick, "Structural pattern recognition, homomorphisms and arrangements," Pattern Recognition, vol. 10, no. 3, pp. 223- 236, 1978. Andre Gagalowicz was born in Foug, France, on February 21, 1947. He received the B.S. degree in mathematics in 1970 and the M.S. degree in probabilities in 1971 from the University of Paris VI, France, attended the Ecole Superieure d'Electricite, until 1971, and received the Docteur Ingenieur degree in computer science from the University of Paris IX, Orsay, France, in 1974. Since 1975, he has been working for his Doctorat-es-Sciences degree at the Institut de Recherche d'Informatique et d'Automatique (IRIA), Le Chesnay, France. His current research interests are in image processing, pattern recognition, and computer science. Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves JOHN A. SAGHRI AND HERBERT FREEMAN, FELLOW, IEEE Abstract-This paper examines a set of line-segment approximation codes for the representation of planar curves (the so-called generalized chain codes) and shows that the average quantization error (measure of code's precision) is directly proportional to the grid size and is inde- pendent of the form of the code. Thus, to achieve a desired level of precision for the representation of a line drawing, only the size of the grid need be determined; the form of the code can be chosen on the basis of other criteria, such as compactness, smoothness, or relative ease of encoding and processing. Index Terns-Curve representation, generalized chain codes, image processing, line-drawing encoding, map data processing, pattern recog- nition, quantization errors. I. INTRODUCTION THE common eight-direction chain code for the represen- r tation of line-drawing data [1] can be regarded as being only one member of a family of generalized chain codes. In- stead of being limited to eight directional links (fixed length directed line segments), the generalized chain codes possess 8m directional links, where m may be any positive integer; although, in practice, m is not likely to exceed 10 and not all Manuscript received September 24, 1979; revised September 5, 1980. This work was supported by the United States Air Force through the Rome Air Development Center under Contract F30602-78-C-0083. J. A. Saghri was with Rensselaer Polytechnic Institute, Troy, NY 12181. He is now with the Aerospace Corporation, P.O. Box 92957, Los Angeles, CA 90009. H. Freeman is with Rensselaer Polytechnic Institute, Troy, NY 12181. values of m between 1 and 10 are of equal utility [2] -[4]. Because of the finer angular resolution and the availability of longer line segments, the generalized chain codes offer in- teresting possibilities for improved line-drawing representa- tion, such as increased compactness, greater smoothness, and faster processing capabilities. We shall show here, however, that their precision is dependent solely on the size of the under- lying grid and is unaffected by the form of the code. It is well known that approximating a curve by a sequence of straight lines, so that the maximum separation between the curve and the straight-line approximation does not exceed a specified amount, requires that the line segments be short where the degree of curvature is high, although they may be much longer in regions where the curvature is gentle [5], [71. If a curve is represented in the eight-node chain code, the spacing of the grid must be selected to be no greater than half the minimum radius of curvature that is to be preserved in the representation [8]. This fixes the lengths of the approximat- ing line segments to 1 and V2 times the grid spacing for the entire curve, including regions where the radii of curvature are larger and where longer segments could be used without loss of precision. The generalized chain codes tend to over- come this drawback as they permit links of many other sizes and directions to be used for the representation of a curve. We shall show here that the average quantization error for generalized chain-code representations is unaffected by the form of the code (i.e., by the sizes and directions of the line segments) and is determined solely by the spacing of the 0162-8828/81/0900-0533$00.75 © 1981 IEEE 533
Transcript
Page 1: Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 5, SEPTEMBER 1981

[71 -, "Stochastic texture fields synthesis from a priori givensecond order statistics," presented at the PRIP Conf., Chicago,IL, Aug. 6-8, 1979.

[8] R. M. Haralick, K. Shanmugan, and I. Dinstein, "Texture featuresfor image classification," IEEE Trans. Syst., Man, Cybern., vol.SMC-3, pp. 610-621, 1973.

[91 M. Rosenblatt and D. Slepian, "Nth order Markov chains withany set of N variables independent," J. Soc. Indust. AppliedMath., vol. 10, pp. 537-549, September 1962.

[10] G. B. Dantzig, "Linear program and extensions," Princeton Univ.Prep., pp. 12-31, 1963.

[11 S. R. Purks and W. Richards, "Visual texture discrimination usingrandom dot patterns," J. Opt. Soc. Amer., vol. 67, June 1977.

[121 W. K. Pratt and 0. D. Faugeras, "Development and evaluation ofstochastic based visual texture features," presented at the IJCPRConf., Kyoto, Japan, Nov. 3-13, 1978.

[131 R. M. Haralick, "Structural pattern recognition, homomorphisms

and arrangements," Pattern Recognition, vol. 10, no. 3, pp. 223-236, 1978.

Andre Gagalowicz was born in Foug, France, onFebruary 21, 1947. He received the B.S. degreein mathematics in 1970 and the M.S. degree inprobabilities in 1971 from the University ofParis VI, France, attended the Ecole Superieured'Electricite, until 1971, and received theDocteur Ingenieur degree in computer sciencefrom the University of Paris IX, Orsay, France,in 1974.

Since 1975, he has been working for hisDoctorat-es-Sciences degree at the Institut de

Recherche d'Informatique et d'Automatique (IRIA), Le Chesnay,France. His current research interests are in image processing, patternrecognition, and computer science.

Analysis of the Precision of Generalized ChainCodes for the Representation of Planar Curves

JOHN A. SAGHRI AND HERBERT FREEMAN, FELLOW, IEEE

Abstract-This paper examines a set of line-segment approximationcodes for the representation of planar curves (the so-called generalizedchain codes) and shows that the average quantization error (measure ofcode's precision) is directly proportional to the grid size and is inde-pendent of the form of the code. Thus, to achieve a desired level ofprecision for the representation of a line drawing, only the size of thegrid need be determined; the form of the code can be chosen on thebasis of other criteria, such as compactness, smoothness, or relativeease of encoding and processing.

Index Terns-Curve representation, generalized chain codes, imageprocessing, line-drawing encoding, map data processing, pattern recog-nition, quantization errors.

I. INTRODUCTIONTHE common eight-direction chain code for the represen-r tation of line-drawing data [1] can be regarded as beingonly one member of a family of generalized chain codes. In-stead of being limited to eight directional links (fixed lengthdirected line segments), the generalized chain codes possess8m directional links, where m may be any positive integer;although, in practice, m is not likely to exceed 10 and not all

Manuscript received September 24, 1979; revised September 5, 1980.This work was supported by the United States Air Force through theRome Air Development Center under Contract F30602-78-C-0083.J. A. Saghri was with Rensselaer Polytechnic Institute, Troy, NY

12181. He is now with the Aerospace Corporation, P.O. Box 92957,Los Angeles, CA 90009.H. Freeman is with Rensselaer Polytechnic Institute, Troy, NY 12181.

values of m between 1 and 10 are of equal utility [2] -[4].Because of the finer angular resolution and the availabilityof longer line segments, the generalized chain codes offer in-teresting possibilities for improved line-drawing representa-tion, such as increased compactness, greater smoothness, andfaster processing capabilities. We shall show here, however,that their precision is dependent solely on the size of the under-lying grid and is unaffected by the form of the code.

It is well known that approximating a curve by a sequenceof straight lines, so that the maximum separation between thecurve and the straight-line approximation does not exceed aspecified amount, requires that the line segments be shortwhere the degree of curvature is high, although they may bemuch longer in regions where the curvature is gentle [5], [71.If a curve is represented in the eight-node chain code, thespacing of the grid must be selected to be no greater than halfthe minimum radius of curvature that is to be preserved in therepresentation [8]. This fixes the lengths of the approximat-ing line segments to 1 and V2 times the grid spacing for theentire curve, including regions where the radii of curvatureare larger and where longer segments could be used withoutloss of precision. The generalized chain codes tend to over-come this drawback as they permit links of many other sizesand directions to be used for the representation of a curve.We shall show here that the average quantization error for

generalized chain-code representations is unaffected by theform of the code (i.e., by the sizes and directions of the linesegments) and is determined solely by the spacing of the

0162-8828/81/0900-0533$00.75 © 1981 IEEE

533

Page 2: Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

534 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 5, SEPTEMBER 1981

3 2 1

4

5 6 7

(a)

nr .... TIHE LINK GATE SETN ..

"".

t LINK

(b) (c)

(d) (e)Fig. 1. Generalized chain codes. (a) (l)-code. (b) (2)-code. (c) (1, 2)-

code. (d) (1, 3)-code. (e) (1, 2, 3)-code.

underlying grid. The generalized chain codes thus offer no

advantage over the common eight-node chain code from thepoint of view of precision, although other factors, such as

compactness, ease of processing, and smoothness, may stilljustify their use.

II. THE GENERALIZED CHAIN CODES

The generalized chain codes are defined in terms of "rings"on a square grid [21. Let q represent the grid spacing of a

uniform square grid. A "ring n" is defined as a square of side2nq with 8n equi-spaced nodes on the perimeter, located suchthat there is a node at each of the four corners. A vectordirected from the center of the ring to any node is called a

"link." A particular chain code is formed by selecting a setof concentric rings. The code is identified by the rings se-

lected. Thus, the conventional eight-node code is called the(1)-code, and the code consisting of rings 1 and 3, the (1, 3)-code. The configurations for the (1)-code, (2)-code, (1, 2)-code, (1, 3) code, and (1, 2, 3)-code are shown in Fig. 1.To obtain the actual sequence of links that are to approxi-

mate a given curve, we shall utilize the following quantizationalgorithm. The algorithm is a generalization of the grid-intersectquantization scheme originally developed for the eight-nodechain code [1]. It consists of two parts, a template-determin-ing part (A) and a link-selecting part (B).

A. Template Determination1) Set i = k, where k is the order of the largest ring in the

selected chain code.2) Find the midpoints of all pairs of adjacent nodes on this

ring.

(c)

(a)Fig. 2. Templates (link-gate sets) associated with (a) ring 3. (b) ring 2.

(c) ring 1.

3) For each link of the ring, draw two line segments, calledmidpoint lines, parallel to it from the two neighboring mid-points on the sides of the link until they intersect the inner-most ring of the selected code.4) The parallel line segments cut out of each ring, 1 through

k, by the pair of midpoint lines form the link-gate set for thelink of ring k lying between the two midpoint lines.

5) Seti=i- 1;ifi=0,stop.6) If the code does not contain ring i, go to 5, or else go

to 2.The set of all link-gate sets of a ring is referred to as a

template. The templates for rings 1, 2, and 3 are shownin Fig. 2.

B. Link Selection1) Set i = k where k is the order of the highest order ring

in the code.2) Center template i on the last-selected node and orient

it so that its sides are parallel to the grid.3) Find the intersections between the curve and rings i,(i-1), (i - 2), * ,1.4) If the code does not contain any ring lower than ring i,

delete from the list obtained in 3) all but the intersectionsthat lie on ring i.5) If any link-gate set of ring i contains all the remaining

intersections, then the associated link is selected, a newchain node is found (the end node of the link), and we re-turnto 1). Orelseset i=i- 1 andgoto3).

Fig. 3 shows a contour map that has been encoded withthis algorithm for several codes.Alternative quantization algorithms can be readily devel-

oped. Thus, for example, one could have the midpoint linesjoin at the ring center rather than be parallel. The resultingchain for a given curve will then, of course, be slightly differ-ent [4], [9]. The scheme described here is, however, pre-ferred because of its simplicity; all the work that followshere presumes use of this scheme.

Page 3: Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

SAGHRI ANI) FREEMAN: GENERALIZED CHAIN CODES

i~~~~

; ,

7

(a)

(c)

(e)

(g)

(a)

(b)

(d)

(f)

(h)Fig. 3. Generalized chain encoding of a contour map: (a) Originalmap. (b) (l)-code. (c) (1, 2)-code. (d) (1, 3)-code. (e) (1, 2, 3)-code. (f) (2, 3)-code. (g) (3)-code. (h) (2)-code.

n/,/n2 + a2

(b)Fig. 4. Domains of (a) link L 1 3, and (b) general link La n.

points of view of both storage requirements and processingtime.The average quantization error for a curve and its generalized

chain representation can be determined in the followingmanner.Denote a link L of ring n by its x, y components as LY,X

where |x S n and IYI S n. Each link of ring n belongs to oneof the n + 1 classes of links whose elements are of the samesize. We shall denote these classes by Ca, n, where n is the ringnumberanda=O,1,2- ,n.Now, for example, let us consider the gate sets of link L, 3

shown in Fig. 4(a). The width of each gate W[L1,3 ] is givenby

W[Lj,3] qcos(e)= 3/ 32+12q. (1)

In general, the width of the gates of the links of class Ca,n isequal to

W[Ca,nII=n 2+a2q

where

n= 1, 2,*

(2)III. QUANTIZATION ERROR

We shall define the quantization error associated with apoint on a curve as the smallest distance between that pointand the chain. The maximum and average quantization errorconstitute two important performance characteristics of aquantizing scheme.For all chain codes, the quantizing scheme limits the maxi-

mum quantization error to less than half the grid spacing [8].In general, the grid should be just fine enough to preserve theminimum radius of curvature deemed significant in the curve;any finer grid will yield an inefficient representation from the

The average quantization noise (distortion) of a link ofclass Ca, n, dis[Ca, nI] is found by dividing the average areabetweer the curve and the link by the length of the link.The length of a link of class Ca,n is equal to Nn2+ a2.

From (2) it is apparent that the ratio of the length of a linkto the width of its gate is equal to n = (n2 + a2)/n.Consider the domain of a link class Ca,n shown in Fig. 4(b).

The width of the domain is W = n /n2 + a2 q and the lengthis n W. We assume that the portion of the curve within thisdomain can be approximated by a straight line segment AB.The vertical position of point A is random with a uniform

535

- -tN4\,-\ .

3-

t- -

a=O, 1,* ,n.

Page 4: Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

536 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 5, SEPTEMBER 1981

TABLE IPOSSIBILITY OF A LINK OF RING n CROSSING THE BOUNDARY

CURVE

a=O a=1 a=2 a=3 a=4

n -1 0.43008 0.4785 1n = 2 0.47851 0.48583 0.49427n =3 0.49000 0.49183 0.49510 0.49742n = 4 0.49428 0.49491 0.49630 0.49762 0.49855

probability density of

fx(x) =1/W O<x. W.

The probability density for point B is the same as that forpoint A; however, for small values of n, the locations of thetwo points may not be considered independent. The angle 0is independent of the position of point A. As shown by Groen[71, the probability density of 0 is proportional to the cosineof 0, that is,

f0 (0) = k cos (0) where k is the constantof proportionality. (4)

Since 0 and x are independent, we may write

fe x(O , x) = f6 (0) fx(x). 5

To determine the area between the line segment AB and thelink we must determine the probability of AB crossing thelinik. Because of the symmetry of the domain, we needconsider only positive values of 0:

Pr [crossing]

= W/i2 tan' (W-x)/iWx =0 0 = tan-' (W/2 - x)IHW

fo.(0, x) d(0) d(x)

(3)

r nW - --nW- - -_*

A B z W/2x

(a)

iiwB z

V-h-.±x -------- -hIW/2

(b)

Fig. 5. Illustration of (a) a link not crossing, and (b) a link crossingthe boundary curve.

for either case. It is reasonable to assume that points A andB are independent.Case 1) AB Not Crossing the Link: Because of symmetry,

we only consider variation ofx and y in the range 0 < x 6 W/2and 0 < z < W/2. Consider Fig. 5(a). The area between ABand the link is

A = [(W/2 - x) + (W/2 - z)] nW/2

dis [Ca n; no cross]

rW/2 rW/2= i Jnwf fI Afxz(x,z)d(x)d(z)

where

fx (x, z) = fx(x) - f.(z) = 41/W2.

(9)

(10)=k[i+n + - 2VI2 + 1/4].

Similarly,

Pr [not crossing]

W/2 tan' (W/2 -X)/IiW= t~~~~~~ox(O, x) d(f) d(x)

x=0 =o

rw *tan-l (w- x)/nWW fox(0, x) d(0) d(x)X=W/20=0

=k[2N/n + 1/4- 2h].

Since Pr [crossing] + Pr [not crossing] = 1, we obtain

r2 +[1/4 -2Pr [cr-ossing] = 1-2.In

The values of Pr [crossing] for different rings are shown inTable I.As can be observed from Table I, the probability of crossing

quickly approaches the probability of not crossing. Thisimplies that, for values of n greater than 2, the two pointsA and B can be considered independent of each other.Knowing the probabilities of line AB crossing and not cross-

ing the link, we proceed to determine the average distortion

(6) This gives

dis [Ca, n; no cross] = (1/4) W.

(7)

(11)

Case 2) AB Crossing the Link: We consider only positivevalues of 0. The domain of the link is shown in Fig. 5(b).The area between the link and AB is equal to

A = xhx/2 + zhz/2

x + z (12)

dis [Ca,n;cross]

oW/2 rW/2= li/W 2 f Af. (x,z) d(x) d(z)

x=o z=O

(8) where

fxz(x, z) =4/W2.This gives

dis [Ca, n; cross] = (1/3 1og,2 - 1/12) W.

Since

dis [Ca, n] = dis [Ca n; cross] Pr [crossing]

+ dis [Ca, n; no cross] Pr [not crossing],

(13)

(14)

Page 5: Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

SAGHRI AND FREEMAN: GENERALIZED CHAIN CODES

we obtain

=- [loge2 - +2 2(1-loge2) n q.

(15)

The maximum value of dis [Ca, n] occurs at a = 0 for n = 1:

max dis [Ca,n]= dis [C0,1 ] = 0.20600 q.

The minimum of dis [Ca,n,] occurs at a = n = oo, or,

min dis [Ca,n] = dis [C.O] = 0.140613 q.

Thus we have

0.14061 q<dis [Ca,n] S0.20600q

where

n = 1, 2, . ..

a=0, 1, * * ,n.

(16)

(17)

TABLE HIAVERAGE QUANTIZATION ERROR FOR SINGLE-RING CODES

ring order n dis [(n)-code]

1 0.17957 q2 0.18037 q3 0.18055 q4 0.18064 q

where

n= 1,2,-

a = 152,- - ,(n- 1)a#0, and atn

Pr[Co, nI = V7 [n +I-n]

(18) Pr[Cn,n] = 1 - 2n + N/4n2 - 4n+ 2.

IV. AVERAGE QUANTIZATION ERRORLet us now look at the average quantization error. We shall

assume that the variation of q is within the range (linear range)that limits the maximum distortion to less than 1/2q.

If the characteristics of a chain are known, then the average

distortion is obtained simply by multiplying the probabilityof each link class by its corresponding average local distortion.Thus, for a (t1, * , ts)-code,

stidis [(t1, , ts)-code] = E E dis [Ca, ti] Pr [Ca,tj]

i=l a=o

where

links of class Ca,tjtPr [Ca,ti = . (I19)total links

and where the ti are the ring numbers of the code.Note that for any code the average distortion must satisfy

the bounds of the average local distortion specified in (18),that is,

0.140613 q < dis [tl, , t5)-code] < 0.20600 q. (20)

This bound is a characteristic of the selected quantizingscheme. It is a rather loose bound. Ideally, it is best toachieve the narrowest possible bound. Later on a muchtighter bound for average global distortion will be givenwhich, in effect, permits relating the distortion of a codedirectly to the selected grid size.The average distortion of a single-ring code, (n)-code, is a

linear combination of the average distortions associated witheach of its n + 1 link classes:

dis [(n)-code] = E Pr [Ca, n I dis [Ca, n (21)a =0

In [5] and [9] it is shown that the link-class probabilities are

constant for a single-ring code, that is,

Pr [Ca,nI Pr[Ca,n In]2- [ n2 + (a + 1)2++ n2 + (a - 1)2

-2 n2+a2]

Thus the value of the average distortion of a single-ring codecan be determined by substituting the values of dis [Ca, n]and Pr[Ca, n] from (15) and (22) into (21).Table II shows the values of dis [(n)-code] for the first

four rings. As can be seen from this table, the average distor-tion for single-ring codes remains essentially unchanged fornearly the first three decimal places. This result is very sig-nificant in determining the average distortion for a multiringcode.The average distortion of a multiring code is a linear com-

bination of the average distortions of the single-ring codes in-cluded in the set. If the probability of each ring in the code,Pr [ti], is known, then we have

dis [(tl, * * *, t,)-code] = E Pr [ti] dis [(ti)-code]. (23)i=1

From the results for single-ring distortion (Table II) we con-

clude that, regardless of a ring's probability distribution andthe particular code chosen, the average distortion must satisfythe extremely tight bound of

(24)

For all practical purposes, we may thus conclude that theaverage distortion is directly proportional to the grid size,that is,

dis [(tl, * * , t5)-code] = 0.1810 q. (25)

In the next section we will show that this result is indeed infull agreement with experimental results.

It is important to note that (25) holds for only a certainrange of q for each code. This "linear" range of q is boundedby a maximum qmax defined as the grid size beyond whichthe maximum distortion exceeds 1/2q.In order to determine whether a grid size is within the linear

range of a code, the total ring probability distribution for thatgrid size must be determined [9]. The probability of ring n,

Pr [Rn],is given by

n

Pr [Rn] = E Pr [Ca,nIIa=o

(26)

(22)

537

0.1795 q < dis [(tl, - - -

, t,)-codej < 0.1810 q.

Page 6: Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

538 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 5, SEPTEMBER 1981

-- --- - 32 --

D

Fig. 6. Original spline-fitted sample blob consisting of 82 sections ofcubic polynomials.

If for a grid size q, ring i is the smallest ring with nonzeroprobability, then all the candidate codes must contain a ringof order i or less. Otherwise the maximum distortion will beexceeded.

V. EXPERIMENTAL RESULTSThe actual average quantization error for an encoded test

sample was determined at various levels of resolution forseveral different generalized chain codes. The results werethen compared against values computed using the methoddescribed in the preceding section.To facilitate the precise determination of the average error,

a contour was drawn by hand and then represented by an 82-segment cubic spline curve. The original hand-drawn curvewas then discarded and the spline was defined as the "true"curve for which a chain approximation was sought. Since thecurve to be encoded thus existed in a mathematically deflnedform, a computer program could be written that would bothdo the generalized chain encoding and compute the error be-tween the curve and different chain approximations. Theaverage error was then taken as the ratio of the total area errordivided by the length of the curve.A computer-generated plot of the spline-represented test

curve is shown in Fig. 6. Two codes were selected, the (1)-code and the (1, 3)-code. For each code the grid size wasvaried from 0.05 to 3.0 in steps of 0.01, and a chain repre-sentation was determined using the quantization methoddescribed earlier for each grid size. The average quantiza-tion errors were then computed for each; the results areplotted in Figs. 7 and 8. (The grid spacing of 1 is shownin the lower left-hand corner of Fig. 6. The distortion inFigs. 7 and 8 is measured to this same scale.) The slopes ofthe distortion curves in Figs. 7 and 8 are 0.181 for the (1)-code and 0.179 for the (1, 3)-code, respectively. The gradualincrease in the fluctuation of the data points with increasinggrid size is a consequence of the gradual increase in the sen-

0

u .2 .4 .6 .8 1.0 1.2 1.4 1.6

GRID SIZE q

Fig. 7. Average distortion as a function of grid size q for (1)-code.

3

. .2 5

.2

.15

GRID SIZE q

Fig. 8. Average distortion as a function of grid size q for (1, 3)-code.

sitivity of the averaging process to the curvature variation ofthe test curve as the number of links decreases.The experimental values for the slopes of the average distor-

tion plots agree well with the analytical value of 0.18101 givenby (25).

VI. CONCLUSION

It has been shown that the generalized chain codes providethe possibility for high-quality straight-line-segment approxi-mation of planar curves. The average quantization error (mea-sure of code's precision) was found to be directly proportionalto the grid size, regardless of the particular code chosen. Thus,to achieve a desired level of precision, only the size of the gridneed be determined. Selection of the actual code can then bemade to depend on other properties of the curves to be en-coded or the chain representations desired (e.g., compactness,smoothness, processing speed, etc.).

REFERENCES

[11[2]

H. Freeman, "Computer processing of line-drawing data," Com-puting Surveys, vol. 6, no. 1, pp. 57-96, 1974.

, "Analysis of line drawings," in Proc. NATO Adv. Study Inst.Digital Image Processing, Bonas, France, June 1976 (publ. asDigital Image Processing and Analysis, J. C. Simon and A. Rosen-feld, Eds. Leyden: Noordhoff, 1977).

. 2 I1.2 1.,4 1 .6

Page 7: Analysis of the Precision of Generalized Chain Codes for the Representation of Planar Curves

SAGHRI AND FREEMAN: GENERALIZED CHAIN CODES

[3] -, "Application of the generalized chain coding scheme to mapdata and image processing," in Proc. IEEE Comput. Soc. ConfPattern Recognition Map Data Processing, Chicago, IL, May 31-June 2, 1978.

[4] H. Freeman and J. A. Saghri, "Generalized chain codes for planarcurves," presented at 4th Int. Joint Conf. Pattern Recognition,Kyoto, Japan, Nov. 1978.

[51 -, "Comparative analysis of line-drawing modelling schemes,"Comput. Graphics Image Processing, vol. 12, pp. 203-223, 1980.

[6] F. C. A. Groen and P. W. Verbeek, "Freeman-code probabilitiesof object boundary quantized contours," Comput. Graphics ImageProcessing, vol. 7, pp. 391-402, 1978.

[7] F. C. A. Groen, Analysis of DNA Based Measurement MethodsApplied to Human Chromosome Classification. Pijnacker: DutchEfficiency Bureau, 1977.

[8] H. Freeman and J. M. Glass, "On the quantization of line-drawingdata," IEEE Trans. Syst. Sci. Cybern., vol. SSC-5, pp. 70-79,Jan. 1969.

[9] J. A. Saghri, "Efficient encoding of line-drawing data with gen-eralized chain codes," Rensselaer Polytechnic Institute, Troy,NY, Tech. Rep. IPL-TR-003 (Ph.D. dissertation), 1979.

John A. Saghri received the B.S. degree in elec-tronics engineering from California PolytechnicState University, San Luis Obispo, in 1973, theM.S. degree in electrical and computer engineer-ing from Oregon State University, Corvallis, in1975, and the Ph.D. degree from RensselaerPolytechnic Institute, Troy, NY, in 1979.From 1978 to 1979 he was an Instructor with

the Department of Electrical Engineering at_g - _ Rensselaer Polytechnic Institute. Since 1979

he has been with The Aerospace Corporation,

El Segundo, CA. His research interests include digital and optical signalprocessing, computer graphics, and pattern recognition.Dr. Saghri is a member of the Society of Photo-Optical Instrumenta-

tion Engineers.

Herbert Freeman (A'49-M'49-SM'54-F'67) re-ceived the B.S.E.E. degree from Union College,Schenectady, NY, in 1946, and the M.S. andDr.Eng.Sc. degrees in electrical engineeringfrom Columbia University, New York, NY,in 1948 and 1956, respectively.He joined the Sperry Gyroscope Company,

Great Neck, NY, in 1946 and designed Sperry'sfirst digital computer, the SPEEDAC, in theearly 1950's. In September 1960 he joinedthe Department of Electrical Engineering, New

York University, NY, and served as Chairman of the department from1968 to 1973. Since 1975 he has been a Professor of Computer Engi-neering at Rensselaer Polytechnic Institute, Troy, NY. He has been aVisiting Professor at M.I.T. (1958-1959), at the Swiss Federal Instituteof Technology, Zurich (1966), and the Computer Science Research In-stitute, Pisa, Italy (1973). He was the recipient of a National ScienceFoundation Senior Post-Doctoral Fellowship (1966) and a GuggenheimFellowship (1973). He is the author of over 60 technical papers andthe book Discrete Time Systems, as well as an edited volume, Inter-active Computer Graphics. He is one of the founders and Editors ofthe international journal Computer Graphics and Image Processing,and Associate Editor of the journals Calcolo and Pattern Recognition.He has been active in the International Federation for InformationProcessing since 1962; he was Program Chairman for IFIP Congress 74held in Stockholm in August 1974 and has received the IFIP Silver CoreAward. Since 1976 he has been active in the affairs of the InternationalAssociation for Pattern Recognition, serving as Treasurer from 1976 to1978 and as President from 1978 to 1980.Dr. Freeman is a Registered Professional Engineer in the State of New

York, and a member of ACM, Sigma Xi, the Society for InformationDisplay, and the Pattern Recognition Society.

539


Recommended