Fast Geodesic Distance Approximation using Mesh Decimation and ...

4 downloads 0 Views 2MB Size Report
we propose an algorithm for fast geodesic distance approximation using mesh decimation and front propagation. This algorithm is appropriated when a fast ...
Fast Geodesic Distance Approximation using Mesh Decimation and Front Propagation Joachim Giard And Benoˆıt Macq Universit´e Catholique de Louvain, Communications and Remote Sensing Lab., Place du Levant 2, B-1348 Louvain-La-Neuve, Belgium ABSTRACT Polygon meshes are collections of vertices, edges and faces defining surfaces in a 3D environment. Computing geometric features on a polygon mesh is of major interest for various applications. Among these features, the geodesic distance is the distance between two vertices following the surface defined by the mesh. In this paper, we propose an algorithm for fast geodesic distance approximation using mesh decimation and front propagation. This algorithm is appropriated when a fast geodesic distances computation is needed and when no fine precision is required. Keywords: Geodesic Distance, 3D Mesh, Front Propagation, Mesh Decimation, Surface Simplification

1. INTRODUCTION 3D modeling and 3D features extraction are powerful tools for various applications from microbiology1 to manufacturing.2 For instance, the travel depth3 of a molecular surface enables to find pockets where chemical reaction could happen. The point signature,4 in the domain of face recognition, throws light on points to select to compare two faces (e.g., end of the nose, corner of mouth, . . . ). In watermarking, it is possible to locate robust feature points by using the curvature tensor,5 or to weight the local deformation by a roughness score.6, 7 An efficient and widely used tool to model 3D shapes is the polygon mesh, which is a collection of connected vertices, edges and faces defining an external surface in a 3D environment. Meshes are discretely defined and have no analytical expressions. So, algorithms computing features have to be founded on the only available information: vertices positions and connectivity (inside edges or faces). In this context, the geodesic distance, i.e., distance along the surface, is a base for most surface features. This distance can also be used, as it is, for processes like remeshing,8, 9 segmentation10 or animation effects (fire,11 water,12 . . . ).

1.1 Related Work The geodesic distance is the distance between two points, following the surface of an object. It is, for instance, the distance covered by a vehicle on earth,13 without going underground. In the case of 3D meshes, the geodesic distance is also a basis for discrete differential-geometry operators,14 such as curvature estimators or integrators. Mitchell et al.15 introduced an exact ”single source, all destination” algorithm, running in O(n2 log n). This algorithm is close from the Dijkstra algorithm16 finding shortest paths in graphs. Surazhsky et al.17 showed that in practise, it runs in sub-quadratic time. They also proposed an approximation algorithm running, in practise, in O(n log n) with bounded error . Kimmel and Sethian18 presented the fast marching algorithm running in O(n log n). All the methods mentioned here, and in the literature in general, are exact or low-error algorithm. But sometimes, it can be needed to get rapidly a rough approximation of the distance. Further author information: (Send correspondence to J.G.) J.G.: E-mail: [email protected], Telephone: +32 10 47 81 24

Original Mesh Decimated Mesh Shortest Path

Figure 1. An illustration of the FGDA algorithm. The original mesh is depicted with small grey vertices and lines. The, the mesh is decimated and the resulting mesh is depicted with thick black vertices and lines. The shortest path between two selected vertices of the original is approximated by the big black and white squares path going through the decimated mesh.

1.2 Contribution In this paper, we propose an algorithm for fast geodesic distance approximation (FGDA) using mesh decimation and front propagation. Mesh decimation is a reduction of the number of vertices, a kind of sub-sampling. Front propagation is a technique to compute geodesic distances from a source vertex to every vertices of the mesh. The idea of the algorithm presented here is to decimate the original mesh, compute the geodesic distance between each pair of vertices on the decimated mesh and store it in an array. The distance between two vertices of the original mesh can be retrieved using connections of the decimated mesh as highways. The general idea is to keep in memory information which can be used for several different geodesics computations. It is illustrated in Figure 1. This technique is appropriated when numerous distances have to be computed or even if the same computations must be done several times. The algorithm is a solution for both low-memory and low-time consummation.

