SLAM之特征匹配(四)————RANSAC -------ICP RANSAC

Point Clouds

 A point cloud is a data structure used to represent a collection of multi-dimensional points and is commonly used to represent three-dimensional data.
 In a 3D point cloud, the points usually represent the X, Y, and Z geometric coordinates of an underlying sampled surface. When color information is present, the point cloud becomes 4D. 

 

 

 

1.IO

PCD File Format
A simple file format for storing multi-dimensional point data. It consists of a text header (with the fields below), followed by the data in ASCII (w/ points on separate lines) or binary (a memory
copy of the points vector of the PC).

  • VERSION - the PCD file version (usually .7)
  • FIELDS - the name of each dimension/field that a point can have (e.g. FIELDS x y z )
  • SIZE - the size of each dimension in bytes (e.g. a float is 4)
  • TYPE - the type of each dimension as a char (I= signed,U= unsigned,F= float)
  • COUNT - the number of elements in each dimension (e.g. x, y, or z would only have 1, but a histogram would haveN)
  • WIDTH - the width of the point cloud
  • HEIGHT - the height of the point cloud
  • VIEWPOINT - an acquisition viewpoint for the points: translation (tx ty tz) + quaternion (qw qx qy qz)
  • POINTS - the total number of points in the cloud
  • DATA - the data type that the point cloud data is stored in (asciiorbinary)

 

2.3D Features

Normal Estimation
 
How do we compute normals in practice? 
  • Input: point cloud Pof 3D pointsp= (x;,y,z)T 
 
  • Surface Normal Estimation:
  1. Select a set of pointsQ ⊆ Pfrom the neighborhood ofp.
  2. Fit a local plane throughQ.
  3. Compute the normal~nof the plane.
 
Computing 3D Features
  setInputCloud = False setInputCloud = True
setSearchSurface = False compute on all points, using all points compute on a subset,using all points
setSearchSurface = True compute on all points, using a subset compute on a subset,using a subse

3.Filtering

 When working with 3D data, there are many reasons for filtering your data:

  • Restricting range (PassThrough)
  • Downsampling (VoxelGrid)
  • Outlier removal(StatisticalOutlierRemoval /RadiusOutlierRemoval)
  • Selecting indices
  • Projecting points

PassThrough Filter 

 Filter out points outside a specified range in one dimension. (Or filter them in with setFilterLimitsNegative)

Downsampling to a Voxel Grid

 Voxelize the cloud to a 3D grid. Each occupied voxel is approximated by the centroid of the points inside of it.

Statistical Outlier Removal

 Filter points based on their local point densities. Remove points that are sparse relative to the mean point density of the whole cloud.

Conditional or Radius Outlier removal

Projecting points

Project points onto a parametric model.

Extracting indices

 Extract a subset of points from a point cloud based on the indices output by a segmentation algorithm.

4.Keypoint

What is a keypoint? 

 A keypoint (also known as an \interest point") is simply a point that has been identied as a relevant in some way. A good keypoint detector will find points with the following properties:

 

  • SparsenessTypically, only a small subset of the points in the scene are keypoints.
  • Repeatiblity:If a point was determined to be a keypoint in one point cloud, a keypoint should also be found at the corresponding location in a similar point cloud. (Such points are often called "stable".)
  • Distinctiveness:The area surrounding each keypoint should have a unique shape or appearance that can be captured by some feature descriptor.

 

Why compute keypoints?

 

  • Some features are expensive to compute, and it would be prohibitive to compute them at every point. Keypoints identifya small number of locationswhere computing feature descriptors is likely to be most effective.
  • When searching for corresponding points, features computed at non-descriptive points will lead to ambiguous feature corespondences. By ignoring non-keypoints, one canreduce error when matching points.

 

 

Detecting 3D SIFT Keypoints
Computing PFH Features at Keypoints 
Finding Correspondences

5.Trees

K-d Trees

 A k-d tree, or k-dimensional tree, is a data structure used in computer science for organizing some number of points in a space with k dimensions. It is a binary search tree with other constraints imposed on it. K-d trees are very useful for range and nearest neighbor searches.


 

 

Octrees

 An octree is a tree-based data structure for managing sparse 3-D data. Each internal node has exactly eight children.

6.Sample Consensus & Segmentation

 The Random Sample Consensus (RANSAC) algorithm assumes the data is comprised of both inliers and outliers. The distribution of inliers can be explained by a set of parameters and a model. The outlying data does not fit the model. 
Its basic operation: line example
  1. select sample set— 2 points
  2. compute model— line equation
  3. compute and count inliers— e.g.band
  4. repeat untilsufficiently confident — e.g. 95%
several extensions exist in PCL:
  • MSAC (weighted distances instead of hard thresholds)
  • MLESAC (Maximum Likelihood Estimator)
  • PROSAC (Progressive Sample Consensus)
also, several model types are provided in PCL:
  • Plane models (with constraints such as orientation)
  • Cone
  • Cylinder
  • Sphere
  • Line
  • Circle
  • ...

7.Registration

Iterative Closest Point 
 ICP iteratively revises the transformation (translation, rotation) needed to minimize the distance between the points of two raw scans.
 Inputs: points from two raw scans, initial estimation of the transformation, criteria for stopping the iteration.
 Output: refined transformation.
 The algorithm steps are :
  1. Associate points by the nearest neighbor criteria.
  2. Estimate transformation parameters using a mean square cost function.
  3. Transform the points using the estimated parameters.
  4. Iterate (re-associate the points and so on).
官方例程
 

你可能感兴趣的:(ORB-SLAM,SLAM)