Skip to content

Commit

Permalink
dense: expose --cuda-device option (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy authored Oct 26, 2021
1 parent 334bba4 commit add19bc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/DensifyPointCloud/DensifyPointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ bool Initialize(size_t argc, LPCTSTR* argv)

// group of options allowed both on command line and in config file
unsigned nResolutionLevel;
#ifdef _USE_CUDA
unsigned nCUDADevice;
#endif
unsigned nMaxResolution;
unsigned nMinResolution;
unsigned nNumViews;
Expand All @@ -103,6 +106,9 @@ bool Initialize(size_t argc, LPCTSTR* argv)
("input-file,i", boost::program_options::value<std::string>(&OPT::strInputFileName), "input filename containing camera poses and image list")
("output-file,o", boost::program_options::value<std::string>(&OPT::strOutputFileName), "output filename for storing the dense point-cloud")
("resolution-level", boost::program_options::value(&nResolutionLevel)->default_value(1), "how many times to scale down the images before point cloud computation")
#ifdef _USE_CUDA
("cuda-device", boost::program_options::value(&nCUDADevice)->default_value(0), "CUDA device number to be used for depth-map estimation (-1 - CPU processing)")
#endif
("max-resolution", boost::program_options::value(&nMaxResolution)->default_value(3200), "do not scale images higher than this resolution")
("min-resolution", boost::program_options::value(&nMinResolution)->default_value(640), "do not scale images lower than this resolution")
("number-views", boost::program_options::value(&nNumViews)->default_value(5), "number of views used for depth-map estimation (0 - all neighbor views available)")
Expand Down Expand Up @@ -181,6 +187,9 @@ bool Initialize(size_t argc, LPCTSTR* argv)
const bool bValidConfig(OPTDENSE::oConfig.Load(OPT::strDenseConfigFileName));
OPTDENSE::update();
OPTDENSE::nResolutionLevel = nResolutionLevel;
#ifdef _USE_CUDA
OPTDENSE::nCUDADevice = nCUDADevice;
#endif
OPTDENSE::nMaxResolution = nMaxResolution;
OPTDENSE::nMinResolution = nMinResolution;
OPTDENSE::nNumViews = nNumViews;
Expand Down

0 comments on commit add19bc

Please sign in to comment.