Geometric modeling and representation based on sweep mathematical morphology

Geometric modeling and representation based on sweep mathematical morphology

Information Sciences 171 (2005) 213–231 www.elsevier.com/locate/ins Geometric modeling and representation based on sweep mathematical morphology Fran...

308KB Sizes 0 Downloads 72 Views

Information Sciences 171 (2005) 213–231 www.elsevier.com/locate/ins

Geometric modeling and representation based on sweep mathematical morphology Frank Y. Shih *, Vijayalakshmi Gaddipati Computer Vision Laboratory, Department of Computer Science, College of Computing Sciences, New Jersey Institute of Technology, Newark, NJ 07102, USA Received 20 May 2003; received in revised form 29 March 2004; accepted 16 April 2004

Abstract We propose a framework for geometric modeling and representation by sweep mathematical morphology, which is based on set-theoretic concept together with geometric sweep. We use a new class of morphological operations that allows one to select varying shapes and orientations of structuring elements during the sweeping process. The sweep dilation/erosion provides a natural representation of sweep motion in manufacturing processes, and the sweep opening/closing provides variant degrees of smoothing in image filtering and edge linking. A set of grammatical rules that govern the generation of objects belonging to the same group can be defined. Earley’s parser serves in the screening process to determine whether a pattern is a part of the language. Sweep mathematical morphology is demonstrated as an intuitive and efficient tool for geometric modeling and representation. Ó 2004 Elsevier Inc. All rights reserved. Keywords: Mathematical morphology; Geometric modeling; Object representation; Pattern classification

*

Corresponding author. Tel.: +1-973-596-5654. E-mail address: [email protected] (F.Y. Shih).

0020-0255/$ - see front matter Ó 2004 Elsevier Inc. All rights reserved. doi:10.1016/j.ins.2004.04.002

214

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

1. Introduction Geometric modeling is the foundation for CAD/CAM integration. The goal of automated manufacturing inspection and robotic assembly is to generate a complete process automatically. The representation must not only possess the nominal geometric shapes, but also reason the geometric inaccuracies (or tolerances) into the locations and shapes of solid objects. Boundary representation and Constructed Solid Geometry (CSG) representation are popularly used as internal database [1,2] for geometric modeling. Boundary representation consists of two kinds of information––topological information and geometric information including vertex coordinates, surface equations, and connectivity between faces, edges, and vertices. There are several advantages in boundary representation: large domain, unambiguity, uniqueness, and explicit representation of faces, edges, and vertices. There are also several disadvantages: verbose data structure, difficulty in creating, difficulty in checking validity, and variational information unavailability. The CSG representation works by constructing a complex part by hierarchically combining simple primitives using Boolean set operations [3]. There are several advantages of using CSG representation: large domain, unambiguity, easy-to-check validity, and easy creativity. There are also several disadvantages: non-uniqueness, difficulty in editing graphically, input data redundancy, and variational information unavailability. The framework we propose for geometric modeling and representation is called sweep mathematical morphology, which is based on set-theoretic concept along with geometric sweep. The sweep operation to generate a volume by sweeping a primitive object along a space curve trajectory provides a natural design tool. The simplest sweep is linear extrusion defined by a 2-D area swept along a linear path normal to the plane of the area to create a volume [4]. Another sweep is rotational sweep defined by rotating a 2-D object about an axis. General sweep is useful in modeling the region swept out by a machine-tool cutting head or a robot following a path. General sweeps of 2-D cross-sections are known as generalized cylinders in computer vision and are usually modeled as parameterized 2-D cross-sections swept at right angles along an arbitrary curve. Being the simplest of general sweeps, generalized cylinders are somewhat easy to compute. However, general sweeps of solids are difficult to compute since the trajectory and object shape may make the sweep object self-intersect [5]. A generalized sweeping method for CSG modeling was developed by Shiroma et al. [6] to generate a swept volume. It is shown that the complex solid shapes can be generated with a blending surface to join two disconnected solids, fillet volumes for rounding corners, and swept volumes formed by the movement of NC (Numeric Control) tools. Ragothama and Shapiro [7] presented a B-Rep method for deformation in parametric solid modeling.

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

215

