-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSoC 2017: dynamicfusion #1349
base: 4.x
Are you sure you want to change the base?
GSoC 2017: dynamicfusion #1349
Conversation
This is this GSoC project's mentor. @mshabunin Please advise the next steps moving forward. There will be dependencies to be installed for this to run. Any instructions we should follow to pass the checks, additional cleanups/refactors needed for us to merge in? Thanks in advance! |
@zzhang001 , as I can see, most of dependencies can be provided by OpenCV, for example OpenNI and CUDA. Module should be reconstructed to be supported by our build scripts, please take a look at some other modules in opencv_contrib.
|
@mshabunin What about dependencies like Ceres and Boost? |
Looks like it is possible to avoid using Boost in this case, as for Ceres - we have the sfm module which optionally uses this library, so you can take check corresponding cmake script. For this moment you should integrate it by yourself, but in future we can move Ceres detection to main repository. |
modules/dynamicfusion/CMakeLists.txt
Outdated
find_package(OpenCV REQUIRED COMPONENTS core viz highgui calib3d) | ||
#include(cmake/Targets.cmake) | ||
# | ||
## ---[ find dependencies | ||
find_package(CUDA REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not use REQUIRED
option, instead just check whether the dependency has been found and disable your module if it can not be built without it:
find_package(Ceres QUIET)
if (NOT Ceres_FOUND)
message(STATUS "${module} has been disabled because Ceres library has not been found")
ocv_module_disable(${module})
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to use existing HAVE_CUDA
variable, check the documentation at the beginning of https://github.com/opencv/opencv/blob/master/cmake/FindCUDA.cmake
modules/dynamicfusion/CMakeLists.txt
Outdated
# add_subdirectory(tests) | ||
# endif() | ||
#endif() | ||
find_package(Boost REQUIRED COMPONENTS system filesystem program_options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the Boost is not needed anymore.
modules/dynamicfusion/CMakeLists.txt
Outdated
# endif() | ||
#endif() | ||
find_package(Boost REQUIRED COMPONENTS system filesystem program_options) | ||
ocv_define_module(dynamicfusion opencv_core opencv_calib3d opencv_viz opencv_highgui) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any #include "opencv2/calib3d.hpp"
in your code, it means that you don't need the dependency on opencv_calib3d
module. Same for opencv_highgui
.
Note that all samples will receive dependency on imgcodecs
, videoio
and highgui
automatically, so you don't need to add them to your module.
modules/dynamicfusion/src/kinfu.cpp
Outdated
#include <kfusion/cuda/tsdf_volume.hpp> | ||
#include <opencv2/core/core.hpp> | ||
#include <opencv2/highgui/highgui.hpp> | ||
#include <opencv2/utils/dual_quaternion.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be #include <opencv2/kfusion/utils/dual_quaternion.hpp>
You should create single include folder: include/opencv2/dynamicfusion
and put all sub folders into it:
include/opencv2/
dynamicfusion.hpp
dynamicfusion/
utils/
...
kfusion/
...
Then: #include "opencv2/dynamicfusion/utils/dual_quaternion.hpp"
modules/dynamicfusion/CMakeLists.txt
Outdated
|
||
add_subdirectory(kfusion) | ||
add_subdirectory(apps) | ||
include_directories(${CERES_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${CUDA_INCLUDE_DIRS} ${OPENNI_INCLUDE_DIR} "kfusion/src/utils" "kfusion/include/nanoflann") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use existing flann
module instead of nanoflann
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into porting from nanoflann to flann at some point later
{ | ||
namespace kfusion | ||
{ | ||
class KF_EXPORTS OpenNISource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this class is not used anymore, did you try to use VideoCapture
with OPENNI backend?
VideoCapture cap(CAP_OPENNI2);
It has different properties which can be accessed via VideoCapture::get
and ::set
methods: link to documentation
More directory restructuring, getting CUDA through opencv rather than…
@mihaibujanca After fixing different compilation errors I failed to run your code. |
@savuor it's changed quite a bit since the PR, but please check out https://github.com/mihaibujanca/dynamicfusion Apologies for not having fixed it yet |
@mihaibujanca The code from your repo doesn't work on your test data. |
Will be working on it, though not completely sure why the first frame would be empty - can have you downloaded the data and passed the directory as an argument? |
@mihaibujanca |
@savuor Thanks a lot for your work. I'm currently in the exam session so I don't expect to be able to do this for a while. |
@mihaibujanca No problem, you can attend later when you have a time |
@mihaibujanca FYI #1798 |
GSoC Project: Implementing and extending DynamicFusion (Newcombe et al 2015)
Mentors: Zhe Zhang, Reza Amayeh
For now just added the code from my repository, with CMakeLists.txt building the project as stand-alone. I will be working towards changing that to be an opencv_contrib module.