1.3 Overview This paper is organized as follow. In Section 2, the Fast Geodesic Distance Approximation (FGDA) algorithm is descripted. In Section 3, error and time analysis are presented. In section 4, some experimental results are exposed. Section 5 contains a discussion about the algorithm and its results.

2. ALGORITHM DESCRIPTION The algorithm described in this paper, the FGDA, is separated into an initialization phase and a purpose phase. During the initialization phase, common information is computed and stored. This information is used during the purpose phase, each time a geodesic distance is required for a final application.

2.1 Initialization Phase This phase has to be performed only once and prepares ground information to use during the purpose phase. The initialization phase is illustrated in figure 2.

2.1.1 Mesh Decimation The original mesh (OM) is decimated by removing edges and collapsing end vertices of deleted edges.19, 20 The edges are consecutively deleted in such a way that a quadric measure error (linked to the distance to the original surface) is minimized. The deletion stops when the desired decimation rate is reached or when topological constraints can not be respected anymore. The result of this decimation is the decimated mesh (DM). The implementation of the algorithm in the vtkQuadricDecimation Class of the Visual ToolKit (VTK ∗ ) is used in this work. 2.1.2 Front Propagation The geodesic distances between each pair of vertices of DM are computed by front propagation, starting from a vertex and making grow the zone of computed distances delimited by an isotropic front. This technique is inspired from the Fast Marching Method introduced by Sethian.18, 21 A distance vector di is created for each vertex i of DM. First, the distance vector is filled with infinite distances except at the starting vertex i:  ∞ if j 6= i di (j) = 0 if j = i. Then, the vector is browsed from the smallest distance to the biggest one, updating at each step the distances to vertices connected to the active vertex k: ∀j ∈ C(k),

(1)

if di (j) > di (k) + |jk|,

(2)

then di (j) = di (k) + |jk|,

(3)

where C(k) is the set of vertices connected to k and |jk| is the euclidean distance between j and k. At the first step, k = i because it is the only vertex to have a non-infinite distance. After each step, the vertex k is labelled as visited and the non-visited vertex with the smallest distance value, considering the updates, becomes the new k. Once all vertices are visited, the front propagation algorithm is performed with i + 1 as starting vertex. Vectors di are constituting the columns of a reference array D containing the geodesic distances between each pair of vertex of DM. Finally, the N closest vertices of DM are stored in a n × N array, in order to retrieve them faster during the purpose phase. The set of N closest DM vertices from a particular OM vertex s is denoted γ(s). Generally, DM is triangulated, so N=3 is a good choice because vertices of OM can be projected on triangular faces of DM. If the polygons of the mesh are not triangles, they can be triangulated in linear time.22

2.2 Purpose Phase Depending on the final application, the use can be different. Generally, distances are calculated either from a source vertex to a target vertex (itinerary), from a source vertex to equidistant vertices (geodesic circles), or from several source vertices to all vertices (Vorono¨ı partition). In the purpose phase, the euclidean distances between end vertices (source and target) and close DM vertices are computed and added to mutual geodesic distances contained in the array D, constructed during the initialization phase. The expression of δ˜s (t), the estimated geodesic distance between s and t is the following:   |ss0 | + D(s0 , t0 ) + |tt0 | . δ˜s (t) = 0 min0 s ∈γ(s),t ∈γ(t)

The sets, γ, of DM vertices close to OM vertices have a size of N , which leads to N × N possibilities for finding the minimum. For vertices in a close neighborhood around the starting vertex, a limited front propagation on OM is effectuated to avoid large over-estimations that would be generated by going back and forth to the closest vertex of DM. This purpose phase is illustrated in figure 3. ∗

