Giter Club home page Giter Club logo

kinectfusionapplib_comments's Introduction

KinectFusionLib and KinectFusionApp

这个是自己在源仓库的基础上,加上了自己注释的版本。

源仓库:

程序由两个部分组成,lib部分和app部分。

注意编译通过的时候需要使用在cuda支持下的Eigen和OpenCV库,CUDA编译的时候使用的是8.0的版本。

其实里面还有一些小问题我也没有搞明白,欢迎有想法的大佬们疯狂提issue讨论~~

另 KinectFusionLib 中将最后的模型输出成为点云文件的功能部分我现在也没有进行注释(和 KinectFusion 本身的功能关系不是很大)(好吧,我懒 = =)

KinectFusion 中的 Point-to-plane ICP 的并行化有一些数学推导,导致KinectFusionLib中代码实现看起来比较“*”,希望 /doc/【附件】刘国庆-KinectFusion中Plane-to-point_ICP的计算推导.pdf 这篇文档能够有所帮助。

另外关于此 KinectFusionLib 的实现我在泡泡机器人的沈阳线下会议做了一个PPT:/doc/【PPT】刘国庆-KinectFusionLib代码精析-Preview-V5.pdf, 希望对感兴趣的同学有所帮助。

下面是原版的 ReadMe.md.


KinectFusionApp

This is a sample application using the KinectFusionLib. It implements cameras (for data acquisition from recordings as well as from a live depth sensor) as data sources. The resulting fused volume can then be exported into a pointcloud or a dense surface mesh.

Dependencies

  • GCC 5 as higher versions don't work with current nvcc (as of 2017).
  • CUDA 8.0 or higher. In order to provide real-time reconstruction, this library relies on graphics hardware. Running it exclusively on CPU is not possible.
  • OpenCV 3.0 or higher. This library heavily depends on the GPU features of OpenCV that have been refactored in the 3.0 release. Therefore, OpenCV 2 is not supported.
  • Eigen3 for efficient matrix and vector operations.
  • OpenNI2 for data acquisition with a live depth sensor.

Prerequisites

  • Adjust CUDA architecture: Set the CUDA architecture version to that of your graphics hardware
SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 -gencode arch=compute_52,code=sm_52)

Tested with a nVidia GeForce 970, compute capability 5.2, maxwell architecture

  • Set custom opencv path (if built from source):
SET("OpenCV_DIR" "/opt/opencv/usr/local/share/OpenCV")

Usage

Setup the data sources in main.cpp. Then, start the application.

Use the following keys to perform actions:

  • 'p': Export all camera poses known so far
  • 'm': Export a dense surface mesh
  • ' ': Export nothing, just end the application
  • 'a': Save all available data

License

This library is licensed under MIT.

kinectfusionapplib_comments's People

Contributors

dreamwaterfound avatar frankgoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kinectfusionapplib_comments's Issues

配置文件问题

图片
terminate called after throwing an instance of 'std::invalid_argument'
what(): You have to specify a path to the configuration file
*** Failure: /home/xkyl/kinectfusion/jczeng1212-KinectFusionAppLib_comments-master/KinectFusionAppLib_comments/bin/KinectFusionApp has crashed ***
图片

这个错误我不太知道是什么意思?我该怎么修改呢?

TSDF 计算疑问

你好,最近在拜读KinectFusionLib的代码,根据你的注释和解说视频,明白了很多,但是有一个地方不是很理解,就是TSDF的计算,按照公式来算,是 ( a||tgk - p|| - Rk(X) ) ,这个结果,如果体素位于物体表面之前,那么 a||tgk - P|| 得到的深度应该是比实际观察点的深度 Rk(X) 小的,那么这个tsdf值应该是个负数,但是我看别的资料和博客,对于tsdf的描述都是:“位于表面之前为正” ;这一步不是很理解,望解答。谢谢

设备使用问题?

您好。我想用kinectv2来跑这个程序可以吗?该如何配置呢?我环境已经配置好了。而且也把库中的代码build好了。没有错误。但不知道怎么设置才能使用自己的设备。麻烦帮我看看。
这是显示的错误

terminate called after throwing an instance of 'std::invalid_argument'
what(): You have to specify a path to the configuration file
*** Failure: /home/xkyl/kinectfusion/jczeng1212-KinectFusionAppLib_comments-master/KinectFusionAppLib_comments/bin/KinectFusionApp has crashed ***

PPT 101 页。 Ax-b=0 ---> A^TAx=A^Tb 错误

