ICP  1.1.0
 Hosted by GitHub
Functions | Variables
ICP Namespace Reference

Offers functions that are serial CPU implementations of the relevant algorithms in the ICP pipeline. More...

Functions

bool setProfilingFlag (int argc, char **argv)
 Checks the command line arguments for the profiling flag, --profiling. More...
 
template<typename T >
uint64_t nextPow2 (T num)
 Returns the first power of 2 greater than or equal to the input. More...
 
template<typename T >
void printBuffer (const char *title, T *ptr, uint32_t width, uint32_t height)
 Prints an array of an integer type to standard output. More...
 
template<typename T >
void printBufferF (const char *title, T *ptr, uint32_t width, uint32_t height, uint32_t prec)
 Prints an array of floating-point type to standard output. More...
 
template<typename T >
void cpuReduce (T *in, T *out, uint32_t cols, uint32_t rows, std::function< bool(T, T)> func)
 Reduces each row of an array to a single element. More...
 
template<typename T >
void cpuReduceSum (T *in, T *out, uint32_t cols, uint32_t rows)
 Reduces each row of an array to a single element (sum). More...
 
template<typename T >
void cpuInScan (T *in, T *out, uint32_t width, uint32_t height)
 Performs an inclusive scan operation on the columns of an array. More...
 
template<typename T >
void cpuExScan (T *in, T *out, uint32_t width, uint32_t height)
 Performs an exclusive scan operation on the columns of an array. More...
 
template<typename T >
void cpuICPLMs (T *in, T *out)
 Samples a point cloud for 16384 (128x128) landmarks. More...
 
template<typename T >
void cpuICPReps (T *in, T *out, uint32_t nr)
 Samples a set of 16384 (128x128) landmarks for representatives. More...
 
template<typename T >
void cpuICPWeights (rbc_dist_id *D, T *W, cl_double *SW, uint32_t n)
 Computes weights for pairs of points in the fixed and moving sets, and also reduces them to get their sum. More...
 
template<typename T >
void cpuICPMean (T *F, T *M, T *mean, uint32_t n)
 Computes the mean on the xyz dimensions of the set of 8-D points. More...
 
template<typename T >
void cpuICPMeanWeighted (T *F, T *M, T *MEAN, T *W, uint32_t n)
 Computes the weighted mean on the xyz dimensions of the set of 8-D points. More...
 
template<typename T >
void cpuICPDevs (T *F, T *M, T *DF, T *DM, T *mean, uint32_t n)
 Computes the deviations of a set of points from their mean. More...
 
template<typename T >
void cpuICPS (T *DM, T *DF, T *S, uint32_t m, float c)
 Calculates the S matrix and the constituents of the scale factor s. More...
 
template<typename T >
void cpuICPSw (T *M, T *F, T *W, T *S, uint32_t m, float c)
 Calculates the S matrix and the constituents of the scale factor s. More...
 
template<typename T >
void cross_product (T *a, T *b, T *c)
 Performs a cross product. More...
 
template<typename T >
void cpuICPTransformQ (T *M, T *tM, T *D, uint32_t m)
 Performs a homogeneous transformation on a set of points using a quaternion and a translation vector. More...
 
template<typename T >
void cpuICPTransformQ2 (T *M, T *tM, T *D, uint32_t m)
 Performs a homogeneous transformation on a set of points using a quaternion and a translation vector. More...
 
template<typename T >
void cpuICPTransformM (T *M, T *tM, T *D, uint32_t m)
 Performs a homogeneous transformation on a set of points using a transformation matrix. More...
 
template<typename T >
cpuLength (T *x)
 Computes the vector length ( \(\ell_2\) norm). More...
 
template<typename T >
cpuDistance (T *x1, T *x2)
 Computes the vector distance ( \(\ell_2\) norm). More...
 
template<typename T >
void cpuNormalize (T *x)
 Normalizes a vector. More...
 
template<typename T >
void cpuProd (T *N, T *x, T *x_new)
 Computes a matrix-vector product, \( x_{new}=Nx \). More...
 
template<typename T >
cpuICPPowerMethod (T *Sij, T *means, T *Tk)
 Computes the quantities that represent the incremental development in the transformation estimation in iteration k. More...
 

Variables

std::function< unsigned char()> rNum_0_255 = std::bind (distribution1, generator)
 Uniform number generator in the range \([0, 255]\). More...
 
std::function< unsigned short()> rNum_0_10000 = std::bind (distribution2, generator)
 Uniform number generator in the range \([0, 10000]\). More...
 
std::function< float()> rNum_R_0_1 = std::bind (distributionR1, generator)
 Uniform number generator in the range \([0.0, 1.0)\). More...
 