http://www.vtk.org

di

Original Mesh (n vertices)

Decimated Mesh ( m vertices)

Mutual Distances Array

Figure 2. The original mesh (left), OM, containing n vertices is decimated, resulting in a decimated mesh (center), DM, containing m vertices, with m < n. The geodesic distance between each pair of vertices of DM is computed using a front propagation algorithm. The distances from a particular vertex i to all the vertices of the mesh is stored in a vector di , which constitutes the ith column of a reference array D (right). Here, the distance is expressed as a percentage of the maximal distance.

s

s

s'

t'

t

s'

Figure 3. The purpose is to approximate the geodesic distance between a source vertex s and a target vertex t. The N vertices of DM closest from s (resp. t) are candidate to be the approximated source vertex s0 (resp. target vertex t0 ). The approximated distance is the shortest one amongst the different possibilities, which are the N × N combinations of |ss0 | + D(s0 , t0 ) + |tt0 |.

3. ALGORITHM ANALYSIS The FGDA aims to approximate quickly geodesic distances on a polygon mesh by computing distances on a decimated mesh, which leads to approximation errors and time gain. Here follow a description of the possible error sources and a time complexity analysis

3.1 Error Sources In this section, possible errors due to the decimation are exposed. If the front propagation distance is considered to be the reference, there are two major sources of error. First, an over-estimation because the shortest theoretical path could cross DM edges, whereas the estimation will follow these edges. Second, an under-estimation because a succession of several segments approximating a curve in OM could be replaced by a single straight segment after the decimation. The decimation algorithm used for this algorithm removes vertices ordered by a local cost function until the desired threshold of decimation is attained.20 It conserves the topology of OM so that there only are local and propagated errors, but no topological errors. Finally, in a close neighbourhood, distances are computed by front propagation which locally gives an exact solution.

