Interface class for the ICP pipeline using the Power Method to estimate the rotation and considering weighted residual errors.
More...
#include <algorithms.hpp>

Public Types | |
| enum | Memory : uint8_t { Memory::H_IN_F, Memory::H_IN_M, Memory::H_IO_T, Memory::D_IN_F, Memory::D_IN_M, Memory::D_IO_T } |
| Enumerates the memory objects handled by the class. More... | |
Public Member Functions | |
| ICPStep (clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _infoRBC, clutils::CLEnvInfo< 1 > _infoICP) | |
Configures an OpenCL environment as specified by _info. More... | |
| cl::Memory & | get (ICPStep::Memory mem) |
| Returns a reference to an internal memory object. More... | |
| void | init (unsigned int _m, unsigned int _nr, float _a=1e2f, float _c=1e-6f, Staging _staging=Staging::IO) |
| Configures kernel execution parameters. More... | |
| void | write (ICPStep::Memory mem=ICPStep::Memory::D_IN_F, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr) |
| Performs a data transfer to a device buffer. More... | |
| void * | read (ICPStep::Memory mem=ICPStep::Memory::H_IO_T, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr) |
| Performs a data transfer to a staging buffer. More... | |
| void | buildRBC (const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr) |
| Builds the RBC data structure. More... | |
| void | run (const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr, bool config=false) |
| Executes the necessary kernels. More... | |
| float | getAlpha () |
Gets the scaling parameter \( \alpha \) involved in the distance calculations of the RBC data structure. More... | |
| void | setAlpha (float _a) |
Sets the scaling parameter \( \alpha \) involved in the distance calculations of the RBC data structure. More... | |
| float | getScaling () |
Gets the scaling factor c used when computing the S matrix. More... | |
| void | setScaling (float _c) |
Sets the scaling factor c used when computing the S matrix. More... | |
| template<typename period > | |
| double | run (clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr, bool config=false) |
| Executes the necessary kernels. More... | |
Public Attributes | |
| cl_float * | hPtrInF |
| cl_float * | hPtrInM |
| cl_float * | hPtrIOT |
| Eigen::Matrix3f | Rk |
| Eigen::Quaternionf | qk |
| Eigen::Vector3f | tk |
| cl_float | sk |
| Eigen::Matrix3f | R |
| Eigen::Quaternionf | q |
| Eigen::Vector3f | t |
| cl_float | s |
Protected Attributes | |
| clutils::CLEnv & | env |
| clutils::CLEnvInfo< 1 > | infoRBC |
| clutils::CLEnvInfo< 1 > | infoICP |
| cl::Context | context |
| cl::CommandQueue | queue |
| Staging | staging |
| ICPReps | fReps |
| RBC::RBCConstruct< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC > | rbcC |
| ICPTransform< ICPTransformConfig::QUATERNION > | transform |
| RBC::RBCSearch< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT > | rbcS |
| ICPWeights | weights |
| ICPMean< ICPMeanConfig::WEIGHTED > | means |
| ICPDevs | devs |
| ICPS< ICPSConfig::WEIGHTED > | matrixS |
| ICPPowerMethod | powMethod |
| cl_float * | Tk |
| float | a |
| float | c |
| unsigned int | m |
| unsigned int | nr |
| unsigned int | d |
| unsigned int | bufferFMSize |
| unsigned int | bufferTSize |
| cl::Buffer | hBufferInF |
| cl::Buffer | hBufferInM |
| cl::Buffer | hBufferIOT |
| cl::Buffer | dBufferInF |
| cl::Buffer | dBufferInM |
| cl::Buffer | dBufferIOT |
Interface class for the ICP pipeline using the Power Method to estimate the rotation and considering weighted residual errors.
Performs one ICP iteration. It accepts two sets (fixed and moving) of landmarks, estimates the relative homogeneous transformation \( (\dot{q}_k,t_k) \) between them, and transforms the moving set according to this transformation.
GPU. The rotation computation is also solved on the GPU with the Power Method. get to get references to the placeholders within the class and assign them to your buffers. You will have to do this strictly before the call to init. You can also call get (after the call to init) to get a reference to a buffer within the class and assign it to another kernel class instance further down in your task pipeline.The following input/output OpenCL memory objects are created by a ICPStep<ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED> instance:
| Name | Type | Placement | I/O | Use | Properties | Size |
|---|---|---|---|---|---|---|
| H_IN_F | Buffer | Host | I | Staging | CL_MEM_READ_WRITE | \(m*sizeof\ (cl\_float8)\) |
| H_IN_M | Buffer | Host | I | Staging | CL_MEM_READ_WRITE | \(m*sizeof\ (cl\_float8)\) |
| H_IO_T | Buffer | Host | IO | Staging | CL_MEM_READ_WRITE | \(2*sizeof\ (cl\_float4)\) |
| D_IN_F | Buffer | Device | I | Processing | CL_MEM_READ_ONLY | \(m*sizeof\ (cl\_float8)\) |
| D_IN_M | Buffer | Device | I | Processing | CL_MEM_READ_ONLY | \(m*sizeof\ (cl\_float8)\) |
| D_IO_T | Buffer | Device | IO | Processing | CL_MEM_READ_WRITE | \(2*sizeof\ (cl\_float4)\) |
|
strong |
Enumerates the memory objects handled by the class.
H_* names refer to staging buffers on the host. D_* names refer to buffers on the device. | cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::ICPStep | ( | clutils::CLEnv & | _env, |
| clutils::CLEnvInfo< 1 > | _infoRBC, | ||
| clutils::CLEnvInfo< 1 > | _infoICP | ||
| ) |
Configures an OpenCL environment as specified by _info.
| [in] | _env | opencl environment. |
| [in] | _infoRBC | opencl configuration for the RBC classes. It specifies the context, queue, etc, to be used. |
| [in] | _infoICP | opencl configuration for the ICP classes. It specifies the context, queue, etc, to be used. |
| void cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::buildRBC | ( | const std::vector< cl::Event > * | events = nullptr, |
| cl::Event * | event = nullptr |
||
| ) |
Builds the RBC data structure.
buildRBC after the D_IN_F buffer has been written, and before any calls to run (for each registration). | cl::Memory & cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::get | ( | ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::Memory | mem | ) |
Returns a reference to an internal memory object.
This interface exists to allow CL memory sharing between different kernels.
| [in] | mem | enumeration value specifying the requested memory object. |
| float cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::getAlpha | ( | ) |
Gets the scaling parameter \( \alpha \) involved in the distance calculations of the RBC data structure.
| float cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::getScaling | ( | ) |
Gets the scaling factor c used when computing the S matrix.
| void cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::init | ( | unsigned int | _m, |
| unsigned int | _nr, | ||
| float | _a = 1e2f, |
||
| float | _c = 1e-6f, |
||
| Staging | _staging = Staging::IO |
||
| ) |
Configures kernel execution parameters.
Sets up memory objects as necessary, and defines the kernel workspaces.
init, then that memory will be maintained. Otherwise, a new memory object will be created.| [in] | _m | number of points in the sets. |
| [in] | _nr | number of fixed set representatives. |
| [in] | _a | factor scaling the results of the distance calculations for the geometric \( x_g \) and photometric \( x_p \) dimensions of the \( x\epsilon\mathbb{R}^8 \) points. That is, \( \|x-x'\|_2^2= f_g(a)\|x_g-x'_g\|_2^2+f_p(a)\|x_p-x'_p\|_2^2 \). For more info, look at euclideanSquaredMetric8 in kernels/rbc_kernels.cl. |
| [in] | _c | scaling factor for dealing with floating point arithmetic issues when computing the S matrix. |
| [in] | _staging | flag to indicate whether or not to instantiate the staging buffers. |
| void * cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::read | ( | ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::Memory | mem = ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::Memory::H_IO_T, |
| bool | block = CL_TRUE, |
||
| const std::vector< cl::Event > * | events = nullptr, |
||
| cl::Event * | event = nullptr |
||
| ) |
Performs a data transfer to a staging buffer.
The transfer happens from a device buffer to the associated (specified) staging buffer on the host.
| [in] | mem | enumeration value specifying an output staging buffer. |
| [in] | block | a flag to indicate whether to perform a blocking or a non-blocking operation. |
| [in] | events | a wait-list of events. |
| [out] | event | event associated with the read operation to the staging buffer. |
| void cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::run | ( | const std::vector< cl::Event > * | events = nullptr, |
| cl::Event * | event = nullptr, |
||
| bool | config = false |
||
| ) |
Executes the necessary kernels.
The function call is non-blocking.
| [in] | events | a wait-list of events. |
| [out] | event | event associated with the kernel execution. |
| [in] | config | flag. If true, configures the RBC search process. Set to true once, when the RBC data structure is reset. |
|
inline |
Executes the necessary kernels.
This run instance is used for profiling.
| [in] | timer | GPUTimer that does the profiling of the kernel executions. |
| [in] | events | a wait-list of events. |
| [in] | config | flag. If true, configures the RBC search process. Set to true once, when the RBC data structure is reset. |
| void cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::setAlpha | ( | float | _a | ) |
Sets the scaling parameter \( \alpha \) involved in the distance calculations of the RBC data structure.
Updates the kernel arguments for the scaling parameter \( \alpha \).
| [in] | _a | scaling parameter \( \alpha \). |
| void cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::setScaling | ( | float | _c | ) |
Sets the scaling factor c used when computing the S matrix.
Updates the kernel argument for the scaling factor c.
| [in] | _c | scaling factor. |
| void cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::write | ( | ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::Memory | mem = ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::Memory::D_IN_F, |
| void * | ptr = nullptr, |
||
| bool | block = CL_FALSE, |
||
| const std::vector< cl::Event > * | events = nullptr, |
||
| cl::Event * | event = nullptr |
||
| ) |
Performs a data transfer to a device buffer.
The transfer happens from a staging buffer on the host to the associated (specified) device buffer.
| [in] | mem | enumeration value specifying an input device buffer. |
| [in] | ptr | a pointer to an array holding input data. If not NULL, the data from ptr will be copied to the associated staging buffer. |
| [in] | block | a flag to indicate whether to perform a blocking or a non-blocking operation. |
| [in] | events | a wait-list of events. |
| [out] | event | event associated with the write operation to the device buffer. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| cl_float* cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::hPtrInF |
Mapping of the input staging buffer for the fixed set of points.
| cl_float* cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::hPtrInM |
Mapping of the input staging buffer for the moving set of points.
| cl_float* cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::hPtrIOT |
Mapping of the input-output staging buffer for the estimated quaternion and translation vector.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| Eigen::Quaternionf cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::q |
Represents the rotation estimation up to iteration k, given in quaternion representation, \( \dot{q} = \left[ \begin{matrix} q_x & q_y & q_z & q_w \end{matrix} \right]^T \).
| Eigen::Quaternionf cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::qk |
Represents the incremental development in the rotation estimation in iteration k, given in quaternion representation, \( \dot{q}_k = \left[ \begin{matrix} q_x & q_y & q_z & q_w \end{matrix} \right]^T \).
|
protected |
| Eigen::Matrix3f cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::R |
Represents the rotation estimation up to iteration k, given in rotation matrix representation, \( R \).
|
protected |
|
protected |
| Eigen::Matrix3f cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::Rk |
Represents the incremental development in the rotation estimation in iteration k, given in rotation matrix representation, \( R_k \).
Represents the scale estimation up to iteration k, given as a scalar, \( s \).
| cl_float cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::sk |
Represents the incremental development in the scale estimation in iteration k, given as a scalar, \( s_k \).
|
protected |
| Eigen::Vector3f cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::t |
Represents the translation estimation up to iteration k, given as a vector in 3-D, \( t \).
| Eigen::Vector3f cl_algo::ICP::ICPStep< ICPStepConfigT::POWER_METHOD, ICPStepConfigW::WEIGHTED >::tk |
Represents the incremental development in the translation estimation in iteration k, given as a vector in 3-D, \( t_k \).
|
protected |
|
protected |
|
protected |
1.8.9.1