std::function< float()> rNum_R_1_255_E__6 = std::bind (distributionR2, generator)
 Uniform number generator in the range \([1e-6, 255*1e-6)\). More...
 

Detailed Description

Offers functions that are serial CPU implementations of the relevant algorithms in the ICP pipeline.

Function Documentation

template<typename T >
T ICP::cpuDistance ( T *  x1,
T *  x2 
)

Computes the vector distance ( \(\ell_2\) norm).

Template Parameters
Ttype of the data to be handled.
Parameters
[in]x14-vector.
[in]x24-vector.
Returns
The vector distance.
template<typename T >
void ICP::cpuExScan ( T *  in,
T *  out,
uint32_t  width,
uint32_t  height 
)

Performs an exclusive scan operation on the columns of an array.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]ininput data.
[out]outoutput (scan) data.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
void ICP::cpuICPDevs ( T *  F,
T *  M,
T *  DF,
T *  DM,
T *  mean,
uint32_t  n 
)

Computes the deviations of a set of points from their mean.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Ffixed set of 8-D elements.
[in]Mmoving set of 8-D elements.
[out]DMarray (moving set deviations) of 4-D elements.
[out]DFarray (fixed set deviations) of 4-D elements.
[in]meanfixed and moving set means.
[in]nnumber of points in the sets.
template<typename T >
void ICP::cpuICPLMs ( T *  in,
T *  out 
)

Samples a point cloud for 16384 (128x128) landmarks.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]ininput data.
[out]outoutput (LM) data.
template<typename T >
void ICP::cpuICPMean ( T *  F,
T *  M,
T *  mean,
uint32_t  n 
)

Computes the mean on the xyz dimensions of the set of 8-D points.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Ffixed set.
[in]Mmoving set.
[out]meanoutput data.
[in]nnumber of points in the array.
template<typename T >
void ICP::cpuICPMeanWeighted ( T *  F,
T *  M,
T *  MEAN,
T *  W,
uint32_t  n 
)

Computes the weighted mean on the xyz dimensions of the set of 8-D points.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Ffixed set.
[in]Mmoving set.
[out]MEANoutput data.
[in]Wweights.
[in]nnumber of points in the array.
template<typename T >
T ICP::cpuICPPowerMethod ( T *  Sij,
T *  means,
T *  Tk 
)

Computes the quantities that represent the incremental development in the transformation estimation in iteration k.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Sijsums of products.
[in]meansfixed and moving set means.
[out]Tkthe unit quaternion \( \dot{q_k} = q_w + q_x i + q_y j + q_z k = \left[ \begin{matrix} q_x & q_y & q_z & q_w \end{matrix} \right]^T \), and the translation vector \( t_k=\left[ \begin{matrix} t_x & t_y & t_z & 1 \end{matrix} \right]^T \). The scale is placed in the last element of the translation vector. That is, \( t_k = \left[ \begin{matrix} t_x & t_y & t_z & s_k \end{matrix} \right]^T \).
template<typename T >
void ICP::cpuICPReps ( T *  in,
T *  out,
uint32_t  nr 
)

Samples a set of 16384 (128x128) landmarks for representatives.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]ininput data.
[out]outoutput (LM) data.
[in]nrnumber of representatives.
template<typename T >
void ICP::cpuICPS ( T *  DM,
T *  DF,
T *  S,
uint32_t  m,
float  c 
)

Calculates the S matrix and the constituents of the scale factor s.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]DMinput array (moving set deviations) of 4-D elements.
[in]DFinput array (fixed set deviations) of 4-D elements.
[out]Soutput (sums of products) matrix S.
[in]mnumber of points in the sets.
[in]cscaling factor.
template<typename T >
void ICP::cpuICPSw ( T *  M,
T *  F,
T *  W,
T *  S,
uint32_t  m,
float  c 
)

Calculates the S matrix and the constituents of the scale factor s.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Minput array (moving set deviations) of 4-D elements.
[in]Finput array (fixed set deviations) of 4-D elements.
[in]Winput array (weights).
[out]Soutput (sums of products) matrix S.
[in]mnumber of points in the sets.
[in]cscaling factor.
template<typename T >
void ICP::cpuICPTransformM ( T *  M,
T *  tM,
T *  D,
uint32_t  m 
)

Performs a homogeneous transformation on a set of points using a transformation matrix.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Minput array (set of points) of 8-D elements.
[out]tMoutput array (transformed points) of 8-D elements.
[in]Dtransformation parameters.
[in]mnumber of points in the set.
template<typename T >
void ICP::cpuICPTransformQ ( T *  M,
T *  tM,
T *  D,
uint32_t  m 
)

