42 #include <pcl/gpu/containers/device_array.h>
43 #include <pcl/gpu/kinfu/pixel_rgb.h>
44 #include <pcl/gpu/kinfu/tsdf_volume.h>
45 #include <pcl/gpu/kinfu/color_volume.h>
46 #include <pcl/gpu/kinfu/raycaster.h>
48 #include <pcl/point_cloud.h>
53 #define KINFU_DEFAULT_RGB_FOCAL_X 525.f
54 #define KINFU_DEFAULT_RGB_FOCAL_Y 525.f
57 #define KINFU_DEFAULT_DEPTH_FOCAL_X 585.f
58 #define KINFU_DEFAULT_DEPTH_FOCAL_Y 585.f
150 bool operator() (
const DepthMap& depth, Eigen::Affine3f* hint=
nullptr);
214 using Matrix3frm = Eigen::Matrix<float, 3, 3, Eigen::RowMajor>;
215 using Vector3f = Eigen::Vector3f;
225 float max_icp_distance_;
228 float fx_, fy_, cx_, cy_;
235 Matrix3frm init_Rcam_;
241 int icp_iterations_[LEVELS];
248 std::vector<DepthMap> depths_curr_;
250 std::vector<MapArr> vmaps_g_curr_;
252 std::vector<MapArr> nmaps_g_curr_;
255 std::vector<MapArr> vmaps_g_prev_;
257 std::vector<MapArr> nmaps_g_prev_;
260 std::vector<MapArr> vmaps_curr_;
262 std::vector<MapArr> nmaps_curr_;
265 std::vector<CorespMap> coresps_;
276 std::vector<Matrix3frm> rmats_;
279 std::vector<Vector3f> tvecs_;
282 float integration_metric_threshold_;
292 allocateBufffers (
int rows_arg,
int cols_arg);
shared_ptr< ColorVolume > Ptr
KinfuTracker class encapsulates implementation of Microsoft Kinect Fusion algorithm.
int cols()
Returns cols passed to ctor.
void getLastFrameCloud(DeviceArray2D< PointType > &cloud) const
Returns point cloud abserved from last camera pose.
ColorVolume & colorVolume()
Returns color volume storage.
KinfuTracker(int rows=480, int cols=640)
Constructor.
void getImage(View &view) const
Renders 3D scene to display to human.
void setInitalCameraPose(const Eigen::Affine3f &pose)
Sets initial camera pose relative to volume coordinate space.
void initColorIntegration(int max_weight=-1)
Performs initialization for color integration.
void setIcpCorespFilteringParams(float distThreshold, float sineOfAngle)
Sets ICP filtering parameters.
void disableIcp()
Disables ICP forever.
std::size_t getNumberOfPoses() const
Returns number of poses including initial.
const TsdfVolume & volume() const
Returns TSDF volume storage.
TsdfVolume & volume()
Returns TSDF volume storage.
void getDepthIntrinsics(float &fx, float &fy, float &cx, float &cy) const
Get Depth camera intrinsics.
void getLastFrameNormals(DeviceArray2D< NormalType > &normals) const
Returns point cloud abserved from last camera pose.
void setCameraMovementThreshold(float threshold=0.001f)
Sets integration threshold.
void setDepthIntrinsics(float fx, float fy, float cx=-1, float cy=-1)
Sets Depth camera intrinsics.
Eigen::Affine3f getCameraPose(int time=-1) const
Returns camera pose at given time, default the last pose.
int rows()
Returns rows passed to ctor.
void setDepthTruncationForICP(float max_icp_distance=0.f)
Sets truncation threshold for depth image for ICP step only! This helps to filter measurements that a...
const ColorVolume & colorVolume() const
Returns color volume storage.
shared_ptr< TsdfVolume > Ptr
Defines all the PCL implemented PointT point type structures.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Defines functions, macros and traits for allocating and using memory.
Defines all the PCL and non-PCL macros used.
A point structure representing normal coordinates and the surface curvature estimate.
A point structure representing Euclidean xyz coordinates.
Input/output pixel format for KinfuTracker.