• Keine Ergebnisse gefunden

3. Syntactic Assembly Modeling 27

4.2. Graphs as the Semantics of Syntactically Derived Plans

4.2.2. Labeled Graphs

Graph theory has a longer tradition than relational modeling. Not surprisingly, it thus has its own terminology. In the following, we will adopt this terminology and base our discussion on definitions by Messmer and Bunke [22, 82, 83]. A directed labeled graph Γ is a 4-tuple Γ = (V, E, µ, ν) where

V is a set of vertices

E is a set of edges whereE ⊆V ×V

µ is a function assigning labels to vertices, i.e. µ:V →LV ν is a function assigning labels to edges, i.e.ν :E →LE

and LV and LE are sets of vertex and edge labels, respectively2. From this definition it is obvious that labeled graphs are isomorphic to binary relational models. If we choose LV = (A×V)L, a labeled vertex corresponds to a primitive. And withLE = (A×V)Lk each labeled edge corresponds to a relation rjk∈Rk⊆P2×(A×V)Lk.

In the following, we will also need the notion ofsubgraphs. A graph Σ = (V0, E0, µ0, ν0) is asubgraph of Γ = (V, E, µ, ν) if

1. V0 ⊆V

2. E0 =E∩(V0×V0) 3. µ0(v) =

( µ(v) ifv∈V0 undefined otherwise 4. ν0(e) =

( ν(e) ife∈E0 undefined otherwise

Labeled graphs are widely applied in many fields of computer science. We will con-centrate on their application in knowledge representation for image analysis. Here, graph vertices usually represent objects, object parts, or other entities expected in an image while the edges represent known or important relations among them. Bunke [20] points out that the choice of objects, entities, or events represented by the vertices is arbitrary.

Except from their suitableness for a given application there are no criteria what prim-itives and relations should be represented. Knowledge representation based on graphs thus is rather an art that requires experience and careful thought of what information is available and helpful in solving recognition tasks.

After syntactic image analysis, high-level assembly plans provide the most compre-hensive information about individual assemblies. We already explained that they describe

2We denote graphs by Γ in order to distinguish them from grammars already termedG.

how elementary objects are interconnected and thus provide topologically unique charac-terizations ofbaufixrassemblies. Therefore, connection details may be used to recognize assemblies. But part topology is not self-evident from a sequence plan for the connec-tion details are encoded implicitly. Moreover, syntactically different plans of an assembly will encode these relations differently. A labeled graph, however, might explicitly reflect characteristic relations and simultaneously resolve syntactic ambiguities.

Since our general interest lies in compact descriptions and we want to avoid redun-dancies, the first step towards graph modeling ofbaufixrassemblies must be to consider what information from syntactic analysis enables recognition and should be modeled.

Remember that an assembly sequence plan as introduced in Chapter 3.3.1 directly or indirectly represents

• the elementary objects comprised in the assembly

• a syntactic structure they are organized in

• partial ordering relations among them

• the mating features of objects with holes

• diverse relations among mating features

• angles between bolts attached to the same object

The color of individual assembly parts is not contained in a plan. However, this is a mere question of simplicity. Color information is available from image analysis but would produce illegible plans if annotated. In the following, we will assume it to be given.

As we already know, the first three pieces of information in the above list are less specific than the following ones: a given set of objects might be assembled into many configurations (see Fig. 4.1) and a single configuration might have different syntactic structures. But different configurations involve different mating features and there will be different feature relations. Thus, relations between mating features comprehensively characterize how objects are interconnected; they determine the topology of an assembly.

This directly leads to the idea of a graph representation that captures the relations among mating features of elementary objects.

After choosing mating features to be the primitives of a graph based model for assembly recognition, we still need suitable attributes to discriminate them. In the baufixrdomain, a mating feature can, for instance, be characterized by its type and by the kind and color of the object it is part of. Consequently, we choose the range of the vertex labeling function µas follows

µ:V →T×O×C where

T ={HOLE, THREAD, . . .}

O={BOLT, CUBE, RNUT, . . .} C={red,orange,yellow,green, . . .}.

Our choice of significant relations among mating features is based on the following considerations. Modeling an assembly of several objects by means of the corresponding mating features is rather abstract. The degree of abstraction will be reduced, if features belonging to the same object are clustered so that object structures become visible. This could be accomplished by drawing edges from each mating feature of a certain object to all its other features. For an object withnmating features, however, this would introduce n(n−1) edges and thus might require unreasonable modeling effort. Instead, it would suffice to relate vertices of topologically adjacent features and label them respectively.

This will produce sets of interconnected vertices and yield the desired clustering.

Connections between features from different parts may be expressed using partial ordering relations. In Chapter 3.3.1 we pointed out that the components of a bolted attachment are linearly arranged in space. This also holds for the involved mating fea-tures and on page 52 we actually exploited that to extract connection details from image data. The resulting plans implicitly reflect these feature sequences as well: seen as a tree the syntactic structure of a sequence plan is such that elementary bolts will always be the leftmost leaf of a subtree. And if the tree is traversed from left to right, the objects and thus the features attached to a certain bolt will appear in the sequence they were put onto it. Drawing edges between vertices representing successive elements of such sequences yields chains of mating features and characterizes the topology of bolted part connections.

Finally, sequence plans like shown in Fig. 4.4(b) indirectly encode angles between bolts attached to the same object. Slots representing used holes of a bar are labeled with the corresponding bolt and with a flag indicating the side the bolt was inserted from. Hence, if there are several bolts attached to a bar, those with the same flag will be oriented parallel while those with different flags will be anti-parallel. And as the features of cubes are counted in a clockwise manner each pair of bolts attached to a cube can easily be labeled as perpendicular or anti-parallel. Actually, this summarized all possible relative orientations or angles between bolts. In the baufixrdomain, two bolts attached to the same object are either parallel (0), perpendicular (90), or anti-parallel (180).

Therefore, by choosing the range of the edge labeling function ν to be ν :E→ {ADJ,v,0,90,180}

comprehensive topological assembly knowledge can be represented in a mating feature graph.

The following example should illustrate what we are typically dealing with in practice.

Figure 4.4(c) depicts the mating feature graph derived from the plan in Fig. 4.4(b).

Its vertices represent subparts of elementary objects that are part of the assembly in

BOLT BOLT3

BOLT2 CUBE

1 1

CUBE2

BAR

(a)

ASSEMBLY(Highest Level) BOLT3

ASSEMBLY(Complex Nut) BOLT2

ASSEMBLY(Complex Misc) BOLT1

BAR1 () (BOLT1,a) () (BOLT2,a) () CUBE2 (BOLT1) () () ()

CUBE1 (BOLT2) () (BOLT3) () (b)

! #"

# #"

#"

"

(c)

Figure 4.4.: 4.4(a) An exemplary assembly known from the second chapter. 4.4(b) A cor-responding high-level sequence plan resulting from syntactic image analysis.

4.4(c) A graph describing relations among the mating features or subparts of the assembly. Subparts related by edges labeled ‘ADJ’ belong to the same object. Edges labeled ‘v’ indicate sequences of objects attached to a bolt and edges labeled with an angle represent the relative orientation between bolts attached to the same object.

Fig. 4.4(a). Each vertex is labeled with a feature type and with the type of object it belongs to. Furthermore, vertices are colored according to the object they are part of.

Subparts connected via pairs of edges labeled ‘ADJ’ belong to the same object. Thus, certain subgraphs of the graph represent elementary baufixrobjects: the bar is repre-sented by a cluster of five holes while the cubes are reprerepre-sented by their occupied holes and by their center of mass. The latter is due to the information available. As explained on page 52, the coordinates of a cube hole are computed from a geometric heuristic.

Since it only allows to determine coordinates of holes connected to a bolt, we decided to regard the center of a cube as a virtual mating feature in order to provide further information. Bolts are represented by their heads. These are no real mating features but their threads will seldom be visible. And furthermore, heads of bolts are natural mini-mal elements of partial orders that represent mating relations between objects. Chains of edges labeled ‘v’ indicate sequences of subparts attached to a certain bolt. Finally, for each pair of bolts connected to the same object, the corresponding ‘BOLT HEAD’ vertices are related via edges labeled with the angle the bolts enclose.

From the components of the graph we now can recognize the topological structure of the exemplary assembly. The ‘ADJ’ relations subdivide the graph into six clusters which represent the assembly’s elementary parts. The ‘v’ relations indicate that the yellow bolt is attached to the bar and the red cube and that one of the red bolts is attached to the bar and the yellow cube while the other is only assembled with the cube. We also see that the bolts attached to the bar are inserted into the holes on the left and right of the its center. As these bolts are related by edges labeled ‘0’ we can further conclude that they were inserted from the same direction. Finally, the angle of 180 between the bolts assembled with the yellow cube indicates that these are facing each other.