34
Giorgio Grisetti Least Squares and SLAM Scan-Matching using ICP and RANSAC Part of the material of this course is taken from the Robotics 2 lectures given by G.Grisetti, W.Burgard, C.Stachniss, K.Arras, D. Tipaldi and M.Bennewitz

Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Giorgio Grisetti

Least Squares and SLAMScan-Matching using ICP and RANSAC

Part of the material of this course is taken from the Robotics 2 lectures given

by G.Grisetti, W.Burgard, C.Stachniss, K.Arras, D. Tipaldi and M.Bennewitz

Page 2: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Motivation

Page 3: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

The Problem

� Given: two corresponding point sets:

� Wanted: translation t and rotation R that minimizes the sum of the squared error:

Where are corresponding points.and

Page 4: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Key Idea

� If the correct correspondences are known, the correct relative rotation/translation can be calculated in closed form.

Page 5: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Center of Mass

and

are the centers of mass of the two point sets.

Idea:

� Subtract the corresponding center of mass from every point in the two point sets before calculating the transformation.

� The resulting point sets are:

and

Page 6: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

SVD

� Let

denote the singular value decomposition (SVD) of W by:

where are unitary, and

are the singular values of W.

Page 7: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

� Theorem (without proof):

� If rank(W) = 3, the optimal solution of E(R,t) is unique and is given by:

SVD

The minimal value of error function at (R,t) is:

Page 8: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP with Unknown Data Association

� If correct correspondences are not known, it is generally impossible to determine the optimal relative rotation/translation in one step

Page 9: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP-Algorithm

� Idea: iterate to find alignment

� Iterated Closest Points (ICP) [Besl & McKay 92]

� Converges if starting positions are “close enough”

Page 10: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Iteration-Example

Page 11: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP-Variants

� Variants on the following stages of ICP have been proposed:

1. Point subsets (from one or both point

sets)

2. Weighting the correspondences

3. Data association

4. Rejecting certain (outlier) point pairs

Page 12: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Performance of Variants

� Various aspects of performance:

� Speed

� Stability (local minima)

� Tolerance wrt. noise and/or outliers

� Basin of convergence (maximum initial misalignment)

� Here: properties of these variants

Page 13: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP Variants

1. Point subsets (from one or both point

sets)

2. Weighting the correspondences

3. Data association

4. Rejecting certain (outlier) point pairs

Page 14: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Selecting Source Points

� Use all points

� Uniform sub-sampling

� Random sampling

� Feature based Sampling

� Normal-space sampling

� Ensure that samples have normalsdistributed as uniformly as possible

Page 15: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Normal-Space Sampling

uniform sampling normal-space sampling

Page 16: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Comparison

� Normal-space sampling better for mostly-smooth areas with sparse features [Rusinkiewicz et al.]

Random samplingRandom sampling NormalNormal--space samplingspace sampling

Page 17: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Feature-Based Sampling

3D Scan (~200.000 Points) Extracted Features (~5.000 Points)

• try to find “important” points• decrease the number of correspondences • higher efficiency and higher accuracy • requires preprocessing

Page 18: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Application

[Nuechter et al., 04]

Page 19: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP Variants

1. Point subsets (from one or both point

sets)

2. Weighting the correspondences

3. Data association

4. Rejecting certain (outlier) point pairs

Page 20: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Selection vs. Weighting

� Could achieve same effect with weighting

� Hard to guarantee that enough samples of important features except at high sampling rates

� Weighting strategies turned out to be dependent on the data.

� Preprocessing / run-time cost tradeoff (how to find the correct weights?)

Page 21: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP Variants

1. Point subsets (from one or both point

sets)

2. Weighting the correspondences

3. Data association

4. Rejecting certain (outlier) point pairs

Page 22: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Data Association

� has greatest effect on convergence and speed

� Closest point

� Normal shooting

� Closest compatible point

� Projection

� Using kd-trees or oc-trees

Page 23: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Closest-Point Matching

� Find closest point in other the point set

Closest-point matching generally stable,

but slow and requires preprocessing

Page 24: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Normal Shooting

� Project along normal, intersect other point set

Slightly better than closest point for smooth

structures, worse for noisy or complex structures

Page 25: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Point-to-Plane Error Metric

� Using point-to-plane distance instead of point-to-point lets flat regions slide along each other [Chen & Medioni 91]

Page 26: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Projection

� Finding the closest point is the most expensive stage of the ICP algorithm

� Idea: simplified nearest neighbor search� For range images, one can project the points according to the view-point [Blais 95]

Page 27: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Projection-Based Matching

� Slightly worse alignments per iteration

� Each iteration is one to two orders of magnitude faster than closest-point

� Requires point-to-plane error metric

Page 28: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Closest Compatible Point

� Improves the previous two variants by considering the compatibility of the points

� Compatibility can be based on normals, colors, etc.

� In the limit, degenerates to feature matching

Page 29: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP Variants

1. Point subsets (from one or both point

sets)

2. Weighting the correspondences

3. Nearest neighbor search

4. Rejecting certain (outlier) point pairs

Page 30: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Rejecting (outlier) point pairs

� sorting all correspondences with respect to there error and deleting the worst t%, Trimmed ICP (TrICP) [Chetverikov et al. 2002]

� t is to Estimate with respect to the Overlap

Problem: Knowledge about the overlap is necessary or has to be estimated

Page 31: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

ICP-Summary

� ICP is a powerful algorithm for calculating the displacement between scans.

� The major problem is to determine the correct data associations.

� Given the correct data associations, the transformation can be computed efficiently using SVD.

Page 32: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

RANSAC

� RANdom Sample Consensus� Only 3 point correspondences are necessary to obtain an alignment� If we have a set of putative correspondences, we could get a

reasonable solution by sampling set of 3 correspondences� The quality of the solution is then measured by computing the error

distance between corresponding points after applying the transformation

� To ensure robusteness, the procedure is repeated N times, and only the best solution is taken.

� Cons:� Requires “reasonable“ initial associations, typically obtained by

performing a first appearance based matching in the feature space� If the outliers are many it can be slow

� Pros:� Ideally it does not require an initial guess� Good estimate of number of tosses N needed to get a good model with

probability p given the outlier probability o, and the minimal number of points n

Page 33: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Example: RGBD-SLAM

� Extract visual features + depth from RGBD images

� Select subsets of 3 points and determine the transformation

� Works because the visual features are highly distinctive

� <show demo>

Page 34: Scan-Matching using ICP andRANSACgrisetti/teaching/lectures-ls-slam-master_2014… · Part of the material of this course is taken from the Robotics 2lectures given by G.Grisetti,

Conclusions

� ICP is good to align 3D data

� The strategy to select the associations plays an important role

� To get good correspondences, use as much structure as it is available� Divide the points into classes

� Use the normals

� Features

� With RANSAC we can align structured data without an initial guess.