• 沒有找到結果。

Implementation of the Algorithm

6.2 The Potential-Based Shape Matching

6.2.2 Implementation of the Algorithm

Implementation of Step 1

Since the input object is located inside the template object and a contact between them will result in an infinite potential value, the minimum potential position always exists along the initial force direction found in Step 1(a). (Situations involving multiple local minima in potential will be discussed later in this section.) For the computer implementation, the minimal potential position is identified efficiently by performing a gradient-based binary search using the projection of the repulsive force along the initial force direction. The precision in specifying the location of the input object is chosen to be 0.1% of the length of the template object. 1

Although a minimal potential position along the initial force direction can be found with an execution of Step 1(a), it is possible to reduce the potential further by searching for minimum potential configuration of the input object in a different direction (ideally orthogonal to the previous search direction) in the 3-D space. In Step 1(b) this is done by recalculating the total repulsive force then repeating Step 1(a). The search process ends when the object translation due to two consecutive executions of Step 1(a) is negligible, i.e., less than 0.1% of the length of the template object.

1The precision in specifying the object position and orientation are arbitrarily chosen such that the configuration change due to further minimization of the potential is not noticeable.

Implementation of Steps 2 and 3

While the repulsive force is used to translate the input object to a position of minimum potential in Step 1, if the input object is allowed to rotate, it is possible to reduce the potential further. (The choice of the object centroid as the rotation center is mainly for the convenience of the computer implementation and will have little effect on the shape matching results.) Therefore, the minimum potential object orientation is determined in Step 2 of the proposed shape matching algorithm. Because the degree of freedom of object rotation in searching for such an orientation is comparable to that discussed in the previous subsection for object translation, the minimization procedure is similar to that of Step 1. The precision in specifying the 1D potential minimum in Step 2(a) is chosen to be within 0.5 degrees of the object angular position.

The process of maximizing the size of the input object in Step 3 is similar to the processes discussed above for finding the object configuration of minimum potential. The center of expansion of the object is conveniently chosen as its centroid. The associated binary search is carried out with a finite number of iterations determined by the closest distance allowed between the input object and the template object. For the simulation results presented in this thesis, the closest distance is chosen to be 0.1% of the length of the template object.

Initial Object Configurations

For the process of finding the minimum potential configuration of an input object, the result corresponds to a local minimum of the potential function. In general, depending on the initial object configuration, such a result may not correspond to the global minimum. For example, consider the two rectangles shown in Figure 6.2. As the inner rectangle rotates with respect to its centroid, the potential will have local minima at four different angular positions with two of them do not correspond to the global minimum in the potential value.

In order to resolve such a problem, multiple initial object configurations are tried out for each of the shape matching problems considered in this thesis.

For the implementation of the proposed approach, it is assumed that the input object is initially placed near the centroid of a template object. Subsequently, the object is rotated into different orientations each used in a separate shape matching process. For simplicity, the centroid of the input object is chosen as the rotation center and the line containing the centroid and parallel to the z-axis is chosen as the axis of the object (see Figure 6.3). With

Figure 6.2: With its centroid chosen as the rotation center, the inner rectangular will expe-rience local minima in the potential value at four angular positions.

object axis

Figure 6.3: The arbitrarily chosen object axis is passing through the object centroid and is parallel to the z-axis.

the axis initially pointed to vertex A of the tetrahedron shown in Figure 6.4, the object is rotated such that the axis is pointed to three other vertices B, C, and D. For each of the four axis directions, the object is rotated by 0, 120, and 240 with respect to the object axis, respectively, to generate three initial object orientations. Therefore, there are twelve different initial orientations totally. Initial object configurations thus generated seems to work well for the shape matching problems considered in this thesis2 , as presented next.

6.3 Simulation Results

We now present some experimental results. The potential-based shape matching system was tested using databases of 3-D object models obtained from:

• Washington State University, NETLIB scientific data repository.

2To improve the efficiency of the proposed approach, it will be more desirable if less initial configurations can be used while the matching result will not be affected. Such an important issue is currently under investigation.

A

B

C

D

Figure 6.4: Four directions of object axis used to generate twelve initial object orientations.

• University of South Florida’s vision research group.

• Michigan State University’s PRIP Lab.

The object models comprise not only simple polyhedra but also curved objects and objects with complex geometry. Fig. 6.5 shows images of some of the object models. A text file which contains lists of vertices, polygons, and surfaces of the associated polyhedral representation can be obtained for each object model.

In the following experiments, shape templates are represented by complete polyhedral surfaces given in the databases. Simulation will first be performed for ”ideal” input objects, i.e., point samples of an input object are obtained by directly using the above list of vertices.

Non-ideal cases will then be considered which include missing vertices due to a partial view of an object and the perturbation in vertex locations. Finally, simulation will be performed to show the effect of sampling.

6.3.1 ”Ideal” case

In this subsection, we first choose nine simple polyhedra from the databases as shape tem-plates and pick four of them as input objects. Figs. 6.6(a) - 6.6(d) show the shape matching results for the four input objects, respectively. In each of the figures, the matching results shown for each template object include (1) one of the initial input object configurations, (2) the final (size maximized) input object configuration and (3) the template object whose configuration remains unchanged throughout the matching process. The best match which correctly identifies a shape template for one of the input objects is marked with a ”V”. The

octahdrn block4 triprism

pentagon dodecahdrn

block1 dean grnblk

cap

adapter

bigwye propane piston

halfsph ball

Figure 6.5: Images of some object models.

CPU times spent on a Sun4u Sparc Ultra-1 workstation for the best matches shown in Figs.

6.6(a) - 6.6(d) are equal to 7.6, 32.0, 38.2, and 34.7 seconds, respectively. (For these relatively simple shape templates and input data, an execution of the matching process presented in Sec. 3.2 takes less than 45 seconds.) Note that for each pair of shape template and input object, the time spent in the matching is determined not only by the number of primitives representing the two but also by their shapes. For example, while more primitives are used in obtaining the best match in Fig. 6.6(b) than that in Fig. 6.6(c), the former in fact takes less time to calculate.

The proposed shape matching method is also tested for more complex situations involv-ing curved objects. Fig. 6.7 shows the matchinvolv-ing results for propane and piston, respectively.

Because of the similarity in their shapes, the same number of configuration and size adjust-ments described in Sec. 3.2 are carried out in deriving the best matchs. The CPU time spent in calculating the two best matches are equal to 30.1 and 513.5 seconds, respectively. The ratio of them (513.5/30.1 = 17.1) is very close to the ratio of the products of the number of the vertices and the number of polygons of the two objects (386×384128×66 = 17.5). To further demonstrate the dependency of the computation time on the amount of input data, Fig. 6.8 shows the CPU time spent in the shape matching if different numbers of vertices of propane are used. It is readily observable that the former is a linear function of the latter.

In general, the input data may not be acquired with perfect conditions. For example, the data may be obtained with some noise contaminations, or part of the data may not be available due to a partial view of the object. Simulations of some of these non-ideal cases are given next.