10 , cyclical_(params), checkForShift_(true)
81 for(
int i = 0; i < LEVELS; ++i)
104 cout <<
"Reset" << endl;
109 poses_.push_back(initialPose);
119 if (time > (
int)
poses_.size () || time < 0)
120 time = (
int)
poses_.size () - 1;
127 const int LEVELS =
icp_->getUsedLevelsNum();
135 for (
int i = 1; i < LEVELS; ++i)
138 for (
int i = 0; i < LEVELS; ++i)
139 #
if defined USE_DEPTH
151 #if defined USE_DEPTH 165 #if defined USE_DEPTH 171 return reset(),
false;
183 local_pose.rotate(
poses_.back().rotation());
185 float rnorm = (float)
cv::norm(affine.rvec());
186 float tnorm = (float)
cv::norm(affine.translation());
198 #if defined USE_DEPTH 200 for (
int i = 1; i < LEVELS; ++i)
205 for (
int i = 1; i < LEVELS; ++i)
219 #if defined USE_DEPTH 220 #define PASS1 prev_.depth_pyr 222 #define PASS1 prev_.points_pyr 225 if (flag < 1 || flag > 3)
249 #if defined USE_DEPTH 250 #define PASS1 depths_ 252 #define PASS1 points_ 257 if (flag < 1 || flag > 3)
275 int rows = size.height;
276 int cols = size.width;
277 image.
create(rows, flag != 3 ? cols : cols * 2);
282 #if defined USE_DEPTH 283 #define PASS1 depths_ 285 #define PASS1 points_ 290 if (flag < 1 || flag > 3)
KF_EXPORTS void depthBuildPyramid(const Depth &depth, Depth &pyramid, float sigma_depth)
size_t step() const
Returns stride between two consecutive rows in bytes for internal buffer. Step is stored always and e...
cuda::CyclicalBuffer cyclical_
Cyclical buffer object.
float icp_truncate_depth_dist
const cuda::CyclicalBuffer & cyclical() const
std::vector< Depth > depth_pyr
KinFu(const KinFuParams ¶ms)
tsdf_buffer & getBuffer()
get a pointer to the tsdf_buffer structure.
T * ptr(int y=0)
Returns pointer to given row in internal buffer.
KF_EXPORTS void computeDists(const Depth &depth, Dists &dists, const Intr &intr)
KF_EXPORTS void computePointNormals(const Intr &intr, const Depth &depth, Cloud &points, Normals &normals)
std::vector< Affine3f > poses_
KF_EXPORTS void depthTruncation(Depth &depth, float threshold)
void integrate(const Dists &depth, TsdfVolume &volume, tsdf_buffer &buffer, const Aff3f &aff, const Projector &proj)
CyclicalBuffer implements a cyclical TSDF buffer. The class offers a simple interface, by handling shifts and maintaining the world autonomously.
float bilateral_sigma_depth
cv::Ptr< cuda::ProjectiveICP > icp_
Affine3f getCameraPose(int time=-1) const
void reset(Affine3f initialPose=Affine3f::Identity())
double distance_camera_target
bool checkForShift(cv::Ptr< cuda::TsdfVolume > volume, const Affine3f &cam_pose, const double distance_camera_target, const bool perform_shift=true, const bool last_shift=false, const bool record_mode=false)
Check if shifting needs to be performed, returns true if so. Shifting is considered needed if the tar...
KF_EXPORTS void resizePointsNormals(const Cloud &points, const Normals &normals, Cloud &points_out, Normals &normals_out)
std::vector< Cloud > points_pyr
KF_EXPORTS void resizeDepthNormals(const Depth &depth, const Normals &normals, Depth &depth_out, Normals &normals_out)
float tsdf_min_camera_movement
float raycast_step_factor
cv::Ptr< cuda::TsdfVolume > volume_
int bilateral_kernel_size
bool operator()(const cuda::Depth &dpeth, const cuda::Image &image=cuda::Image())
const cuda::TsdfVolume & tsdf() const
void initBuffer(cv::Ptr< cuda::TsdfVolume > tsdf_volume)
Initializes memory pointers of the cyclical buffer (start, end, current origin)
std::vector< Normals > normals_pyr
KF_EXPORTS void depthBilateralFilter(const Depth &in, Depth &out, int ksz, float sigma_spatial, float sigma_depth)
KF_EXPORTS void waitAllDefaultStream()
float gradient_delta_factor
KF_EXPORTS void renderTangentColors(const Normals &normals, Image &image)
float bilateral_sigma_spatial
__kf_device__ float norm(const float3 &v)
KF_EXPORTS void computeNormalsAndMaskDepth(const Intr &intr, Depth &depth, Normals &normals)
void resetBuffer(cv::Ptr< cuda::TsdfVolume > tsdf_volume)
Reset buffer structure.
void create(int rows, int cols)
Allocates internal buffer in GPU memory. If internal buffer was created before the function recreates...
KF_EXPORTS void renderImage(const Depth &depth, const Normals &normals, const Intr &intr, const Vec3f &light_pose, Image &image)
std::vector< int > icp_iter_num
void renderImage(cuda::Image &image, int flags=0)
const KinFuParams & params() const
const cuda::ProjectiveICP & icp() const