PCL :: Registration
Initial Alignment of 3D Point Clouds
Dirk Holz
November 6, 2011
Registration
Registering 3D Point Clouds for building 3D models of objects,
table scenes, and whole rooms/buildings/outdoor environments.
1. Initial alignment (registration without previous knowledge)
2. Iterative refinement (given an initial alignment)
3. Multi-view registration
Point Cloud Library (PCL)Dirk Holz
Registration
Registering 3D Point Clouds
I Given a source point cloud and a target point cloud
1. determine correspondence pairs,
2. estimate a transformation that aligns the correspondences,
3. apply the transformation to align source and target.
I correspondences can be anything (points/features/. . . )!
Point Cloud Library (PCL)Dirk Holz
Registration
Registration Pipeline in PCL
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (1/9)
1. Compute sets of keypoints
2. Compute (local) feature descriptors (e.g. FPFH)
3. Match features to find correspondences
4. Estimate transformation from correspondences
0
5
10
15
20
25
30
35
0 2 4 6 8 10 12 14 16
R
a t
i o
o
f p
o i
n t
s
i n
o
n e
b
i n
( %
)
Bins
Persistent Feature Points Histograms
P1
Q1
0
5
10
15
20
25
30
35
0 2 4 6 8 10 12 14 16
R
a t
i o
o
f p
o i
n t
s
i n
o
n e
b
i n
( %
)
Bins
Persistent Feature Points Histograms
P2
Q2
0
5
10
15
20
25
30
35
0 2 4 6 8 10 12 14 16
R
a t
i o
o
f p
o i
n t
s
i n
o
n e
b
i n
( %
)
Bins
Persistent Feature Points Histograms
P3
Q3
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (2/9)
Code: Matching Features
CorrespondenceEstimation
est;
est.setInputCloud (source_features);
est.setInputTarget (target_features);
est.determineCorrespondences (correspondences);
Example: Found correspondences / matches
$ correspondence_viewer robot0 robot1 -n 50
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (3/9)
Transformation Estimation
I Several methods for computing a transformation T = (R, t)
given correspondence pairs (di ,mi):
I Point-to-point
I Point-to-plane
I Plane-to-plane
I . . . and many others
I Simple solution (based on SVD) for minimizing
point-to-point distance (least squares error E):
E(T ) =
∑
i
(mi − (Rdi + t))2
pcl::registration::TransformationEstimationSVD
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (4/9)
Code: Transformation estimation
Eigen::Matrix4f transformation;
TransformationEstimationSVD svd;
svd.estimateRigidTransformation(source, target,
correspondences, transformation);
Example: Simple initial alignment
Problem: False correspondences!
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (5/9)
Rejecting false correspendences (outliers) uing SAC
I Draw three correspondences pairs di ,mi
I Estimate transformation (R, t) for these samples
I Determine inlier pairs with ((Rdi + t)−mi)2 < �
I Repeat N times, and use (R, t) having most inliers
Code: SAC-based correspondence rejection
CorrespondenceRejectorSampleConsensus sac;
sac.setInputCloud(source);
sac.setTargetCloud(target);
sac.setInlierThreshold(epsilon);
sac.setMaxIterations(N);
sac.setInputCorrespondences(correspondences);
sac.getCorrespondences(inliers);
Eigen::Matrix4f transformation = sac.
getBestTransformation();
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (6/9)
Example: SAC-based correspondence rejection
Initial correspondences:
Inliers:
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (7/9)
Problem: In case of less descriptive features, the best match mi
may not be the true correspondence for di !
SAC-IA: Sampled Consesus-Initial Alignment
1. Draw n points di from the source cloud
(with a minimum distance d in between).
2. For each drawn di :
2.1 get k closest matches, and
2.2 draw one of the k closest matches as mi
(instead of taking closest match)
3. Estimate transformation (R, t) for these samples
4. Determine inlier pairs with ((Rdi + t)−mi)2 < �
5. Repeat N times, and use (R, t) having most inliers
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (8/9)
Code: Sampled Consesus-Initial Alignment
pcl::SampleConsensusInitialAlignment
sac_ia;
sac_ia.setNumberOfSamples (n)
sac_ia.setMinSampleDistance (d);
sac_ia.setCorrespondenceRandomness (k);
sac_ia.setMaximumIterations (N);
sac_ia.setInputCloud (source);
sac_ia.setInputTarget (target);
sac_ia.setSourceFeatures (source_features);
sac_ia.setTargetFeatures (target_features);
sac_ia.align (aligned_source);
Eigen::Matrix4f = sac_ia.getFinalTransformation ();
Point Cloud Library (PCL)Dirk Holz
Initial Alignment (9/9)
Example: Sampled Consesus-Initial Alignment
$ test_registration robot0 robot1 -i 0.025,0.01,500
Point Cloud Library (PCL)Dirk Holz
Outlook: Next Talk (1/2)
Sampled Consesus-Initial Alignment + refinement
$ test_registration robot0 robot1 \
-i 0.025,0.01,500 -r 0.05,0.05,0,100
Point Cloud Library (PCL)Dirk Holz
Outlook: Next Talk (2/2)
Multi-cloud Registration
Point Cloud Library (PCL)Dirk Holz
That’s it!
Thank you for your attention!
Any questions?
Point Cloud Library (PCL)Dirk Holz