Computer linguistic analysis of line drawings

Computer linguistic analysis of line drawings

0031 3203/84 $3.00+ .00 Pergamon Press Ltd. ~( 1984 Pattern Recognition Society Pattern Recoqnifion Vol. 17, No. 4, pp. 433 440, 1984. Printed in Gre...

622KB Sizes 0 Downloads 50 Views

0031 3203/84 $3.00+ .00 Pergamon Press Ltd. ~( 1984 Pattern Recognition Society

Pattern Recoqnifion Vol. 17, No. 4, pp. 433 440, 1984. Printed in Great Britain.

COMPUTER LINGUISTIC ANALYSIS OF LINE DRAWINGS GOTCttO V. GOTCItl!V Department of Computer Engineering, Higher Institute of Mechanical and Electrical Engineering, 1156 Sofia, Bulgaria

(Received 3 Auqust 1982; in revisedform 7 June 1983; receivedfor publication 12 October 1983) Abstract--A phrase-structure language for the formal description of line drawings is presented. On the basis of the descriptions, a computer analysis and recognition of the corresponding drawings is made. Alphanumerical characters are examined. The descriptions are used to find out what kind of simple drawings are included in a complex line drawing, if we treat the line drawing as a non-directed graph, its description will help us in determining all the simple circuits of the graph, the minimal set of edges breaking all circuits, etc. The language is also adequate for describing three-dimensional (3D) line drawings. Syntactical analysis and drawing recognition dimensional geometrical drawings

Linguistic analysis of graphs

I. I N T R O D U C T I O N

The development of languages for the description of line drawings is of great interest in computer recognition. The elements of the language usually correspond to the structurally characteristic elements of the drawings. Consequently, in analyzing the description of a given line drawing, information can be extracted from its structure that is necessary for the solution of certain problems, for example, its recognition. Of all the languages for line-drawing description used in the relevant literature, the phrasestructure language proposed by BreedingIt) is of special interest. The object of this paper is a phrasestructure language for describing line drawings and the application of the language in the analysis and recognition of concrete classes of line drawings. 2. D E S C R I P T I O N O F T H E L A N G U A G E G R A M M A R

It is proposed that the grammar of the language for describing line drawings should consist of five elements

G = {Vt, V,, W , S , R } , where Vt is a non empty set which consists of terminals of the language, V, is a non empty set which consists of non terminals, W is a set of rules for the construction of strings (descriptions) from the elements of V = V, w V,; V, c~ V, = ~ (the elements of the descriptions are obtained in the process of tracing the lines of a given drawing following the rules given below), S E V, determines the basic analyzed unit obtained in the process of description--the sentence (the presence of the symbol S for a given sentence permits the beginning of its analysis, S being an initial symbol in the process of description generating) and R

Recognition of three-

is a set of transformations over the line drawing with respect to which the descriptions obtained are invariant. Here V, = {(Structural features), (Directions), (Punctuation)} where (Structural features): = P, IP2IP3[ ... IP, I ... IP,, with ] denoting "or", : = denoting "accepts", and Pi representing "structural features" (i = 1, 2.... t, t being the number of features). The structural features represent topologically specific parts of a line drawing: a line end, an angle, a crossing of lines, etc. Methods and algorithms for automatic determination of the structural features of the line drawing are beyond the scope of the present paper. (Directions): = 11213141516[718 A set of directions (Fig. 1) for determination of the mutual positions of the structural features is used in this paper. (Punctuation): = , j;J :1-1" Also, V, = {(Word), (Phrase), (Open phrase), (Closed phrase), (Complex phrase), (Closing phrase), (Sentence), (Page)} where (Word) : = (Structural feature) I (Directions): = Pilh with P~ being structural feature as defined above, i ~ 1, 2. . . . . t, and/1 being a concrete direction, h ~ l , 2 ..... 8. 7

3 Fig. I. Directions. 433

434

Go](lio V. GOT('ttliV

Ifa set of line drawings is drawn on the input field, then they are subsequently described and the set of descriptions forms a page. (Page): = (Sentence) (Asterisk) I (Sequence of P,PjhIP,Pi i ~ j ~ 1, 2 ..... t. Definition. Each phrase describes a relation between sentences) (Asterisk) two structural features determining a continuous line The end of a page is noted by an asterisk. Each sentence obtained in the process of description (its beginning and end) or two structural features corresponds to a real line drawing on the input field. determining a line. The phrase is recorded with or without a direction The minimal length of a line which is described in a depending on the task carried out. The information given direction is three sequentially connected points giving the direction is not used in the cases of some (receptors). An isolated point or two connected isotasks and in order to obtain more simplified de- lated points are not described and, if they are come upon in the process of the analysis, they are deleted. scriptions it is omitted. (Open phrase): = (Phrase) ( C o m m a ) : = PiPjh, The phrases are written sequentially as they are obtained in the process of tracing and describing the IP,Pj, Definition. An open phrase indicates that the last line drawings. They are separated by means of the feature is not a line end in the tracing of the line elements of punctuation. The sentences are separated drawing; there are lines coming out of it. The open by means of a full stop. The coordinates of the centres of the features are stored in the process of determining phrase ends in a comma. the structural features and it is these centres that set the (Closed phrase): = (Phrase) (Semi-colon): = beginning and the end of the lines (the features arc e,P/,; IP,P~; Definition. The closed phrase indicates that the last separated by a receptor field with dimensions 5 x 5). feature is an end of a line. The closed phrase ends in a The feature's coordinates are necessary, since in the process of description it is possible to turn more than semi-colon. once to a given feature. Moreover, the coordinates are (Complex phrase): = (Complex open phrase) necessary also in the computation of some accurate J(Complexclosed phrase) (Complex open phrase): = (Phrase) (Open characteristics of the line drawing (length, perimeter, surface, etc.). The coordinates do not participate in the phrase) I(Sequence of phrases) (Open phrase) (Complex closed phrase): = (Phrase) (Closed formation of language elements and this is why the descriptions do not depend on the coordinates. This phrase) J(Sequence of phrases) (Closed phrase) Delinition. A complex phrase indicates that there are determines the invariance of the descriptions with respect to the following transformations (R): change of other lines which come out of a given line ; the direction scale, translation of the drawing from one place on the of the complex phrase is unchanged. (Closing phrase): = (Open phrase) (Colon) J input field to another, certain linear deformations (expansion, contraction). (Complex open phrase) (Colon) Consider the descriptions obtained according to the Definition. The closing phrase indicates that the traced grammar discussed for the drawings in Fig. 2a, assumcontour is "closed" in the given feature and all lines coming out of it have already been traced ; the closing ing that the drawings are given on one of the input fields. In that case the structural features automatically phrase ends in a colon. found are numbered as is shown in Fig. 2a. The priority (Sentence): = (Closed phrase) (Full stop) J(Phrase of tracing the lines coming out of a given feature (open, closed, complex closed)) (Closed phrase) follows Fig. 1, the directions with smaller numbers (Full stop) I (Sequence of phrases (open, closed, having higher priority. The following descriptions are complex, closing)) (Closed phrase) (Full stop) I obtained. (Sequence of phrases (open, closed, complex, closing)) (Closing phrase) (Full stop) PIP21 ; PIP33 P43; P3PsI ;. Definition. The sentence is a concrete phrase or a sequence of different phrases ending in a full stop. P6P71 ; P6Ps3 P93; PsPlo 1 ;. De/inition. If the sentence consists of only one closed phrase then the drawing is a straight line. PllPl21 ; PlxPn33 P143, Pl4Pls I ; P13Pt61 ;Delinition. The description of a connected drawing is obtained in the form of a sentence. PITPaaI ; Pl-zP193 P2o 3, P2oP211 ; PIgP221 ;. (Phrase): = (Structural feature) (Structural feature) (Direction) I (Structural feature) (Structural feature): =

P,

po~"~o Pb3

Pa

P'~

(a)

PI6 p2oL--p2, P,~

1:'6 P3

P2 P9

(b)

Fig. 2. Linear drawings and automatic numeration of the features.

Linguistic analysis o[ line drawings

435

Fig. 3. Complex line drawings. Each phrase includes the direction determining the mutual position of the features in a phrase. In a complex phrase, in order not to record one and the same feature two times in succession, each feature is put down in the first phrase and taken for granted in the next one. ifa classification of the structural features is made, the first two descriptions will be received equal in structure and contents, which points to the fact that they describe one and the same class of drawings. The last two descriptions will also be similar in structure and contents, describing another class of drawings. The experiments which were carried out with a special 60-element set of characters for the PL/1 Language (characters like a full stop, a comma, a semicolon, etc., were recorded with special linear characters) showed that it is sufficient to analyze the sequence-direction-phrase type for each sentence in order to divide the symbols into classes. In this way the classification of the structural features is avoided. This idea of classifying the descriptions of the symbols was used in the computer recognition of a graphical text with a program written in the PL/I Language. The following descriptions are obtained for the line drawings on Fig. 2b. PIP2, P2P3, P3PI,:. P,tPs, PsP6, P6P,t, :. P~Ps, PsPg, PgPv, :. Direction is not put down in the phrases of these descriptions since the information connected with direction is not used in the problems solved for 2D geometrical figures. The descriptions received are similar in structure. Each description contains three open phrases, the last one of which is part of a closing phrase. Consequently, each description defines three lines forming a closed contour, which may be looked upon as a definition of the class of geometrical figures called triangles. The description on the basis of the language proposed, the analysis and recognition of two-dimensional geometrical figures are discussed in another article) 2)

P,

P2 P6

P7

I

3. EXTRACTION OF CERTAIN INFORMATION FROM THE DESCRIPTIONS OF COMPLEX LINE DRAWINGS

In analysing the description elements, i.e. the phrases and their connections, the existence of certain information contained in the description can be looked for. Moreover, this information can repeatedly be used in the description. The description can contain information characterizing different classes of notions. This information is extracted from the description according to the learning accomplished by man. A set of line drawings is assigned to the input field, samples of which are shown on Fig. 3. The computer builds descriptions for the input drawings and is next taught the following: if three phrases (respectively straight lines) close (form a closed contour), they form a triangle. According to the rule of teaching, the tracing of each triangle contained in a given description (Fig. 4) consists in purposefully looking for three phrases with common features, the last phrase containing the feature the analysis began from (the sequence is closed). We shall not be concerned here with the concrete formalization of the algorithm, but this formalization is based on the following definitions. D@nition. The centres of the structural features of a given type of phrase lie on the line described by the phrase. De[tuition. Each complex phrase describes a line containing a number n of different lines (n/> 3, including the line itself). If a given phrase has k structural features, its corresponding line contains n = k(k - 1)/2 different lines. DeJinition. Only one line is considered from the lines described by a complex phrase in a certain search for a triangle by means of a description. After being taught and having analysed the descriptions, the computer answers a number of questions put by the operator. How many triangles are there in the jth drawing? Which are the concrete triangles found in the jth drawing? How many triangles have you found for all the input drawings?

P, ~, ¢2 ~, P3 ~, P, P,, P, P~P~,: P2 P~P,, :

U. ~ P,, P,%, g g,PgP,,P,%P,,P,2%,: P, P,,P,,P,,g,: P,oP,3, P,~P,2, P4

P3 P9 I

Pe

P,2 9'4' Pt. P,o' :"

II

Fig. 4. Descriptions of the corresponding line drawings.

436

Go rcHo V. G o t c n u v

P, Pz P3 P4. P5 P6 P-., P~

P~

p~

P ~ ~ P *

P, P~,: %P~,: ~ , :

~,,:

Q I I

I

I

I

I

0 I

I

I

I

0

I

0

I

I

I

0

P*

I

I

0

I

I

0

P~ P~ P,

I

I

I

0 I 0

I

I

I I oo o o oo

oo

P',,

P~

Pz

P3

P~

Ps

P~

P~,:

Fig. 5. Illustrative description of a graph. Which drawing contains the greatest number of triangles and how many are they? Which one of the ith and jth drawing has more triangles? etc. For each concrete triangle certain quantitative characteristicsTM can be computed and a dialogue can be carried on for the characteristics of a given triangle. A procedure in PL/1 was written for searching for triangles by the drawings' descriptions. The descriptions of the drawings are input arguments for this •procedure. The computer answers the questions: how many triangles have you found and which are they for the drawings in Fig. 4? Drawing I : 8 triangles, viz. Pt P2P3, Pl P2Ps, Pt PzP,,,

PzP3P4, P2P3Ps, P3P, PI, P3PaPs, PaPiPs. Drawing 2 : 1 6 triangles, viz. P6P7Ps, PoPTPII, P6PTP9, PTPsPg, PTPsPti, PsP9P6, PsP9PIt, P9P6P11, P,~oPI1P13, PloPIIPI,, PtoP12P13, PtoP12Pt,,, PtlPt2P13, PIIPI2PI,, P13Pl4Pl2,

feature is come upon which has already been traced, then a closing phrase is formed which ends with a colon. If the line drawing is introduced into the computer, then there will be a number of difficulties. For this reason, the adjacency matrix of the graph is introduced into the computer. An algorithm is proposed which, having the adjacency matrix for a given graph, builds a linguistic description in the language described above. The algorithm is as follows. 1. The adjacency matrix ;¢u is introduced, the array H i is nullified (i,j = 1, 2..... n). 2. i = 1 3. j = 0 4. j = j + 1 5. If~¢u = 0 then go to 4. 6. lfthe sum of the units for the row P~ has not been calculated (it is calculated only when the row is chosen for the first time), then

K=I

PI3PI4PIo. Having been adequately taught, the computer differentiates other geometrical drawings, too, such as quadrangles, pentagons, etc., using the descriptions of the drawings. Since each geometrical figure is a closed contour, the following task was set : find all closed contours for the drawing and fhen determine for each contour what geometrical figure it is by the number of lines contained in the contour. The learning rule is defined as follows: a connected sequence of phrases with common features which is closed (the last feature being the same as the first one) forms a closed contour. This rule, however, corresponds to the definition of a simple circuit in a graph3 31The problem arises on the basis of a linguistic description of a graph according to the language treated, where all simple circuits of this graph are to be determined. Some simple (i.e. not having loops and multiple edges), connected and non-directed graphs are discussed. A new definition of a closing phrase is given for the description of graphs, which presents a simpler solution to some problems. Delmition. if in the process of tracing a drawing, a

7. If the sum of the units for row Pi is not calculated, then

L Hj = ~ :¢iK K=I

8. The Pj row from t h e ~ matrix is taken, lfthe Pj row is not taken for the first time, then a closing phrase is written (PiPj,:) and go to 11. 9. If row Pj contains only one unit, then a closed phrase is written (PiPj;) and go to 11. 10. An open phrase is written (PiPj,) 11. ;#ij = :¢ji = 0 ; H i = H i -

1 ; Hj = H i -

1.

12. IfHj ~ 0, then i = j and go to 3. 13. m = 0 14.

m = m +

1

15. If H,,, #- 0, then i = m and go to 3. 16. l f m < n, then go to 14. 17. The sentence is completed with a full stop. 18. End. According to the algorithm discussed, the graph shown in Fig. 5 by its adjacency matrix gets the

Linguistic analysis of line drawings

C

437

Beginning )

t Introduction of description OK

I

J

1

i=O L1 ,

1 ,=,,, I

'1

Wrlt,ng down the phrase ( included in the closing phrase ) into the array E" Yes I

Not

~ Yes Print af the array E"

Fig. 6. Block-diagram of the algorithm for the determination of E".

description given for the same figure. The linguistic description of a given graph can be used for concrete information extraction from this graph. The first problem solved was the algorithm for the determination of all simple circuits for a given graph. The purposeful tracing of circuits on the basis of the linguistic description is realized according to the learning rule for searching for a closed contour, as defined above. Another problem, which had a simple solution on the basis of the linguistic description, is the founding of a minimal set of edges breaking all circuits of the graph. The problem is defined as searching a given graph G = (P, E) (where P is the set of vertexes, E is the set of edges) for a subgraph (tree) G' = (P', E') for which P' = P, E' ___E such that, ifat least one edge of the set E" (E" c~ E' = ~ ; E" L) E' = E) is added to E', then the subgraph is no longer a tree and a circuit is formed on it. The aim is to find a set of edges E". Proposition. A minimal set of edges breaking all circuits is equal to the edges corresponding to the phrases included in the closing phrases. The truthfulness of this proposition is determined by the algorithm for building of a description by means of the adjacency matrix of the graph. Each graph P~P# edge is traced only once. The algorithm discussed does not allow the tracing of a path to begin with a feature which is an end to a line, but only a beginning. Each closing phrase indicates that some chain ofedges is closed, since there is pR

17/4-E

a vertex which has already been traced. Consequently, a circuit has been formed which will be broken if the closing phrase is left out. In Fig. 6 the algorithm is given to determine the E" set. According to the description in Fig. 5, the following set of edges breaking all circuits is obtained for the graph in the same figure. E" = P3PI, P4P2, PsPI, P6P2, P3P4, P4Ps, PsP3, P3P6, P6P4, PsP6

The tree obtained is shown in Fig. 5. As can be seen from the method proposed and from the example analysing the grammatical information of the description, we can find those edges of the graph which break all circuits. Other problems can also be solved on the basis of the linguistic descriptions of graphs. Our aim however, was, to show that in analysing the linguistic descriptions of graphs we can extract concrete information about the graphs. Using the grammatical information in the descriptions, the solution of some problems can be achieved simply and quickly. 4. ANALYSIS, DESCRIPTION AND RECOGNITION OF 3D LINE DRAWINGS

Erect, convex prisms (in this particular case, parallelepipeds and cubes) are discussed, having no cammoil points and no body obstructing the others. It is

438

GOTCHO V. GOTCHEV

Kmd of feature No "fork"type

Btnory vector I

2

3

4

5

6

7

8

D~spositton of faces having corresponding vertex "fork" type

f

0

I

0

0

I

0

0

1,3-FF;I,6-uF;

I

0

0

I

0

I

0

0

1,4-RF;

1,6-UF; 4,6-LF;

I

0

0

I

0

0

I

0

1,4-RF;

I 7-UF;

0

I

0

I

0

0

I

0

2,4-FF;2,7-UF;4,7-LF;

6

I 2

N~-I 6% N/'~l 4/

3

I

3,6-LF';

4,7-LF;

4 4

4

2

5

I ' 7 5 ----I~

0

I

0

0

I

0

I

0

2,5-LF;

6

2 j , 8 5 "~.. 2

0

I

0

0

I

0

0

1

2 , 5 - L F ; 2 , 8 - RF; 5 , 8 - U F

7

5~'

0

0

I

0

I

0

0

I

5 , 5 - FF; 3 , 8 - R F ; 5 , 8 - U F ,

0

0

I

0

0

I

0

t

.5,6-LF;3,8-RF;6,8-UF;

N

.,8 6 8

%

/

Y3

2,7-RF,

5,7-UF;

8

Legend:

F F - f r o n t face L F - Left face

UF - upper face R F - r t g h t face

Fig. 7. Features of the "fork" type and the relation of faces.

assumed that the viewing point allows for a maximum number of adjacent faces to be seen. The shadows of the figures and the holes in the faces are not treated. The essence of the problem lies in the composition of a linguistic description of the 3D line drawing (2D projections of the 3D geometrical figure) and the extraction of the necessary information on the 3D geometrical figure by analysing the specific description. Analysing the given description, it is proposed in this section to automatically form answers to a number of questions posed by the operator concerning the elements and structure of the discussed geometrical figure, the final aim being its recognition. 1. How many faces can be seen on the drawing and how are they numbered? 2. What 2D geometrical figures do the separate faces represent ? 3. Which are the common edges of the faces? 4. What are the positions of the faces in relation to each other? 5. Which one of the faces is the base of the figure? 6. How many faces does the 3D geometrical figure have? 7. What kind of a 3D geometrical figure is the analysed drawing? etc. The following modification of a closing phrase is introduced for the building of the descriptions of 3D line drawings. Deh'nition. A closing phrase is formed only in those cases where the tracing of the drawing comes back to

the structural feature (vertex) from which the tracing of a given contour had begun. The following considerations necessitate the modification. 1. If the complete phrase-structure description of the drawing is obtained in the form of a one-dimensional vector, then it becomes more difficult to analyse the obtained one-dimensional sequence to determine the faces of the 3D geometrical figure and to form hypotheses about the connections of the faces and about the type of the figure as a whole. 2. A separate face is the basic structural unit in the analysis of a 3D geometrical figure. That is why the description of the face in the description of a 3D figure should be separated as a particular structural unit which can be independently processed. Based on the above considerations the algorithm for the description of 3D line drawings is synthesized so that the faces which can be seen are sequentially traced and described. Delinition. The drawing of each face seen on an unbroken 3D geometrical figure is a closed contour. According to the last two definitions, the description of each face will be obtained in the form of a onedimensional sequence of open phrases that ends with a closing phrase. The description for a 3D figure is formed as a two-dimensional array. It is obtained in the form of a sentence which ends with a full stop. Each row of the two-dimensional array corresponds to the description of the drawing of a face that can be seen. The following heuristics are introduced in order to

Linguistic analysis of line d r a w i n g s

P,

P,

P2

Line drawings

P,3xxI~_IJP,

P,

Descr tptlons of drawings

439

P,

P,

%

P,

P, P~,~ P~, P~P,, P, P,, : P, P2, P~ P~, P~ P,, : P, P~,~ P~,P3 P,, ~ P~,P~P,,: P, P~,P~P,, P, P~, P~P~,: P, P3,% P4, P4 P~, P~P,, P~P,, P, P,,% P~,~ P~, : P, P3,~ P6,~ P,, P, P,,: P2 P6, P, P,, P, P~, P~P~,: P, P~, %P,, P, P., P, P,,: Ps P4, P4P6,PePg, P9 Ps, : •

Whet kind of 2D geometrical figures are the separate faces ?

What are the common edges of the faces ?

I - triangle 2 - quadrangle 3 - quadrangle

2 - quadrangle 3 - quadrangle 4 - quadrangle

P2 P3

1,2

PzP3 - 1 , 3

P3P, - ~ , 3

P3P, - 1,2

PzP3- 1,2; Pr P3-2,3; P3 P4 - I, 3 ; P8 P4 -3,4; P,%- 1,4;

P6P3

-

-2,3

PaP4 - 2 , 5

What are the tree-face vertexes ? How (]re the faces positioned with respect to one another ?

I - pentagon

I - quadrangte 2 - quadrangle :3 - quadrangle

%

%;P,

I-UF 2-RF

I -UF

I -UF

2-LF

3-FF

3-RF

2 -RF 3 -FF 4 -LF

What 2D geometrical figure is the base ?

QuadrangLe

TriangLe

Pentagon

Whet ~s the 3D figure ?

QuadranguLar prism

TrianguLar prism

PentagonaL prism

Fig. 8. Examples of description, analysis and recognition of 3D geometrical figures. obtain the descriptions of the faces sequentially. Rule I. The tracing of the lines of the 3D line drawings is clockwise. Rule 2. The selection of a line from the lines coming out of a given vertex of the drawing is made in the process of tracing anti-clockwise to the direction of the line penetrating the given vertex. Rule 3. The tracing of the drawing begins with a structural feature (at the beginning with the first separate one) according to the eight-order binary vector of directions formed for it (Fig. 1), the units showing in what directions there are lines coming out of a vertex, following Rule 1. Rules I and 2 hold, since the drawing of the faces are closed contours and each closed contour can be traced clockwise. Applying Rules 1 and 2, the faces of the 3D geometrical figure are sequentially singled out and described. Rule 4. For each traced line coming out of a given vertex P~, the corresponding order of the vector of directions H i (i e 1, 2, ..., t, where t is the number of vertexes) defining the line direction is nullified. Rule 5. Having described a given face, the further

description begins with the next vertex P~ for which the corresponding vector of directions H~ is different from zero, according to Rule 3. It is necessary for the realization of the condition of Rule 3 to keep the direction vectors in their initial form in separating the vertices {P}. For this reason the set {n} --* {n'} is duplicated. Rule 6. The description of the 3D line drawing ends when each vector {H} of the corresponding vertices {P} becomes equal to zero. The realization of the rules above gives the algorithm for the description of 3D line drawings. The condition that each closed contour can be traced clockwise, together with Rules 4 and 6, determines the convergence of the algorithm. The automatically obtained descriptions for the corresponding threedimensional figures are given in Fig. 8. In the description of a given drawing, the number of rows ending with closing phrases will determine the number of the visible faces. The faces are numbered in the order in which their descriptions are obtained. Analysing each row of the two-dimensional array, we can determine what kind of 2D geometrical figures the

440

G~rrcHo V. GOTCHEV

separate faces represent--triangles, quadrangles, etc. l'his analysis comprises the determination of the number of simple open phrases in one row (including also an open phrase in a closing phrase): if this number is three, then the face is a triangle; if four, a quadrangle ; etc. The common edges of the faces are found if the edges determined by the phrases of the description of the 3D figure are compared. If, for example, the edge P~Pp is common to the faces bearing numbers k and r, then this is indicated in the following manner--P~Pa-k, r. Having found the common edges for the faces, these common edges, vertices of the "fork" type (after Guzmanl41), are traced. To fulfill the condition that there is a maximum number of visible faces, it is necessary to have more than one of the "fork" vertices on the drawing. This type of vertex formally allows us to determine very easily the mutual position of the faces. The determination of the vertices of the "fork" type is accomplished by comparing the eight-order codes of the directions of the vertices belonging to three faces with the binary vectors, in Fig. 7. In this figure, the possible kinds of the "fork" type vertices are given, with the condition that the directions are approximated to eight. On the same table, the eightorder binary vectors of the directions are given, determining the corresponding vertices and the concrete position of the faces with respect to a given vertex of the "fork" type. Having found a vertex of the "fork" type, the mutual position of the faces is determined, the vertex being a common one. This is done following Fig. 7 and is written in the following manner : k-QF, where k is the number of faces, Q is front/upper/left/right and F is the face. If there is more than one vertex of the "fork" type on the drawing, then the mutual position of the corresponding faces including these vertices are determined. The base of the prism is determined like the upper face it is parallel to or the face which is not a quadrangle. The prism is respectively called triangular, quadrangular, pentagonal, etc., depending on what kind of 2D geometrical figure the base presents in the process of recognition of the assumed restricted class of 3D figures. Considering the number of edges of the base, a decision is made for the number of the adjacent faces of the prism. In Fig. 8 the results are given from computer modelling of the proposed ideas for concrete 3D figures and the concrete dialogue with the computer on the basis of the obtained linguistic descriptions. Enlarging the catalogue (Fig. 7) with other vertices characteristic of the 2D projections of 3D geometrical figures, the restrictions concerning the 3D geometrical figures can be reduced in number.

5. CONCI,USION

One of the aims of this article was to show the use of the linguistic approach in the analysis and recognition of line drawings. Using the language proposed a number of problems of different complexity are solved. From a methodological point of view, the tasks .set gradually increased in complexity, while the programs used for solving the easier problems are used in solving more complex ones if necessary. For obtaining a simpler solution to some problems, it was only the closing phrase that was modified. A program system in PL/1 was written for the solution of all problems discussed. The set of programs for the solution of a given problem is automatically determined by the concrete problem. On the basis of the problems solved, a dialogue is organized between the operator and the computer concerning the structure and the qualitative and quantitative characteristics of the line drawings. SUMMARY In the paper a phrase-structure language for describing line drawings by means of computers is discussed. On the basis of the descriptions obtained, a computer analysis and recognition is made of the corresponding drawings. The problem of description and recognition of alphanumeric characters is discussed. From the descriptions of complex line drawings, concrete information is extracted, such as the number of triangles, quadrangles, etc., that the complex line drawing contains. Treating the line drawing as a non-directed graph, its description helps us 1o determine all simple circuits of the graph, the minimal set of edges breaking all circuits, etc. The language used is convenient for the description of some 3D line drawings. Using the descriptions, the analysis and recognition of 3D geometrical figures is made. On the basis of the problems solved, a dialogue is organized between the operator and the computer concerning the structure and the qualitative and quantitative characteristics of the line drawings. REFERENCES 1. D.K. Breeding, A pattern description language PADEL, Pattern Recognition 1 (1972). 2. B. Borovsky and G. Gotchev, Computer analysis and recognition of two-dimensional linear geometrical pictures, Comput. Graphics 5, 83-86 (1980). 3. F. Harary, Graph Theory. Addison Wesley, Reading MA (1969). 4. A. Guzman, Decomposition of a visual scene into bodies, Proc. Fall Joint Computer Cot~. American Federation of Information Processing Scientists. Vol. 33, pp. 291-304 (1968}.

About the Author--GoTcHO V. GOTCHIiVwas born in 1942. He studied at the Higher Institute of Electrical

Engineering in Leningrad, U.S.S.R., from 1962 to 1968,graduating with a major in computer science. In 1975 he receivedhis Ph.D. degree from the same institute for his work on "Treating the development of hierarchical recognition system". Since 1968 he has been working at the Department of Computer Engineering at the Higher Institute of Mechanical and Electrical Engineering, Sofia.