Mathematical morphology involves geometric analysis of shapes and textures in images. Appropriately used, mathematical morphological operations tend to simplify image data representing their essential shape characteristics and eliminating irrelevancies [8–11]. As object recognition, feature extraction, and defect detection correlate directly with shape, it becomes apparent that mathematical morphology is the natural processing approach to deal with machine vision recognition processes and visually guided robot problems. In this paper, we present a method for geometric modeling and representation based on sweep mathematical morphology. It is organized as follows. Section 2 presents the framework of sweep mathematical morphology. Section 3 describes modeling based on the sweep mathematical morphology. Section 4 describes the formal languages. Section 5 proposes the representation scheme for two-dimensional and three-dimensional objects. Section 6 introduces the adopted grammars. Section 7 applies the parsing algorithm to determine whether a given object belongs to the language. Conclusions are made in Section 8.

2. Sweep mathematical morphology Traditional morphological dilation and erosion perform vector additions or subtractions by translating a structuring element along an object. These operations have the limitation of fixed orientation and can represent the sweep motion only involving translation. By incorporating the variables of rotation and scaling, the entire theoretical framework becomes more flexible and contributes to many practical applications [12]. Sweep morphological dilation and erosion describe a motion of a structuring element that sweeps along the boundary of an object or an arbitrary curve by geometric transformations. Sweep mathematical morphology is defined as the four-tuple, WðB; A; S; HÞ, where B is a structuring element set representing a primitive object; A is either a curve path or a closed object whose boundary representing the sweep trajectory with a parameter t along which the structuring element B is swept; SðtÞ is a vector consisting of the scaling factors; HðtÞ is a vector consisting of the rotation angles. Note that both scaling factors and rotation angles are defined with respect to the parameter t of the sweep trajectory. Definition 1. Let A be an object and oA be its boundary. The sweep morphological dilation of A by B in Euclidean space, denoted by A  B, is defined as A  B ¼ fcjc ¼ a þ b for some a 2 A and b 2 ½B SðtÞ HðtÞ g:

216

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

