iterative closest points
CEV ICP algorithm library
|
Interface for iterative closest points. More...
#include <icp.h>
Classes | |
class | Config |
Configuration for ICP instances. More... | |
struct | Match |
A matching between point and pair at (arbitrary) cost cost . More... | |
Public Member Functions | |
virtual | ~ICP ()=default |
void | begin (const std::vector< Vector > &a, const std::vector< Vector > &b, RBTransform t) |
Begins the ICP process for point clouds a and b with an initial guess for the transform t . | |
virtual void | iterate ()=0 |
Perform one iteration of ICP for the point clouds a and b provided with ICP::begin. | |
double | calculate_cost () const |
Computes the cost of the current transformation. | |
const RBTransform & | current_transform () const |
The current transform. | |
Static Public Member Functions | |
static bool | register_method (std::string name, std::function< std::unique_ptr< ICP >(const Config &)> constructor) |
Registers a new ICP method that can be created with constructor , returning false if name has already been registered. | |
static bool | is_method_registered (std::string name) |
Returns true if the ICP method name is registered. | |
static const std::vector< std::string > & | registered_methods () |
Returns a current list of the names of currently registered ICP methods. | |
static std::optional< std::unique_ptr< ICP > > | from_method (std::string name, const Config ¶ms=Config()) |
Factory constructor for the ICP method name with configuration config . | |
Protected Member Functions | |
ICP () | |
virtual void | setup ()=0 |
Per-method setup code. | |
Protected Attributes | |
RBTransform | transform |
The current point cloud transformation that is being optimized. | |
std::vector< Vector > | a |
The source point cloud. | |
std::vector< Vector > | b |
The destination point cloud. | |
std::vector< Match > | matches |
The pairing of each point in a to its closest in b . | |
Interface for iterative closest points.
Generally, you should interact with ICP instances through this interface or ICPDriver
, though interacting with implementations directly isn't explicitly disallowed. Read Writing an ICP Instance for additional information.
a
and b
be two point clouds of type std::vector<Vector>
. Then, given an ICP instance icp
of type std::unique_ptr<icp::ICP>
, perform the following steps.icp->begin(a, b, initial_guess)
.icp->iterate()
until convergence. ICPDriver
can also be used to specify convergence conditions.If these steps are not followed as described here, the behavior is undefined.
At any point in the process, you may query icp->calculate_cost()
and icp->transform()
. Do note, however, that icp->calculate_cost()
is not a constant-time operation.
|
virtualdefault |
void icp::ICP::begin | ( | const std::vector< Vector > & | a, |
const std::vector< Vector > & | b, | ||
RBTransform | t | ||
) |
double icp::ICP::calculate_cost | ( | ) | const |
const RBTransform & icp::ICP::current_transform | ( | ) | const |
|
static |
Factory constructor for the ICP method name
with configuration config
.
name
is a valid registered method. See ICP::registered_methods.
|
static |
|
pure virtual |
Perform one iteration of ICP for the point clouds a
and b
provided with ICP::begin.
matches
with newest match data. Implemented in icp::FeatureAware, icp::Trimmed, and icp::Vanilla.
|
static |
|
protectedpure virtual |
Per-method setup code.
matches
with match data for the initial point clouds. Implemented in icp::FeatureAware, icp::Trimmed, and icp::Vanilla.
|
protected |
|
protected |
|
protected |
|
protected |