3.2 Time Complexity The time complexity of the FGDA, executed p times, from a single source vertex to all the vertices is O(n log n)+ n n log m ), where n is the number of vertices in OM, m is the number of vertices in DM. The O(m2 log m) + O(p m first term, O(n log n), comes from the quadric-based decimation algorithm.23 The second term, O(m2 log m), comes from the front propagation algorithm for the computation of the geodesics on DM.24 The third term, n n O(p m log m ), comes from the front propagation in a close neighbourhood around a source vertex containing about n/m vertices. Finding the shortest path between from p to n vertices testing the NxN possibilities has a n n complexity of O(pn) ∈ O(p m log m ). Since distances between vertices of DM are stored in a array of size m2 , m is set to a constant, in practice, to avoid memory lacks. In this case the complexity of the FGDA is O(pn log n), the same than for the front propagation algorithm alone. However, in practice, coefficients are smaller for the FGDA because only local front propagations are needed. This is true only if the computed distances are long, n n log m ), becomes comparable to both other terms, if p is large or if n is large. Otherwise the third term, O(p m 2 O(n log n) and O(m log m), and the front propagation alone becomes less time consuming.

4. EXPERIMENTAL RESULTS To illustrate the time saving and to estimate the errors, some comparisons between the FGDA and the front propagation algorithm are presented here. Tests were performed on 3 different meshes: head (11703 vertices), horse (48485 vertices) and molecule (435894 vertices). Distances were computed from one source vertex, all vertices of the mesh being targets. The process were repeated 1, 10 , 100 , 1000 and n times with different starting vertices, for each mesh and both methods (n is the number of vertices in the considered mesh). m, the number of vertices in DM was set to 500. For the front propagation algorithm, it boils down to repeating the whole unique-source and multiple-target algorithm for every different starting vertex. For the FGDA, only the purpose phase is repeated. Time plots and screenshots of the results are depicted in figure 4. Spent time using front propagation only increases linearly with the number of starting vertices because the algorithm is simply repeated. Spent time using FGDA increased slower when the number of different starting vertices is smaller due to the fixed cost of the initialization phase. A mean error score was also computed during the tests. The reference was the front propagation distance, evaluating the error generated by the decimation estimation. The mean error ei for the starting vertex i is ei =

n X |δi (j) − δ˜i (j)| j=1

n.δi,max

,

where δi (j) is the geodesic distance between i and j using the front propagation only, δ˜i (j) is the geodesic distance using the FGDA and δi,max is the maximal value of {δi (j)|j ∈ [1, n]}. The mean error was 3.2% for the head, 1.65% for the horse and 2.33% for the molecule. The whole algorithm was implemented in C++ with VTK. All the tests were performed on a computer with an Intel Core 2 CPU @ 2.00GHz, and with 2 Gb RAM.

Head (~1E+4 points) 1E+4

Time [s]

1E+3

Exact Estimation

1E+2 1E+1 1E+0 1E-1

1E+0

1E+1

1E+2

1E+3

1E+4

1E+5

Horse (~5E+4 points) 1E+6

Time [s]

1E+5

Exact Estimation

1E+4

1E+3 1E+2 1E+1 1E+0 1E+0

1E+1

1E+2

1E+3

1E+4

1E+5

Molecule (~5E+5 points) 1E+8 1E+7

Time [s]

1E+6

Exact Estimation

1E+5 1E+4 1E+3 1E+2 1E+1 1E+0 1E+0

1E+1

1E+2

1E+3

1E+4

1E+5

1E+6

Number of Starting Vertices Figure 4. Examples of algorithm results (left) and corresponding execution times (right) for the head (top)(about 104 vertices), the horse (middle) (about 5.104 vertices) and the molecule (bottom) (about 5.105 vertices). The times plotted are those of the front propagation algorithm (gray circles) and the FGDA (black squares) for the computation of distances to all the vertices of the mesh from a unique source. On the x-coordinate, the number of different source vertices for which distances were computed. Scales are logarithmic. Times are expressed in seconds.

5. DISCUSSION This algorithm is appropriated when a fast geodesic distance approximation is needed from several different sources, at a long distance or for large meshes. As shown in section 4, for the example of the unique-source and multiple-target, the fixed time of the initialization phase is longer than the complete computation using the front propagation algorithm if the mesh is too small (see figure 4, for the head and the horse). This disadvantage appears for combination of these factors: short distances computation, few different source/target vertices and small meshes. The time for 5.105 vertices is coherent with the one announced by Surazhsky17 (one minute). The mean error was calculated in reference with the front propagation algorithm used for the tests. It worth noting that any geodesic distance algorithm can be used in this method. So, the error method just takes into account the difference induced by the decimation.

6. CONCLUSION To sum up, we propose an algorithm approximating geodesic distances on a polygon mesh and reducing considerably the execution time. It is based on a front propagation algorithm applied on a decimated mesh. In the future, this algorithm would be developed to create other tools such as differential or integral operators on meshes.14

ACKNOWLEDGMENTS Joachim Giard is funded by Nanotic/Tsarine, a project of the R´egion Wallonne of Belgium (convention number: 516248).

REFERENCES [1] Can, T., Chen, C., and Wang, Y., “Efficient molecular surface generation using level-set methods,” Journal of Molecular Graphics and Modelling 25(4), 442–454 (2006). [2] Rohrer, M., “Seeing is believing: the importance of visualization in manufacturing simulation,” in [Proceedings of the 32nd conference on Winter simulation], 1211–1216, Society for Computer Simulation International San Diego, CA, USA (2000). [3] Giard, J., Alface, P., and Macq, B., “Fast and accurate travel depth estimation for protein active site prediction,” Proceedings of SPIE 6812, 68120Q (2008). [4] Wang, Y., Chua, C., and Ho, Y., “Facial feature detection and face recognition from 2D and 3D images,” Pattern Recognition Letters 23(10), 1191–1202 (2002). [5] Alface, P. and Macq, B., “Feature-based watermarking of 3d objects: Towards robustness against remeshing and de-synchronization,” in [Proceedings of SPIE, Security, Steganography and Watermarking of Multimedia Contents VII, San Jose, USA ], (2005). [6] Uccheddu, F., Corsini, M., Barni, M., and Cappellini, V., “A roughness-based algorithm for perceptual watermarking of 3d meshes,” in [Proceedings of the Tenth International Conference on Virtual System and Multimedia], (2004). [7] Corsini, M., Gelasca, E., and Ebrahimi, T., “A multi-scale roughness metric for 3d watermarking quality assessment,” Workshop on image analysis for multimedia interactive services (2005). [8] Sifri, O., Sheffer, A., and Gotsman, C., “Geodesic-based surface remeshing,” in [Proc. 12th International Meshing Roundtable], 189–199 (2003). [9] Peyr´e, G. and Cohen, L., “Geodesic Remeshing Using Front Propagation,” International Journal of Computer Vision 69(1), 145–156 (2006). [10] Katz, S., Leifman, G., and Tal, A., “Mesh segmentation using feature point and core extraction,” The Visual Computer 21(8), 649–658 (2005). [11] Lee, H., Kim, L., Meyer, M., and Desbrun, M., “Meshes on Fire,” in [Computer Animation and Simulation 2001: Proceedings of the Eurographics Workshop in Manchester, UK, September 2-3, 2001 ], Springer (2001).

[12] Liu, S., Jin, X., Wang, C. C. L., and Chen, J. X., “Water wave animation on mesh surfaces,” Computing in Science and Engg. 8(5), 81–87 (2006). [13] Saab, Y. and VanPutte, M., “Shortest path planning on topographical maps,” Systems, Man and Cybernetics, Part A, IEEE Transactions on 29(1), 139–150 (1999). [14] Meyer, M., Desbrun, M., Schroder, P., and Barr, A., “Discrete differential-geometry operators for triangulated 2-manifolds,” Visualization and Mathematics 3, 35–57 (2003). [15] Mitchell, J., Mount, D., and Papadimitriou, C., “The Discrete Geodesic Problem,” SIAM Journal on Computing 16, 647 (1987). [16] Dijkstra, E., “A note on two problems in connexion with graphs,” Numerische Mathematik 1(1), 269–271 (1959). [17] Surazhsky, V., Surazhsky, T., Kirsanov, D., Gortler, S., and Hoppe, H., “Fast exact and approximate geodesics on meshes,” Proceedings of ACM SIGGRAPH 2005 24(3), 553–560 (2005). [18] Kimmel, R. and Sethian, J., “Computing geodesic paths on manifolds,” Proceedings of the National Academy of Sciences 95(15), 8431–8435 (1998). [19] Garland, M. and Heckbert, P., “Surface simplification using quadric error metrics,” Proceedings of the 24th annual conference on Computer graphics and interactive techniques , 209–216, ACM Press/Addison-Wesley Publishing Co. New York, NY, USA (1997). [20] Hoppe, H., “New quadric metric for simplifiying meshes with appearance attributes,” Proceedings of the conference on Visualization’99: celebrating ten years , 59–66, IEEE Computer Society Press Los Alamitos, CA, USA (1999). [21] Sethian, J., “A fast marching level set method for monotonically advancing fronts,” Proceedings of the National Academy of Sciences 93(4), 1591–1595 (1996). [22] Chazelle, B., “Triangulating a simple polygon in linear time,” Discrete and Computational Geometry 6(1), 485–524 (1991). [23] Garland, M., Quadric-Based Polygonal Surface Simplification, PhD thesis, Georgia Institute of Technology (1999). [24] Peyr´e, G. and Cohen, L., “Heuristically Driven Front Propagation for Geodesic Paths Extraction,” LECTURE NOTES IN COMPUTER SCIENCE 3752, 173 (2005).

Suggest Documents