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 > | |
T | cpuLength (T *x) |
Computes the vector length ( \(\ell_2\) norm). More... | |
template<typename T > | |
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 > | |
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... | |
Offers functions that are serial CPU
implementations of the relevant algorithms in the ICP
pipeline.
T ICP::cpuDistance | ( | T * | x1, |
T * | x2 | ||
) |
Computes the vector distance ( \(\ell_2\) norm).
T | type of the data to be handled. |
[in] | x1 | 4-vector. |
[in] | x2 | 4-vector. |
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.
T | type of the data to be handled. |
[in] | in | input data. |
[out] | out | output (scan) data. |
[in] | width | width of the array. |
[in] | height | height of the array. |
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.
T | type of the data to be handled. |
[in] | F | fixed set of 8-D elements. |
[in] | M | moving set of 8-D elements. |
[out] | DM | array (moving set deviations) of 4-D elements. |
[out] | DF | array (fixed set deviations) of 4-D elements. |
[in] | mean | fixed and moving set means. |
[in] | n | number of points in the sets. |
void ICP::cpuICPLMs | ( | T * | in, |
T * | out | ||
) |
Samples a point cloud for 16384 (128x128) landmarks.
It is just a naive serial implementation.
T | type of the data to be handled. |
[in] | in | input data. |
[out] | out | output (LM) data. |
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.
T | type of the data to be handled. |
[in] | F | fixed set. |
[in] | M | moving set. |
[out] | mean | output data. |
[in] | n | number of points in the array. |
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.
T | type of the data to be handled. |
[in] | F | fixed set. |
[in] | M | moving set. |
[out] | MEAN | output data. |
[in] | W | weights. |
[in] | n | number of points in the array. |
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.
T | type of the data to be handled. |
[in] | Sij | sums of products. |
[in] | means | fixed and moving set means. |
[out] | Tk | the 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 \). |
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.
T | type of the data to be handled. |
[in] | in | input data. |
[out] | out | output (LM) data. |
[in] | nr | number of representatives. |
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.
T | type of the data to be handled. |
[in] | DM | input array (moving set deviations) of 4-D elements. |
[in] | DF | input array (fixed set deviations) of 4-D elements. |
[out] | S | output (sums of products) matrix S. |
[in] | m | number of points in the sets. |
[in] | c | scaling factor. |
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.
T | type of the data to be handled. |
[in] | M | input array (moving set deviations) of 4-D elements. |
[in] | F | input array (fixed set deviations) of 4-D elements. |
[in] | W | input array (weights). |
[out] | S | output (sums of products) matrix S. |
[in] | m | number of points in the sets. |
[in] | c | scaling factor. |
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.
T | type of the data to be handled. |
[in] | M | input array (set of points) of 8-D elements. |
[out] | tM | output array (transformed points) of 8-D elements. |
[in] | D | transformation parameters. |
[in] | m | number of points in the set. |
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.
T | type of the data to be handled. |
[in] | M | input array (set of points) of 8-D elements. |
[out] | tM | output array (transformed points) of 8-D elements. |
[in] | D | transformation parameters. |
[in] | m | number of points in the set. |
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.
T | type of the data to be handled. |
[in] | M | input array (set of points) of 8-D elements. |
[out] | tM | output array (transformed points) of 8-D elements. |
[in] | D | transformation parameters. |
[in] | m | number of points in the set. |
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.
T | type of the data to be handled. |
[in] | D | input data (distances). |
[out] | W | output data (weights). |
[out] | SW | output data (sum of weights). |
[in] | n | number of elements in the input array. |
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.
T | type of the data to be handled. |
[in] | in | input data. |
[out] | out | output (scan) data. |
[in] | width | width of the array. |
[in] | height | height of the array. |
T ICP::cpuLength | ( | T * | x | ) |
Computes the vector length ( \(\ell_2\) norm).
T | type of the data to be handled. |
[in] | x | 4-vector. |
void ICP::cpuNormalize | ( | T * | x | ) |
Normalizes a vector.
T | type of the data to be handled. |
x | 4-vector. |
void ICP::cpuProd | ( | T * | N, |
T * | x, | ||
T * | x_new | ||
) |
Computes a matrix-vector product, \( x_{new}=Nx \).
T | type of the data to be handled. |
[in] | N | 4x4 matrix. |
[in] | x | 4-vector. |
[out] | x_new | 4-vector. |
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.
[in] | in | input data. |
[out] | out | output (reduced) data. |
[in] | cols | number of columns in the input array. |
[in] | rows | number of rows in the input array. |
[in] | func | function supporting the requested operation. |
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.
[in] | in | input data. |
[out] | out | output (reduced) data. |
[in] | cols | number of columns in the input array. |
[in] | rows | number of rows in the input array. |
void ICP::cross_product | ( | T * | a, |
T * | b, | ||
T * | c | ||
) |
Performs a cross product.
It is just a naive serial implementation.
T | type of the data to be handled. |
[in] | a | first input vector. |
[in] | b | second input vector. |
[out] | c | output vector. |
uint64_t ICP::nextPow2 | ( | T | num | ) |
Returns the first power of 2 greater than or equal to the input.
[in] | num | input number. |
void ICP::printBuffer | ( | const char * | title, |
T * | ptr, | ||
uint32_t | width, | ||
uint32_t | height | ||
) |
Prints an array of an integer type to standard output.
T | type of the data to be printed. |
[in] | title | legend for the output. |
[in] | ptr | array that is to be displayed. |
[in] | width | width of the array. |
[in] | height | height of the array. |
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.
T | type of the data to be printed. |
[in] | title | legend for the output. |
[in] | ptr | array that is to be displayed. |
[in] | width | width of the array. |
[in] | height | height of the array. |
[in] | prec | the number of decimal places to print. |
bool ICP::setProfilingFlag | ( | int | argc, |
char ** | argv | ||
) |
Checks the command line arguments for the profiling flag, --profiling
.
[in] | argc | command line argument count |
[in] | argv | command line arguments |
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)\).