这里是不对的。最小二乘min||Ax-b|| 不是直接Ax-b=0。因为Ax-b有可能永远不等于0。 而是要在A的解空间找到最合适的x使得 min||Ax-b||。可以用矩阵求导的方式来得到 A^TAx=A^Tb。更直观的方式是
for any a_{i} (a_{i})^{T}(Ax-b)=0
-->A^TAx=A^Tb
a_{i}是A的列向量

如何在windows上运行

如何在win10中编译运行,使用camke编译出了项目,但是无法运行,请问能否给出win10 运行的教程?

环境配置

请问您是怎么配置的环境?
我在调用cv::cuda::getCudaEnabledDeviceCount()后得到0。
难道是GPU不行?目前只有MX150。。。

编译opencv的配置是,
cmake
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=/usr/local/opencv-3.4.6
-DOPENCV_EXTRA_MODULES_PATH=../modules/opencv_contrib-3.4.6/modules/
-DBUILD_PNG=OFF
-DBUILD_TIFF=OFF
-DBUILD_TBB=OFF
-DBUILD_JPEG=OFF
-DBUILD_JASPER=OFF
-DBUILD_ZLIB=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_JAVA=OFF
-DBUILD_opencv_python2=OFF
-DBUILD_opencv_python3=ON
-DWITH_OPENCL=OFF
-DWITH_OPENMP=OFF
-DWITH_FFMPEG=ON
-DWITH_GSTREAMER=OFF
-DWITH_GSTREAMER_0_10=OFF
-DWITH_CUDA=ON
-DWITH_GTK=ON
-DWITH_VTK=OFF
-DWITH_TBB=ON
-DWITH_1394=OFF
-DWITH_OPENEXR=OFF
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0
-DCUDA_ARCH_BIN='3.0 3.5 5.0 6.0 6.2'
-DCUDA_ARCH_PTX=""
-DINSTALL_C_EXAMPLES=OFF
-DINSTALL_TESTS=OFF ..

开发环境

难道 泡泡机器人就没人用容器??????????????????

tsdf计算问题

  const Vec3fda xylambda(
          (uv.x() - cam_params.principal_x) / cam_params.focal_x,             // (x/z)
          (uv.y() - cam_params.principal_y) / cam_params.focal_y,             // (y/z)
          1.f);
  // 计算得到公式7中的 lambda
  const float lambda = xylambda.norm();

  // step 2.3 计算 SDF, 参考论文公式6中括号的部分
  // 这里的 camera_pos 已经是该体素中心点在当前世界坐标系下的坐标了, 论文中的公式的意思是计算相机光心到该点的距离, 就相当于这个坐标直接取欧式二范数
  // 前面乘的负号是因为, 咱们定义 SDF 表示中平面前的部分为正, 平面后的部分为负
  // SDF 其实也就是表示了空间体素点的(预测值 - 观测值)
  const float sdf = (-1.f) * ((1.f / lambda) * camera_pos.norm() - depth);

关于上面这块代码,有一些疑问需要咨询大神。
1.xylambda到底代表了什么。为什么xylambda存储了 x/z 和 y/z (相机坐标系)。x/z和y/z表示的具体含义是什么,我一直没有搞明白。
2.sdf的计算方式。 代码中计算sdf的方式如上面所示((1.f / lambda) * camera_pos.norm() - depth)。然后我看其他kinectfusion实现的时候,我发现有的计算方式是直接让 相机坐标系下体素块的z值去和 深度图的z值相减。 实现方式有区别,这2种实现方式有什么不一样呢?

Frame could not be processed

您好,
我在尝试使用realsense运行的时候,从第二帧开始就一直输出 Frame could not be processed, icp 一直失败。不知道您有没有遇到过这个问题?第一帧的重建好像就没有成功,imshow("Pipeline Output", pipeline.get_last_model_frame());输出的图像是全黑的,导出mesh是空的。我尝试了使用tum数据集作为输入,现象也是相同的。

这是我使用realsense时控制台的输出,希望得到您的帮助,谢谢!

Found 1 CUDA devices
Device #0: GeForce RTX 2070 SUPER with 7979MB total memory
Using device #0
Using this RealSense device:
  Name                 : Intel RealSense D435
  Serial Number        : 746612070469
  Firmware Version     : 05.11.06.250
  Recommended Firmware Version : 05.12.06.00
  Physical Port        : /sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:05:00.1/usb2/2-3/2-3:1.0/video4linux/video0
  Debug Op Code        : 15
  Advanced Mode        : YES
  Product Id           : 0B07
  Camera Locked        : YES
  Usb Type Descriptor  : 3.2
  Product Line         : D400
  Asic Serial Number   : 805513020863
  Firmware Update Id   : 805513020863
  Ip Address           : Not supported
Frame could not be processed
Frame could not be processed
Frame could not be processed
Frame could not be processed
Frame could not be processed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.