Performs a homogeneous transformation on a set of points using a quaternion and a translation vector.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Minput array (set of points) of 8-D elements.
[out]tMoutput array (transformed points) of 8-D elements.
[in]Dtransformation parameters.
[in]mnumber of points in the set.
template<typename T >
void ICP::cpuICPTransformQ2 ( T *  M,
T *  tM,
T *  D,
uint32_t  m 
)

Performs a homogeneous transformation on a set of points using a quaternion and a translation vector.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Minput array (set of points) of 8-D elements.
[out]tMoutput array (transformed points) of 8-D elements.
[in]Dtransformation parameters.
[in]mnumber of points in the set.
template<typename T >
void ICP::cpuICPWeights ( rbc_dist_id *  D,
T *  W,
cl_double *  SW,
uint32_t  n 
)

Computes weights for pairs of points in the fixed and moving sets, and also reduces them to get their sum.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]Dinput data (distances).
[out]Woutput data (weights).
[out]SWoutput data (sum of weights).
[in]nnumber of elements in the input array.
template<typename T >
void ICP::cpuInScan ( T *  in,
T *  out,
uint32_t  width,
uint32_t  height 
)

Performs an inclusive scan operation on the columns of an array.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]ininput data.
[out]outoutput (scan) data.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
T ICP::cpuLength ( T *  x)

Computes the vector length ( \(\ell_2\) norm).

Template Parameters
Ttype of the data to be handled.
Parameters
[in]x4-vector.
Returns
The vector length.
template<typename T >
void ICP::cpuNormalize ( T *  x)

Normalizes a vector.

Template Parameters
Ttype of the data to be handled.
Parameters
x4-vector.
template<typename T >
void ICP::cpuProd ( T *  N,
T *  x,
T *  x_new 
)

Computes a matrix-vector product, \( x_{new}=Nx \).

Template Parameters
Ttype of the data to be handled.
Parameters
[in]N4x4 matrix.
[in]x4-vector.
[out]x_new4-vector.
template<typename T >
void ICP::cpuReduce ( T *  in,
T *  out,
uint32_t  cols,
uint32_t  rows,
std::function< bool(T, T)>  func 
)

Reduces each row of an array to a single element.

It is just a naive serial implementation.

Parameters
[in]ininput data.
[out]outoutput (reduced) data.
[in]colsnumber of columns in the input array.
[in]rowsnumber of rows in the input array.
[in]funcfunction supporting the requested operation.
template<typename T >
void ICP::cpuReduceSum ( T *  in,
T *  out,
uint32_t  cols,
uint32_t  rows 
)

Reduces each row of an array to a single element (sum).

It is just a naive serial implementation.

Parameters
[in]ininput data.
[out]outoutput (reduced) data.
[in]colsnumber of columns in the input array.
[in]rowsnumber of rows in the input array.
template<typename T >
void ICP::cross_product ( T *  a,
T *  b,
T *  c 
)

Performs a cross product.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]afirst input vector.
[in]bsecond input vector.
[out]coutput vector.
template<typename T >
uint64_t ICP::nextPow2 ( num)

Returns the first power of 2 greater than or equal to the input.

Parameters
[in]numinput number.
Returns
The first power of 2 >= num.
template<typename T >
void ICP::printBuffer ( const char *  title,
T *  ptr,
uint32_t  width,
uint32_t  height 
)

Prints an array of an integer type to standard output.

Template Parameters
Ttype of the data to be printed.
Parameters
[in]titlelegend for the output.
[in]ptrarray that is to be displayed.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
void ICP::printBufferF ( const char *  title,
T *  ptr,
uint32_t  width,
uint32_t  height,
uint32_t  prec 
)

Prints an array of floating-point type to standard output.

Template Parameters
Ttype of the data to be printed.
Parameters
[in]titlelegend for the output.
[in]ptrarray that is to be displayed.
[in]widthwidth of the array.
[in]heightheight of the array.
[in]precthe number of decimal places to print.
bool ICP::setProfilingFlag ( int  argc,
char **  argv 
)

Checks the command line arguments for the profiling flag, --profiling.

Parameters
[in]argccommand line argument count
[in]argvcommand line arguments
Returns
A flag to indicate whether a command line argument for profiling was provided.

Variable Documentation

std::function< unsigned short()> ICP::rNum_0_10000 = std::bind (distribution2, generator)

Uniform number generator in the range \([0, 10000]\).

std::function< unsigned char()> ICP::rNum_0_255 = std::bind (distribution1, generator)

Uniform number generator in the range \([0, 255]\).

std::function< float()> ICP::rNum_R_0_1 = std::bind (distributionR1, generator)

Uniform number generator in the range \([0.0, 1.0)\).

std::function< float()> ICP::rNum_R_1_255_E__6 = std::bind (distributionR2, generator)

Uniform number generator in the range \([1e-6, 255*1e-6)\).