Top Banner

of 12

TR VRVIS 009 2009 Registration

Apr 07, 2018

Download

Documents

p123mueller
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/6/2019 TR VRVIS 009 2009 Registration

    1/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Point Cloud to Model Registration

    Przemyslaw MusialskiTechnical Report

    VRVis Research Center

    July 8th, 2009

    Contents

    1 Introduction 1

    2 Methodology 2

    2.1 The Horn-Method (ICP) . . . . . . . . . . . . . . . . . . . . . . . . 2

    2.2 The Helical Motion Method . . . . . . . . . . . . . . . . . . . . . . 4

    3 Results 6

    4 Conclusions 7

    References 11

    1 Introduction

    This exercise is motivated by a concrete problem of registration of point-cloud-data

    (PCD) obtained by photogrammetric reconstruction from photographs to a manually

    crafted CAD model. In the special case handled here, we have a block-model of the

    city of Vienna (see Fig. 1), which will serve as the model data for the registration. In

    fact, the model is globally geo-located in Gauss-Krueger-Coordinates of Austria with

    an one-to-one scale, such that each unit of the model equals one meter in the real-

    world. Furthermore, the model is quite accurate up to wall positions of the buildings

    but not very detailed. Objects like facade-windows, ornaments and similar features

    are not inherited in the model. The final goal of the project, which is beyond the scopeof this exercise is to enhance the model by these details automatically based on the

    registered photographs.

    On the other hand we have a point-cloud of the inner-city of Vienna, particularly

    the Stephansplatz and the Graben obtained by the photogrammetric registration of

    about 1600 photographs to each other (see Fig. 2). The details of the reconstruction

    are not handled here and can be obtained in Irshara et al. [Irschara et al. 2007] in the

    section about spares matching. While the used reconstruction method delivers quite

    accurate results, it is difficult to relocate the triangulated point-cloud into the model

    [email protected]

    1

  • 8/6/2019 TR VRVIS 009 2009 Registration

    2/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Figure 1: The Vienna Block-Model with manually registered Point-Cloud.

    coordinates, since the reconstructions does not include any geo-spatial registration.

    Problem Statement It is easy to register the point-cloud in the model manually until

    a certain degree of accuracy - one can move, scale and rotate the point-cloud in a CADor modeling software very easy into the near of its proper extends. Unfortunately

    it is an almost impossible task to do it accurate enough for any useful application.

    Fortunately there exist proper registrations algorithms, which allow us to solve such

    task under certain conditions.

    2 Methodology

    This report will present and compare two of them: (1) The classical Iterated Closed

    Points (also referred as Iterated Corresponding Points) algorithm [Besl and McKay

    1992] based on the rigid 3d registration method of Horn [Horn 1987]. (2) The secondone is based on the vector-field of the motion, which has to be traversed by the the

    point-cloud in order to move form its initial position into the optimal one. This method

    will be elaborated in more detail in section 2.2.

    2.1 The Horn-Method (ICP)

    The actual Horn method [Horn 1987] was intended to compute the similarity transfor-

    mation between two point-clouds in different coordinate systems. Basically, one needs

    only three non-coplanar corresponding points of both systems to do so. Of course one

    can compute a least-square solution of a larger set of corresponding points. Than, the

    Page 2

  • 8/6/2019 TR VRVIS 009 2009 Registration

    3/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Figure 2: Point Cloud and Camera Positions of the Graben-Dateset (about 1600

    photographs)

    similarity transformation is split into the three basic operations: translation and rota-

    tion (for the Euclidean transformation) and scale (for a similarity). Horn proposes to

    compute the translation vector t of two corresponding point-clouds {xi} and {yi} bythe means of their (possibly weighted) barycenters:

    t = cy cx =1

    W

    i

    wiyi 1

    W

    i

    wixi,

    with W =

    iwi. The vector t gives us the translational relationship between the

    point-sets. For further convenience, we can also translate both point-clouds into the

    origin. Then, we can determine the rotational part of the mapping explicitly as:

    x = Rx . (1)

    Horn proposes to rewrite the rotation into an unit quaternion (for more details onquaternions, refer to the script [Pottmann 2008], chapter 4). With this approach we

    can rewrite: i

    yTi Rxi = aT i

    YTi Xi

    a = aTMa max (2)

    This maximizes the quadratic form under the quadratic constraint

    a2 = aT a = 1 ,

    which leads to the solution of a general eigenvalue problem. The largest eigenvalue of

    the matrix M gives the actual solution as a quaternion a R4. By the application of

    Page 3

  • 8/6/2019 TR VRVIS 009 2009 Registration

    4/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    the rotation of the quaternion to the point-cloud we have determined the optimal rigid

    transformation of both point-clouds. For further details as well as how to determine

    the scale in order to perform similarity mappings refer to Horn [ Horn 1987].

    ICP While the Horn-Method works basically only with given point-to-point corre-

    spondences, it can be easily extended to the iterated closest point approach. We do so

    by iteratively alternating of the two steps: translation and rotation computation. This

    method is one version of the ICP algorithm, and the objective function can be defined

    as:

    F =i

    xi+ yi2

    . (3)

    Between each iteration we need to compute new point-to-point correspondences xi+

    andyi

    . For big datasets this is usually the computationally most expensive task. Sec-tion 3 handles the details of the nearest-neighbor computation.

    2.2 The Helical Motion Method

    Figure 3: Motion along a helix.

    Point-to-Point. The Helical-Motion Algorithm is inspired by the track which a rigid

    body has to traverse to reach the optimal position with respect to a reference point-

    cloud. During this journey the body moves iteratively along helices: it translates androtates along some axis: the goal is to determine this axis and the angular velocity.

    This motion can by formalized by a vector field of the form:

    v(x) = c + c x. (4)

    The unknowns are the both vectors c and c. By linearizing the problem we can ap-

    proximate the new positions of the points by x = xi + v(xi). Now the objectivefunction can be formulated as:

    i

    (xi + v(xi) yi)2 =

    i

    (c + c xi + xi yi)2

    . (5)

    Page 4

  • 8/6/2019 TR VRVIS 009 2009 Registration

    5/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    This quadratic function can be solved explicitly by a system of linear equations. To

    do so, we can formulate the problem in matrix form as:

    F =i

    (c xi + c + xi yi)2

    = CTAC + 2BTC + D (6)

    where

    B =i

    xi (xi yi)

    xi yi

    and D is a constant:

    D =i

    (xi yi)2

    .

    The more tricky part is the matrix A which is the normal equation of the matrix A =MTM, where we can factorize the cross-product by the skew-symmetric matrix [x]

    :

    M =

    [x]

    I

    =

    0 xz xy 1 0 0xz 0 xx 0 1 0

    xy xx 0 0 0 1

    . (7)

    Finally, the unknowns vector is defined as a six-by-one matrix:

    C =

    c

    c

    (8)

    and we solve a system of six linear equations as:

    CTMTM C = AC = B C = A1(B) (9)

    This system can be easily solved by i.e. LU-decomposition of the matrix A.

    Point-to-Plane. A second registration algorithm based on the idea of helical-motion

    of a rigid body is equivalent to the Gauss-Newton iterative solution. The main ad-

    vantage of this approach is that it converges quadratically to the (local) minimum

    [Pottmann 2008; Pottmann et al. 2002; Chen and Medioni 1992]. The idea here is

    to minimize the squared distance between the points of the data point cloud and the

    tangent planes of the reference surface. To do so, we have to compute the closest

    point-pairs as in the algorithm before. Than we need to determine a tangent plane oneach foot-point on the surface and drop a perpendicular from point xi onto this tan-

    gent plane. Now the goal is to minimize the square of this distance iteratively. Let us

    denote the two corresponding points as xi and yi. The normal can be defined as

    ni =xi yixi yi

    . (10)

    The location of the point xi can be approximated by the velocity field x

    i = xi +v(xi)as defined in equation 4. The squared distance to the tangent plane is given by:

    d2(xi) = ((x

    i yi) ni)2

    = ((c xi + c + xi yi) ni)2 = (cni + cni + di)

    2,

    (11)

    Page 5

  • 8/6/2019 TR VRVIS 009 2009 Registration

    6/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    where ni = xi ni. The objective function is finally then:

    F = i

    (cni + cni + di)2

    = CTAC + 2BTC + D . (12)

    The matrix A is the normal equation of the objective function, where ai is a one-by-six

    vector ai = [xi ni,ni] , and the matrix A a six-by-six matrix:

    A =i

    aTi ai

    The column vector B is a six-by-one vector:

    B =i

    diaTi .

    Finally, we can solve this system linearly as in the algorithm before as AC + B =0, where C is the same unknown vector as in equation 8. For more details on thisalgorithm refer to [Pottmann et al. 2002] and for its analysis to [Pottmann et al. 2006].

    Transformation. The two algorithms above end up with the both vectors c and c.

    In order to determine the transformation matrix we can use the Plucker coordinates

    along the trajectory (for detail refer to [Pottmann et al. 2002] and Fig. 3). According

    to Figure 3, the Plucker coordinates (g, g) of the axis A, the pitch p and the angularvelocity are computed from (c, c) as:

    g =c

    cg =

    cpc

    cp =

    cc

    c2 = c .

    3 Results

    The algorithms has been implemented in C#. As a linear solver we have used the LU-

    decomposition based solver implemented in OpenCV. The algorithms are evaluated

    here on two test-sets: (1) a zero-residual test of a mesh and (2) a point-cloud of the

    Stephansdom in Vienna as described in section 1.

    Nearest Points. In all algorithms presented here we have to determine pairs of near-

    est points of two datasets. We accomplish this task always by the same function, which

    is based on a fast spatial KD-Tree data structure, which has been developed for real-

    time application. This tree is balanced once for any particular dataset and then the

    nearest-neighbors are determined by the means of these.

    The Ape-Dataset. This dataset is a triangle mesh composed of 2012 vertices and

    3936 triangles. For the test presented here it has been displaced by a three rotations:

    15 degrees along the Y-axis, 40 degrees along the X-axis and 10 degrees along the

    Page 6

  • 8/6/2019 TR VRVIS 009 2009 Registration

    7/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Z-axis. Further more, it has been translated by the vector [0.1 0.8 0.1]. This pointcloud contain the original vertices and will be denoted as X (see Fig. 4) . For the

    registration we have randomly sampled 4886 points on the original surface of the

    model, such that the points have been placed uniformly over each unit of the surfacearea, see Fig. 5. This point-cloud will be denoted as Y. For the point-to-tangent-

    plane algorithm we have determined the normals on each sampled point in Y by bi-

    linearly interpolating the vertex-normals of each triangle. The vertex-normals has

    been computes as weighted average of all incident face-normals (see Fig. 5).

    The Stephansdom-Dataset. This dataset is a real-world application and partially

    the reason of this exercise. The aim is to register a cloud of 74.432 points to a rather

    simple block-model. The points have been computed automatically out of about 800

    photographs of the Stephansdom (the whole dataset has over 1600 photos, but only

    about the half focus on Stephanesdom). For this reason we have sampled 443.626vertices on the block-model of the Dom and we proceed the same way as described

    in the section before. It has to be mentioned, that the computed points are not spaced

    very uniform over the space. We try to compensate it by a quite dense sampling of the

    model points (see Fig 8, left hand side).

    We use again the same algorithm for nearest-points computation and the same ap-

    proach to determine the normals and tangent planes of the model as described in pre-

    vious section.

    4 Conclusions

    WE have implemented and compared all three algorithms: the Horn-Method, the

    Point-to-Point and the Point-to-Tangent-Plane Helical Motion. During the implemen-

    tation and the experiments it has turned out that all three algorithms have their pros

    and cons. The Horn-Method performs basically quite well, especially for pure rota-

    tions. Its disadvantages come out in cases where one wants to register point-clouds

    containing non-uniform spaced points. Due to the barycenter-based translation it does

    not always converge properly.

    The Helical-Motion algorithms are very interesting interpretations of the problem. Ba-

    sically it turned out, that the point-to-point, linearly converging algorithm has the most

    worst performance: is converges quite slowly, never as close to the reference data as

    the point-to-plane version and it also often gets trapped into a local minimum. Never-

    theless, it is still a practical algorithm, especially for the case of iterative registration of

    more the two data sets [Pottmann et al. 2001]. Finally, the Gauss-Newton equivalent

    point-to-tangent-plane version of the algorithm has surely best performance: it con-

    verges quite fast (compare the charts in Figure 7) and also closer to the reference than

    any other of the algorithms. Of course it also can get stuck in an local minimum as

    shown in Figure 6, right-hand-side. This problem is acute to all of the algorithms and

    it should be overcome by providing proper starting conditions to all of them. This can

    be done manually, as in the case of the Stephansdom dataset as well it could be accom-

    Page 7

  • 8/6/2019 TR VRVIS 009 2009 Registration

    8/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Figure 4: The original Ape-Model (gray) and the displaced model (red points).

    plished by stochastic algorithms as Monte-Carlo-Markov-Chain solved by Simulated

    Annealing (MCMCM).

    The future work of this exercise will be further fine-tuning of the algorithms and inte-

    gration into the VRVis internal software library as a Point-Cloud-Registration module.

    Appendix

    A short video to the exercise can be downloaded at:

    http://www.cg.tuwien.ac.at/pm/registration/

    Page 8

    http://www.cg.tuwien.ac.at/~pm/registration/http://www.cg.tuwien.ac.at/~pm/registration/http://www.cg.tuwien.ac.at/~pm/registration/http://www.cg.tuwien.ac.at/~pm/registration/
  • 8/6/2019 TR VRVIS 009 2009 Registration

    9/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Figure 5: Left: Points sampled uniformly on the original model, and right: interpo-

    lated normals on the points.

    Figure 6: Left: point cloud registered successfully. Right: registration is trapped in a

    local minimum.

    Page 9

  • 8/6/2019 TR VRVIS 009 2009 Registration

    10/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    1 4 7 1 0 1 3 1 6 1 9 2 2 2 5 2 8 3 1 3 4 3 7 4 0 4 3 4 6 4 9 5 2 5 5 5 8 6 1 6 4 6 7 7 0 7 3 7 6 7 9 8 2 8 5 8 8 9 1 9 4 9 7 1 00 1 03 1 06 1 09 1 12 1 15 1 18 1 21 1 24 1 27 1 30

    0

    0,05

    0,1

    0,15

    0,2

    0,25

    0,3

    0,35

    0,4

    0,45

    0,5

    0

    0,02

    0,04

    0,06

    0,08

    0,1

    0,12

    0,14

    0,16

    1 2 3 4 5 6 7 8 9 1 0 11 1 2 13 1 4 15 1 6 1 7 1 8 1 9 2 0 2 1 22 2 3 24 2 5 26 2 7 28 2 9 3 0 3 1 3 2 33 3 4 35 3 6 37 3 8 39 4 0 41 4 2 4 3 4 4 4 5 46 4 7 48 4 9 50 5 1

    RMS Horn

    Point-to-Point

    Point-to-Plane

    Figure 7: Top: RMS Error, Ape-Model. Bottom: RMS Error, Stephansdom.

    Figure 8: Left: Reference points sampled dense on the original block-model (blue

    point) and the Point-Cloud obtained by photogrammetrc reconstruction (red points).

    Right: normals interpolated on the reference points.

    Page 10

  • 8/6/2019 TR VRVIS 009 2009 Registration

    11/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Figure 9: Left: Original Model and the Point-Cloud obtained by photogrammetrc

    reconstruction (red points). Right: Result of the registration after 50 iterations.

    References

    BES L, P. J., AN D MCKAY, N. D. 1992. A method for registration of 3-d shapes.

    IEEE Trans. Pattern Anal. Mach. Intell. 14, 2, 239256.

    CHE N, Y., AN D MEDIONI, G. 1992. Object modelling by registration of multiplerange images. Image Vision Comput. 10, 3, 145155.

    HOR N, B. K. P. 1987. Closed-form solution of absolute orientation using unit quater-

    nions. Journal of the Optical Society of America. A 4, 4 (Apr), 629642.

    IRSCHARA, A., ZACH , C., AN D BISCHOF, H. 2007. Towards wiki-based dense

    city modeling. In Computer Vision, 2007. ICCV 2007. IEEE 11th International

    Conference on, 18.

    POTTMANN, H., LEOPOLDSEDER , S., AN D HOFER, M., 2001. Simultaneous regis-

    tration of multiple views of a 3d object.

    POTTMANN, H., LEOPOLDSEDER , S., AN D HOFER, M. 2002. Registration without

    icp. Computer Vision and Image Understanding 95, 5471.

    POTTMANN, H., HUANG, Q.-X., YAN G, Y.-L., AN D HU, S.- M. 2006. Geometry

    and convergence analysis of algorithms for registration of 3d shapes. Int. J. Comput.

    Vision 67, 3, 277296.

    POTTMANN, H., 2008. Industrial geometry - scriptum.

    Page 11

  • 8/6/2019 TR VRVIS 009 2009 Registration

    12/12

    Exercise in Applied Geometry Point Cloud to Model Registration

    Figure 10: Stephansdom Model and the Point-Cloud

    Page 12