From 480aa54eb2f7f7a11443d87c6f8903593d072eac Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 25 Oct 2021 15:30:08 +0000 Subject: [PATCH 1/2] Expose --cuda-device option in DensifyPointCloud --- apps/DensifyPointCloud/DensifyPointCloud.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/DensifyPointCloud/DensifyPointCloud.cpp b/apps/DensifyPointCloud/DensifyPointCloud.cpp index 458f63e5b..159f250c4 100644 --- a/apps/DensifyPointCloud/DensifyPointCloud.cpp +++ b/apps/DensifyPointCloud/DensifyPointCloud.cpp @@ -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; @@ -103,6 +106,9 @@ bool Initialize(size_t argc, LPCTSTR* argv) ("input-file,i", boost::program_options::value(&OPT::strInputFileName), "input filename containing camera poses and image list") ("output-file,o", boost::program_options::value(&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)") @@ -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; From fa0c0f3ec364468b78456d65e864fc5b15250c7d Mon Sep 17 00:00:00 2001 From: cDc Date: Tue, 26 Oct 2021 11:22:47 +0300 Subject: [PATCH 2/2] Update DensifyPointCloud.cpp --- apps/DensifyPointCloud/DensifyPointCloud.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/DensifyPointCloud/DensifyPointCloud.cpp b/apps/DensifyPointCloud/DensifyPointCloud.cpp index 159f250c4..dc4d9cf63 100644 --- a/apps/DensifyPointCloud/DensifyPointCloud.cpp +++ b/apps/DensifyPointCloud/DensifyPointCloud.cpp @@ -91,9 +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 + #ifdef _USE_CUDA unsigned nCUDADevice; -#endif + #endif unsigned nMaxResolution; unsigned nMinResolution; unsigned nNumViews; @@ -106,9 +106,9 @@ bool Initialize(size_t argc, LPCTSTR* argv) ("input-file,i", boost::program_options::value(&OPT::strInputFileName), "input filename containing camera poses and image list") ("output-file,o", boost::program_options::value(&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 + #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 + #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)") @@ -187,9 +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 + #ifdef _USE_CUDA OPTDENSE::nCUDADevice = nCUDADevice; -#endif + #endif OPTDENSE::nMaxResolution = nMaxResolution; OPTDENSE::nMinResolution = nMinResolution; OPTDENSE::nNumViews = nNumViews;