Let the positive filling ½S þ of a set S denote the set of all points that are inside the outer boundary of S. The sweep dilation is equivalent to placing the structuring element on the boundary of A (i.e., oA) and taking the positive filling as A  B ¼ f[0 6 t 6 1 [b2B ½oAðtÞ þ b SðtÞ HðtÞ gþ : If A is a curve path (i.e., oA ¼ A), the sweep morphological dilation of A by B is defined as A  B ¼ [0 6 t 6 1 [b2B ½AðtÞ þ b SðtÞ HðtÞ : The dilation can be represented in the matrix form as follows. Let AðtÞ be represented by the matrix ½ax ðtÞ; ay ðtÞ; az ðtÞ , where 0 6 t 6 1. For every t, let the scaling factors be sx ðtÞ, sy ðtÞ, sz ðtÞ and the rotation factors be hx ðtÞ, hy ðtÞ, hz ðtÞ. By using the homogeneous coordinates, the scaling transformation matrix can be represented as 2 3 0 0 0 sx ðtÞ 6 0 sy ðtÞ 0 07 7: ½SðtÞ ¼ 6 4 0 0 sz ðtÞ 0 5 0 0 0 1 The rotation matrix about x-axis is represented as 2 3 1 0 0 0 6 0 cos hx ðtÞ sin hx ðtÞ 0 7 7 b½Rx ðtÞc ¼ 6 4 0  sin hx ðtÞ cos hx ðtÞ 0 5; 0 0 0 1 where ay ðt  1Þ  ay ðt þ 1Þ az ðt þ 1Þ  az ðt  1Þ ; sin hx ðtÞ ¼ ; hx hx qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi hx ¼ ðay ðt  1Þ  ay ðt þ 1ÞÞ2 þ ðaz ðt þ 1Þ  az ðt  1ÞÞ2 :

cos hx ðtÞ ¼

The rotation matrices about y- and z-axes can be derived similarly. Finally, the structuring element is translated by using 2 3 1 0 0 0 6 0 1 0 07 7: ½AðtÞ ¼ 6 4 0 0 1 05 ax ðtÞ ay ðtÞ az ðtÞ 1 Therefore, the sweep dilation is equivalent to the concatenated transformation matrices as ðA  BÞðtÞ ¼ ½B ½SðtÞ ½Rx ðtÞ ½Ry ðtÞ ½Rz ðtÞ ½AðtÞ ;

where 0 6 t 6 1:

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

217

The sweep morphological erosion, unlike dilation, is defined with the restriction on closed objects and its boundary represents the sweep trajectory. Definition 2. Let oA be the boundary of an object A and B be a structuring element. The sweep morphological erosion of A by B in Euclidean space, denoted by A  B, is defined as A  B ¼ fcjc þ b 2 A and for every b 2 ½B SðtÞ HðtÞ g. The properties of the sweep morphological operations can be referred to [12]. They can be applied to the sweeping with deformations, image enhancement, edge linking, and the shortest path planning for rotating objects.

3. Geometric modeling and sweep mathematical morphology Schemes based on sweep representation are useful in creating solid models of two-and-a-half-dimensional objects that include both solids of uniform thickness in a given direction and axis-symmetric solids. Computer representation of the swept volume of a planar surface has been used as a primary modeling scheme in solid modeling systems [13,14]. Representation of the swept volume of a three-dimensional object [15–17], however, has received limited attention. Leu et al. [18] presented a method for representing the swept volumes of translating objects using boundary representation and ray in-out classification. Their method is restricted to translation only. Representing the swept volumes of moving objects under a general motion is a more complex problem. A number of researchers have examined the problem of computing swept volumes, including Korein [19] for rotating polyhedra, Kaul [20] using Minkowski sums for translation, Wang and Wang [15] using envelop theory, and Martin and Stephenson [21] using envelop theory and computer algebraic techniques. In this paper, geometric modeling based on sweep morphology is proposed. Because of morphological operators’ geometric nature and non-linear property, some modeling problems will become simple and intuitive. This framework can be used for modeling not only swept surface and volumes but also for tolerance modeling in manufacturing. 3.1. Tolerance expression Tolerances constrain an object’s features to lie within regions of space called tolerance zones. Tolerance zones in Rossignac and Requicha [22,23] were constructed by expanding the nominal feature to obtain the region bounded by the outer closed curve, shrinking the nominal feature to obtain the region bounded by the inner curve, and then subtracting the two resulting regions.

218

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

Fig. 1. Tolerance zones. (a) An annular tolerance zone that corresponds to a circular hole. (b) A tolerance zone for an elongated slot.

This procedure is equivalent to the morphological dilation of the offset inner contour with a tolerance-radius disked structuring element. Fig. 1(a) shows an annular tolerance zone that corresponds to a circular hole, and Fig. 1(b) shows a tolerance zone for an elongated slot. Both can be constructed by dilating the nominal contour with a tolerance-radius disked structuring element as shown in Fig. 2. The tolerance zone for testing the size of a round hole is an annular region lying between two circles with the specified maximal and minimal diameters; the zone corresponding to a form constraint for the hole is also an annulus, defined by two concentric circles whose diameters must differ by a specified amount but are otherwise arbitrary. The sweep mathematical morphology supports the conventional limit (±) tolerance on ‘‘dimensions’’ that appear in the engineering drawings. The positive deviation is equivalent to the dilated result and the negative deviation is equivalent to the eroded result. The industrial parts adding tolerance information can be expressed using a dilation with a circle. 3.2. Sweep surface modeling Simplest sweep surface is generated by a profile sweeping along a spine with or without deformation. This is nothing but sweep mathematical dilation of the

Fig. 2. An example of adding tolerance by a morphological dilation.

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

219

Fig. 3. Modeling of sweep surface.

two curves. Let P ðuÞ be the profile curve, BðwÞ be the spine, and Sðu; wÞ be the sweep surface. The sweep surface can be expressed as Sðu; wÞ ¼ P ðuÞ  BðwÞ: A sweep surface with initial and final profiles P1 ðuÞ and P2 ðuÞ at relative locations O1 and O2 respectively and with the sweeping rule RðwÞ is shown in Fig. 3 and can be expressed as Sðu; wÞ ¼ f½1  RðwÞ ½P1 ðuÞðBðwÞ  O1 Þ g þ fRðwÞ½P2 ðuÞðBðwÞ  O2 Þ g:

4. Formal language and sweep morphology Our representation framework is formulated as follows. Let EN denote the set of points in the N -dimensional Euclidean space and p ¼ ðx1 ; x2 ; . . . ; xN Þ represent a point in EN . In this way, any object is a subset in EN . The formal model for geometric modeling is a context-free grammar, G, consisting of a four-tuple [24–26]: G ¼ ðVN ; VT ; P ; SÞ; where VN is a set of non-terminal symbols, such as complicated shapes; VT is a set of terminal symbols that contain two sets: one is the decomposed primitive shapes, such as lines and circles, and the other is the shape operators; P is a finite set of rewriting rules or productions denoted by A ! b, where A 2 VN and b is a string over VN [ VT ; S is the start symbol which represents the solid object. The operators used include sweep morphological dilation, set union, and set subtraction. Note that such a production allows the non-terminal A to be replaced by the string b independent of the context in which A appears. A context-free grammar is defined as a derived form: A ! b, where A is a single non-terminal and b is a non-empty string of terminals and

220

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

non-terminals. The languages generated by the context-free grammars are called context-free languages. Object representation can be viewed as a task of converting a solid shape into a sentence in the language, whereas object classification is the task of ‘‘parsing’’ a sentence. The criteria for the primitive selection are influenced by the nature of data, the specific application in the question, and the technology available for implementing the system. The following serves as a general guideline for primitive selection. (1) The primitives should be the basic shape elements that can provide a compact but adequate description of the object shape in terms of the specified structural relations (e.g., the concatenation relation). (2) The primitives should be easily extractable by the existing non-syntactic (e.g., decision-theoretic) methods, since they are considered to be simple and compact shapes and their structural information is not important.

5. Representation scheme In this section, we describe two-dimensional attributes and three-dimensional attributes in our representation scheme. 5.1. Two-dimensional attributes Commonly used two-dimensional attributes are rectangle, parallelogram, triangle, rhombus, circle, and trapezoid. They can be represented easily by using the sweep morphological operators. The expressions are not unique, and the preference depends on the simplest combination and the least computational complexity. The common method is to decompose the attributes into smaller components and apply morphological dilations to grow these components. Let a and b represent unit vectors in x- and y-axes, respectively. The unit vector could represent 1m, 0.1m, 0.01m and so on as needed. Note that when the sweep dilation is not associated with rotation and scaling, it is equivalent to the traditional dilation. (a) Rectangle: It is represented as a unit x-axis vector a swept along a unit y-axis vector b, i.e., b  a with no rotation or scaling. (b) Parallelogram: Let k denote a vector sum of a and b that are defined in (a). It is represented as k  a with no rotation or scaling. (c) Circle: Using a sweep rotation, a circle can be represented as a unit vector a swept about a point p through 2p degrees, i.e., p  a.

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

221

Fig. 4. The decomposition of two-dimensional attributes.

(d) Trapezoid: b  a with a linear scaling factor to change a magnitude of a into c as it is swept along b as shown in Fig. 4(a). Let 0 6 t 6 1. The scaling factor along the trajectory b is SðtÞ ¼ ac t þ ð1  tÞ. (e) Triangle: b  a, similar to trapezoid but with a linear scaling factor to change a magnitude of a into zero as it is swept along b, as shown in Fig. 4(b). Note that the shape of triangles (e.g., an equilateral or right triangle) is determined by the fixing location of the reference point (i.e., the origin) of the primitive line a. 5.2. Three-dimensional attributes The three-dimensional attributes can be applied by the similar method. Let a, b, c denote unit vectors in x-, y-, and z-axes, respectively. The formal expressions are presented below. (a) Parallelepiped: It is represented as a unit vector a swept along a unit vector b to obtain a rectangle and then it is swept along a unit vector c to obtain the parallelepiped, i.e., c  ðb  aÞ. (b) Cylinder: It is represented as a unit vector a swept about a point p through 2p degrees to obtain a circle, and then it is swept along a unit vector c to obtain the cylinder, i.e., c  ðp  aÞ. (c) Parallelepiped with a corner truncated by a sphere: A unit vector a is swept along a unit vector b to obtain a rectangle. A vector r is swept about a point p through 2p degrees to obtain a circle, and then it is subtracted from the rectangle. The result is swept along a unit vector c, i.e., c  ½ðb  aÞ  ðp  rÞ , as shown in Fig. 5. (d) Sweep dilation of a square along a trajectory with deformation to a circle: The square is represented as a rational B-spline curve. The polygon net is specified by a square with 9 points with the first and the last being the

222

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

Fig. 5. Sweep dilation of a rectangle with a corner truncated by a circle.

pffiffiffi same and the weights of the corner vary from 5 to 2=2 as it is swept along the trajectory C that is defined in the parametric form as x ¼ 10s and y ¼ cosðpsÞ  1. The sweep transformation is given by 2 3 cos w sin w 0 0

6  sin w cos w 0 0 7 7; where w ¼ tan1 p sinðpsÞ : ½SwT ¼ 6 4 0 0 1 05 10 10s cos ps 0 1

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

223

Fig. 6. Sweeping of a square along a trajectory with deformation to a circle.

The formal expression is C  B. The sweeping of a square along a trajectory with deformation to a circle is shown in Fig. 6. (e) Parallelepiped with a cylindrical hole: A unit vector a is swept along a unit vector b to obtain a rectangle. A vector r is swept about a point p through 2p degrees to obtain a circle, and it is subtracted from the rectangle. The result is swept along a unit vector c, i.e., c  ½ðb  aÞ  ðp  rÞ , as shown in Fig. 7. (f) U-shape block: A unit vector a is swept along a unit vector b to obtain a rectangle. A vector r is swept about a point p through p degrees to obtain a half circle, and it is dilated along the rectangle to obtain a two-roundedcorner rectangle that is then subtracted from another rectangle to obtain a U-shaped two-dimensional object. The result is swept along a unit vector c to obtain the final U-shaped object, i.e., c  ½ðb0  a0 Þ  ½ðb  aÞ  ðp  rÞ

, as shown in Fig. 8. Note that the proposed sweep mathematical morphology model can be applied to the NC machining process. For example, the ball-end milling cutter can be viewed as the structuring element and it can be moved along a predefined path to cut a work piece. During the movement, the cutter can be rotated to be perpendicular to the sweep path. If the swept volume is subtracted from the work piece, the remaining part can be obtained.

224

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

Fig. 7. Sweep dilation of rectangular with a circular hole.

6. Grammars In this section, we describe grammars in two-dimensional and threedimensional attributes. We have experimented on many geometric objects. The results show our model can work successfully. 6.1. Two-dimensional attributes All the primitive two-dimensional objects can be represented by the following grammar using the sweep mathematical morphology model: G ¼ ðVN ; VT ; P ; SÞ;

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

225

Fig. 8. Machining with a round bottom tool.

where VN ¼ fS; A; B; Kg;

VT ¼ fa; b; k; p; g;

P : S ! B  AjB  Kjp  A; A ! aAja; B ! bBjb; K ! kKjk: The sweep dilation  can be  ðS ¼ 0; h ¼ 0Þ,  ðS ¼ ac t þ ð1  tÞ; h ¼ 0Þ, or  ðS ¼ 0; h ¼ 2pÞ. Note that the repetition of a unit vector in a generated string is the usual way of grammatical representation. We can shorten the length of a string by adopting a repetition symbol ‘‘*’’. For example, ‘‘ 5a’’ denotes ‘‘aaaaa’’.

226

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

(a) Rectangle can be represented by the string bb  aa, with a’s and b’s repeated any number of times depending on the required size. (b) Parallelogram can be represented by the string kk  aaa, with a’s and k’s repeated any number of times depending on the required size. (c) Circle can be represented by the string p  aaa, with a’s repeated any number of times depending on the required size and with  as  ðS ¼ 0; h ¼ 2Þ. (d) Trapezoid can be represented by the string bb  aa, with a’s and b’s repeated any number of times depending on the required size and with  as  ðS ¼ ac t þ ð1  tÞ; h ¼ 0Þ. (e) Triangle can be represented by the string bb  aa, with a’s and b’s repeated any number of times depending on the required size and with  as  ðS ¼ ð1  tÞ; h ¼ 0Þ. 6.2. Three-dimensional attributes All the primitive three-dimensional objects can be categorized into the following grammar: G ¼ ðVN ; VT ; P ; SÞ; where VN ¼ fS; A; B; Cg; VT ¼ fa; b; c; p; ð; Þ; g; P : S ! C ðB  AÞjC ðp  AÞ; A ! aAja; B ! bBjb; C ! cCjc: The sweep dilation  can be either  ðS ¼ 0; h ¼ 0Þ or  ðS ¼ 0; h ¼ 2pÞ. (a) Parallelepiped can be represented by the string ccc  ðbb  aaaÞ, with a’s, b’s, and c’s repeated any number of times depending on the required size. (b) Cylinder can be represented by the string cccc  ðp  aaaÞ, with a’s and c’s repeated any number of times depending on the required size and with the first dilation operator  as  ðS ¼ 0; h ¼ 2pÞ and the second dilation as the traditional dilation. (c) Consider the grammar G ¼ ðVN ; VT ; P ; SÞ; where VN ¼ fA; B; C; N g; P : S ! C N;

VT ¼ fa; b; c; p; ; ; ð; Þg;

N ! rectangle  circle; C ! cCjc:

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

227

The productions for the rectangle and circle are given in Section 6.1. (c.1) The sweep dilation of a rectangle with a corner truncated by a circle can be represented by the string cc  ððbb  aaaÞ  ðp  aaÞÞ, with a’s, b’s, and c’s repeated any number of times depending on the required size and with the second dilation operator  as  ðS ¼ 0; h ¼ 2pÞ. (c.2) The sweep dilation of a rectangle with a circular hole can be represented by the string cc ððbb  aaaÞ  ðp  aÞÞ, with a’s, b’s, and c’s repeated any number of times depending on the required size and with the second dilation operator  as  ðS ¼ 0; h ¼ 2pÞ. The difference from the previous one is that the circle lies completely within the rectangle, and hence we obtain a hole instead of a corner truncated. (d) The grammar for the U-shape block can be represented as follows: G ¼ ðVN ; VT ; P ; SÞ; where VN ¼ fA; B; C; N ; M; half circle; g VT ¼ fa; b; c; p; ; g; P : S ! C N; N ! rectangle  M; C ! cCjc; M ! rectangle  half circle; half circle ! p  A: The U-shape block can be represented by the string ccc ð bbb aaaa  ððbb  aaÞðp  aÞÞÞ, with a’s, b’s, and c’s repeated any number of times depending on the required size and with the fourth dilation operator  as  ðS ¼ 0; h ¼ pÞ. 7. Parsing algorithm Given a grammar G and an object representation as a string, the string can be parsed to find out whether it belongs to the given grammar. There are various parsing algorithms, among which Earley’s parsing algorithm for context-free grammars is very popular. Let V  denote the set of all sentences composed of elements from V . The algorithm is described as follows: Input: Context-free Grammar G ¼ ðVN ; VT ; P ; SÞ and an input string w ¼ a1 a2 . . . an in VT . Output: The parse lists I0 ; I1 ; . . . ; In . Method : First construct I0 as follows: 1. If S ! a is a production in P , add ½S ! :a; 0 to I0 . Now, perform steps 2 and 3 until no new item can be added to I0 . 2. If ½B ! c:; 0 is on I0 , add ½A ! Bb; 0 for all ½A ! aBb; 0 on I0 .

228

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

3. Suppose that ½A ! Bb; 0 is an item in I0 . Add to I0 for all productions in P of the form B ! c, the item ½B ! :c; 0 (provided this item is not already in I0 ). Now, we construct Ij by having constructed I0 , I1 ; . . . ; Ij1 . 4. For each ½B ! a:ab; i in Ij1 such that a ¼ aj , add ½B ! aa:b; i to Ij . Now, perform steps 5 and 6 until no new items can be added. 5. Let ½A ! c:; i be an item in Ij . Examine Ii for items of the form ½B ! a:Ab; k . For each one found, add ½B ! aA:b; k to Ij . 6. Let ½A ! a:Bb; i be an item in Ij . For all B ! c in P , add ½B ! :c; j to Ij . The algorithm, then, is to construct Ij for 0 < j 6 n. Some examples of the parser are shown below. Example 1. Let a rectangle be represented by the string b  aa. The given grammar is G ¼ ðVN ; VT ; P ; SÞ; where VN ¼ fS; A; Bg

VT ¼ fa; b; g;

P : S ! B  A; A ! aAja; B ! bBjb: The parsing lists obtained are as follows: I0 ½S ! :B  A; 0

½B ! :bB; 0

½B ! :b; 0

I1 ½B ! b:B; 0

½B ! b:; 0

½S ! B:  A; 0

½B ! :bB; 1

½B ! :b; 1

I2 ½S ! B  :A; 0

½A ! :aA; 2

½A ! :a; 2

I3 ½A ! a:A; 2

½A ! a:; 2

½S ! B  A:; 0

½A ! :aA; 3

½A ! :a; 3

I4 ½A ! a:A; 3

½A ! a:; 3

½A ! aA:; 2

½A ! :aA; 4

½A ! :a; 4

½S ! B  A:; 0

Since ½S ! A  B:; 0 is on the last list, the input belongs to the language LðGÞ generated by G. Example 2. Consider the input string b  ba. The given grammar is given by G ¼ ðVN ; VT ; P ; SÞ; where VN ¼ fS; A; Bg; P : S ! B  A; A ! aAja; B ! bBjb:

VT ¼ fa; b; g;

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

229

Fig. 9. An example of swept surface.

The parsing lists obtained are as follows: I0 I1 I2 ½S ! :B  A; 0

½B ! b:B; 0

½S ! B  :A; 0

½B ! :bB; 0

½B ! b:; 0

½A ! :aA; 2

½B ! :b; 0

½S ! B:  A; 0

½A ! :a; 2

½B ! :bB; 1

½B ! :b; 1

I3 Nil

Since there is no production starting with S on the last list, the input does not belong to the language LðGÞ generated by G. A question is arisen as how we could accomplish the construction of a grammar that will generate a language to describe any kind of solid objects. Ideally, it would be nice to have a grammatical inference machine that would infer a grammar from a set of given strings describing the objects under study. Unfortunately, such a machine has not been available except for some very special cases. In most cases so far, the designer constructs the grammar based on the a priori knowledge available and experiences. In general, increased descriptive power of a language is paid for in terms of increased complexity of the analysis system. The trade-off between the descriptive power and the analysis efficiency of a grammar for a given application is almost completely justified by the designer. Consider the swept surface shown in Fig. 9. Its string representation is the same as the swept surface shown in Fig. 6. The only difference is that it is not deformed as being swept.

8. Conclusions We have presented a method of geometric modeling and representation based on sweep mathematical morphology. Since the shape and the dimension of a 2-D structuring element can be varied during the process, not only simple rotational and extruded solids but also more complicated objects with blending

230

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

surfaces can be generated by sweep morphology. We have developed grammars for solid objects and have applied Earley’s parser algorithm to determine whether a given string belongs to a group of similar objects. We compared our model with two popular solid models, Boundary representation and CSG model. Our mathematical framework used for modelling solid objects is Sweep Morphology, which provides a natural tool for shape representation. There are several advantages: simple, large domain, unambiguity, and easy to create and edit graphically. Furthermore, it does support the conventional limit () tolerances on ‘‘dimensions’’ that appear in many engineering drawings. The positive deviation is equivalent to the dilated result and the negative deviation is equivalent to the eroded result. It is demonstrated that the sweep mathematical morphology is an efficient tool for geometric modeling and representation in an intuitive manner.

References [1] A.A.G. Requicha, H.B. Voelcker, Solid modeling: current status and research direction, IEEE Computer Graphics and Applications 3 (Oct) (1983) 25–37. [2] J. Rossignac, CSG-Brep duality and compression, in: Proceedings of ACM Symposium on Solid Modeling and Applications, Saarbrucken, Germany, 2002, pp. 59–59. [3] J.C. Mott-Smith, T. Baer, Area and volume coding of pictures, in: T.S. Huang, O.J. Tretiak (Eds.), Picture Bandwidth Compression, Gordon and Beach, New York, 1972. [4] A.A.G. Requicha, H.B. Voelcker, Solid modeling: a historical summary and contemporary assessment, IEEE Computer Graphics and Applications 2 (2) (1982) 9–24. [5] J. Foley, A. van Dam, S. Feiner, J. Hughes, Computer Graphics: Principles and Practice, second ed., Addison-Wesley, Reading, MA, 1995. [6] Y. Shiroma, Y. Kakazu, N. Okino, A generalized sweeping method for CSG modeling, in: Proceedings of the First ACM Symposium on Solid Modeling Foundations and CAD/CAM Applications, Austin, Texas, 1991, pp. 149–157. [7] S. Ragothama, V. Shapiro, Boundary representation deformation in parametric solid modeling, ACM Transactions on Graphics 17 (4) (1998) 259–286. [8] R.M. Haralick, S.K. Sternberg, X. Zhuang, Image analysis using mathematical morphology, IEEE Transactions on Pattern Analysis and Machine Intelligence 9 (4) (1987) 532–550. [9] J. Serra, Image Analysis and Mathematical Morphology, Academic Press, London, 1982. [10] F.Y. Shih, O.R. Mitchell, Threshold decomposition of gray-scale morphology into binary morphology, IEEE Transactions on Pattern Analysis and Machine Intelligence 11 (1) (1989) 31–42. [11] F.Y. Shih, O.R. Mitchell, A Mathematical morphology approach to Euclidean distance transformation, IEEE Transactions on Image Processing 1 (2) (1992) 197–204. [12] F.Y. Shih, V. Gaddipati, General sweep mathematical morphology, Pattern Recognition 36 (7) (2003) 1489–1500. [13] R.A. Brooks, Symbolic reasoning among 3-D models and 2-D images, Artificial Intelligence 17 (1981) 285–348. [14] Y. Shiroma, N. Okino, Y. Kakazu, Research on 3-D geometric modeling by sweep primitives, in: Proceedings of CAD 82, Brighton, UK, 1982, pp. 671–680. [15] W.P. Wang, K.K. Wang, Geometric modeling for swept volume of moving solids, IEEE Computer Graphics and Applications 6 (2) (1986) 8–17.

F.Y. Shih, V. Gaddipati / Information Sciences 171 (2005) 213–231

231

[16] H.B. Voelcker, W.A. Hunt, The role of solid modeling in machining process modeling and NC verification, SAE Tech. Paper #810195, 1981. [17] A. Pennington, M.S. Bloor, M. Balila, Geometric modeling: a contribution toward intelligent robots, in: 13th International Symposium on Industrial Robots, 17–21 April 1983, pp. 7.35– 7.54. [18] M.C. Leu, S.H. Park, K.K. Wang, Geometric representation of translational swept volumes and its applications, ASME Journal of Engineering for Industry 108 (1986) 113–119. [19] J. Korein, A Geometric Investigating Reach, MIT Press, Cambridge, MA, 1985. [20] A. Kaul, Computing Minkowski Sums, Ph.D. thesis, Department of Mechanical Engineering, Columbia University, 1993. [21] R.R. Martin, P.C. Stephenson, Sweeping of three dimensional objects, Computer Aided Design 22 (4) (1990) 223–234. [22] J. Rossignac, A.A.G. Requicha, Offsetting operations in solid modeling, Production Automation Project, University of Rochester, NY Tech. Memo, 53, June 1985. [23] A.A.G. Requicha, Representation of tolerances in solid modeling: issues and alternative approaches, in: J.W. Boyse, M.S. Pickett (Eds.), Solid Modeling by Computers, Plenum, New York, 1984, pp. 3–12. [24] K.S. Fu, Syntactic Pattern Recognition and Applications, Prentice Hall, Englewood cliffs, NJ, 1982. [25] P.K. Gosh, A mathematical model for shape description using Minkowski operators, Computer Vision Graphics and Image Processing 44 (1988) 239–269. [26] F.Y. Shih, Object representation and recognition using mathematical morphology model, Journal of Systems Integration 1 (1991) 235–256.