Skip to content
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

v2.3.0 #1090

Merged
merged 229 commits into from
Jan 7, 2024
Merged

v2.3.0 #1090

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
c618f43
dense: add image mask support
cdcseacave Jul 6, 2020
2099545
dense: fix bug in mask application
cdcseacave Jul 7, 2020
39aeea0
build: update find packages
cdcseacave Jul 8, 2020
8d1b2f4
build: fix usage as third-party library
cdcseacave Jul 9, 2020
486bfad
interface: export and compare camera poses with an OpenMVG refined ve…
cdcseacave Sep 7, 2020
4e1e2d5
interface: export MVS scene to NVM format
cdcseacave Sep 15, 2020
0af0213
common: fix camera scaling
cdcseacave Oct 13, 2020
ac89ffd
dense: small code refactor
cdcseacave Nov 19, 2020
5d26c25
mvs: view DMAPs with different resolution
cdcseacave Dec 21, 2020
ede33fb
interface: replace define with constexp
cdcseacave Dec 22, 2020
c75a600
interface: small change
cdcseacave Jan 5, 2021
b586605
common: fix PFM exporter/importer
cdcseacave Jan 18, 2021
30d7ec9
common: disable CPUID on ARM platforms
cdcseacave Feb 1, 2021
0a49d56
dense: add Region-Of-Interest (ROI) support
cdcseacave Feb 13, 2021
4629ad2
common: improve octree speed
cdcseacave Feb 14, 2021
7b55ad1
build: update AppVeyor
cdcseacave Feb 15, 2021
37f4b1e
mesh: split mesh in sub-meshed by max area
cdcseacave Feb 20, 2021
7a88fef
dense: split scene in sub-scenes
cdcseacave Feb 21, 2021
00b5979
cmake: build libCommon/IO/Math as shared if BUILD_SHARED_LIBS=ON (#650)
LWisteria Feb 23, 2021
c4b2f59
mesh: fix bug in RemoveFaces()
cdcseacave Mar 4, 2021
3581e7a
dense: filter more redundant views from sub-scenes
cdcseacave Mar 6, 2021
3be30ef
common: add ZSTD serialization support
cdcseacave Mar 6, 2021
979d6db
apps: set internal linkage for functions and variables (#656)
LWisteria Mar 6, 2021
55a2ab1
common: small refactor
cdcseacave Mar 6, 2021
43ca8f2
mesh: raster triangles using barycentric coordinates
cdcseacave Mar 7, 2021
574d64f
remove cotire
cdcseacave Mar 13, 2021
1391d61
dense: merge small sub-scenes
cdcseacave Mar 21, 2021
29a15f5
interface: import COLMAP depth-maps
cdcseacave Mar 25, 2021
b657534
interface: add MVS preset to the python script
cdcseacave Mar 31, 2021
ecea2dd
interface: fix COLMAP on linux
cdcseacave Mar 31, 2021
464493c
common: make binary projects portable
cdcseacave Apr 1, 2021
8e96a40
viewer: display views seeing selected point or points seen by the cur…
cdcseacave Apr 5, 2021
b005959
dense: improve depth-map initialization
cdcseacave Apr 7, 2021
dd69b9f
dense: merge depth-maps (no fusion)
cdcseacave Apr 12, 2021
17360bf
interface: add similarity transform functionality
cdcseacave Apr 16, 2021
4325703
common: fix file permissions on linux
cdcseacave Apr 16, 2021
0f2a5a0
mesh: add GLTF writing support
cdcseacave Apr 17, 2021
ecd5890
mesh: add target-face-num parameter to ReconstructMesh (#671)
pierotofy Apr 29, 2021
663eed1
mesh: improve GLTF support
cdcseacave May 12, 2021
e26cd50
Merge branch 'no_cotire' into develop
cdcseacave May 31, 2021
d6e21bf
dense: add geometric-consistency
cdcseacave Jun 6, 2021
1a626b6
dense: fix for invalid images
cdcseacave Jun 14, 2021
7cb9b40
dense: close file in reading invalid depth-map (#685)
bojanin Jul 16, 2021
71bb22e
dense: export point-cloud with min number of views per point
cdcseacave Aug 26, 2021
3a0af3f
dense: detect computed depth-maps
cdcseacave Aug 27, 2021
c6daaf7
refine: initialize image neighbors from input mesh
cdcseacave Aug 27, 2021
e6ecc5a
dense: select better angle neighbors
cdcseacave Aug 27, 2021
ae8062b
dense: patch-match implemented in CUDA (faster & better)
cdcseacave Oct 17, 2021
334bba4
common: fix latest boost
cdcseacave Oct 18, 2021
add19bc
dense: expose --cuda-device option (#707)
pierotofy Oct 26, 2021
625bfd5
build: add Dockerfile for CUDA #710
cdcseacave Oct 28, 2021
556bb26
dense: fix bug in selecting views
cdcseacave Oct 28, 2021
67798ba
build: fix CUDA for older cards (#712)
pierotofy Oct 29, 2021
cd73b4c
dense: fix small clusters (#702)
cdcseacave Oct 30, 2021
500e808
interface: fix COLMAP log export
cdcseacave Nov 3, 2021
bbe7db5
interface: add Metashape and predefined neighbors list support
cdcseacave Nov 7, 2021
654afa2
interface: fix compile linux
cdcseacave Nov 12, 2021
09137e1
dense: add support for scenes with empty point-cloud but known (coars…
cdcseacave Nov 12, 2021
0abc993
dense: filter low score estimates
cdcseacave Nov 13, 2021
cb8fafa
interface: add Metashape ROI support
cdcseacave Nov 14, 2021
d842a3b
viewer: display ROI
cdcseacave Nov 15, 2021
4118493
dense: increase NCC threshold for CUDA
cdcseacave Nov 18, 2021
5b16d7b
interface: remap Metashape indices
cdcseacave Nov 25, 2021
17427b8
dense: fix depth-map crash in CUDA
cdcseacave Dec 6, 2021
f3747bf
Merge branch 'master' of github.com:cdcseacave/openMVS into develop
cdcseacave Dec 11, 2021
c103ffa
interface: update MVG-MVS pipeline
cdcseacave Dec 11, 2021
15e1183
increase version to 2.0.0
cdcseacave Dec 11, 2021
d421ecb
Merge branch 'master' into develop
cdcseacave Dec 19, 2021
1ba3b34
mesh: trace image points onto mesh (#727)
MikeCernea Dec 19, 2021
5ddd433
mesh: project image points in input order
cdcseacave Dec 29, 2021
5a30245
common: log disk space
cdcseacave Jan 3, 2022
0fc902b
build: update CI for windows (#738)
MikeCernea Jan 3, 2022
6ba1dea
dense: fix crash in GC on CUDA
cdcseacave Jan 6, 2022
6639f7b
common: fix various typos (#754)
luzpaz Jan 18, 2022
ee95530
common: fix old GCC
cdcseacave Jan 26, 2022
8f9b6be
common: use points inside ROI to estimate neighbor views
cdcseacave Feb 8, 2022
086f0c5
mesh: option to use only ROI points
cdcseacave Feb 9, 2022
461ad36
dense: improve neighbor views selection
cdcseacave Feb 10, 2022
91357c5
viewer: verbose DMAP details
cdcseacave Feb 22, 2022
65b90bd
mesh: add remesh support
cdcseacave Feb 26, 2022
73ee1c8
common: fix typos and add examples to MvgMvsPipeline.py (#624)
kevinsmia1939 Mar 4, 2022
103ac12
dense: fix 2 bugs and reduce depth perturbation in CUDA
cdcseacave Mar 4, 2022
6b850e4
dense: export selected view neighbors
cdcseacave Mar 4, 2022
3bbd042
common: improve MvgMvsPipeline.py to support partial reconstruction s…
cdcseacave Mar 4, 2022
6229894
build: use VCG fork in CI
cdcseacave Mar 9, 2022
5d877f0
dense: fix CUDA resize bug
cdcseacave Mar 9, 2022
7346385
common: disable CUDA calls if not selected
cdcseacave Mar 21, 2022
14a1959
dense: fix split scene and use ROI
cdcseacave Mar 22, 2022
83a0f97
texture: cleaner and faster ViewSelection (#793)
MikeCernea Mar 23, 2022
168bbdc
dense: render and export depth-maps for each view of a given mesh
cdcseacave Mar 25, 2022
d33b9fb
interface: export camera intrinsics and BBox
cdcseacave Apr 7, 2022
209c2a5
viewer: add center scene and set bbox
cdcseacave Apr 8, 2022
804492b
interface: add images scale&save functionality
cdcseacave Apr 8, 2022
fc81c6f
viewer: compute bbox with the selected min-number of views
cdcseacave Apr 8, 2022
7bf5cd8
interface: fix for saving relative paths
cdcseacave Apr 15, 2022
5aed5fa
texture: support a given subset of images for texturing
cdcseacave Apr 16, 2022
0a607d1
build: increase version to 2.0.1
cdcseacave Apr 17, 2022
1fafff5
Merge remote-tracking branch 'origin/master' into develop
cdcseacave Apr 17, 2022
5a70acd
dense: add iters and geometric-iters params
cdcseacave Apr 20, 2022
670d20f
dense: split scene bounds do not exceed the existing ROI
cdcseacave Apr 30, 2022
915e0e0
dense: prefer mesh for neighbor selection
cdcseacave May 7, 2022
7299f46
interface: add support for Metashape's BlocksExchange format
cdcseacave May 7, 2022
0efa26d
common: use CLISTDEF macro
cdcseacave Jun 8, 2022
7e544a5
dense: automatic region-of-interest estimation (#823)
krahets Jun 11, 2022
cb984b4
dense: ROI estimation with robust safety check (#825)
krahets Jun 13, 2022
8c9848f
interface: fix some warnings
cdcseacave Jun 14, 2022
806c037
dense: implement multi-resolution depth-map estimation (#818)
MikeCernea Jun 18, 2022
eed4c7d
dense: implement patch match multi-resolutions on GPU (#819)
MikeCernea Jun 18, 2022
f34a258
dense: optimize the completeness of the estimated ROI (#830)
krahets Jun 19, 2022
a5c3bcb
dense: add point-cloud statistics
cdcseacave Jun 20, 2022
b003f24
dense: option to remove points by number of views
cdcseacave Jun 21, 2022
a22b954
dense: fix incomplete masks and fine-tune depth-map estimation
cdcseacave Jun 24, 2022
8b431a2
dense: init with sparse point cloud only (#837)
MikeCernea Jul 5, 2022
f057ee2
common: correct GetMedian() logic
cdcseacave Jul 6, 2022
49ef890
interface: fix COLMAP working directory (#844)
CanCanZeng Jul 6, 2022
5588140
dense: make estimate ROI optional
cdcseacave Jul 14, 2022
f6634b7
common: add support for PowerPC (#848)
cdcseacave Jul 26, 2022
d99afe9
texture: remove unused variable
cdcseacave Jul 26, 2022
7a6e08d
common: fine-tune ray-triangle intersection function
cdcseacave Jul 29, 2022
2f53998
build: update Dockerfiles
cdcseacave Aug 13, 2022
dcb2bc4
mvs: improve sub-scene
cdcseacave Jul 5, 2022
142b353
mesh: load GLTF
cdcseacave Sep 6, 2022
bc07459
interface: add support for MVSNet format
cdcseacave Sep 16, 2022
8bc89d0
viewer: enable viewing scenes with only cameras
cdcseacave Sep 16, 2022
9a8514b
dense: initialize neighbor views from image pairs baseline if the spa…
cdcseacave Sep 17, 2022
435eabc
interface: make C++17 features optional
cdcseacave Sep 17, 2022
245e2d7
transform: align scene to the given reference scene using camera posi…
cdcseacave Sep 17, 2022
7921361
interface: add 2 helper functions
cdcseacave Sep 20, 2022
7be47b1
dense: apply image masks on GPU (#861)
pierotofy Sep 20, 2022
91dedf5
texture: fix pixel center convention (#862)
adelpit Sep 21, 2022
3aba860
interface: add comments
cdcseacave Sep 23, 2022
471d007
mesh: update faceTexcoords in Mesh::RemoveFaces (#863)
humanbeingZ Sep 23, 2022
e1e78d1
interface: disable MVSNet interface on old GCC
cdcseacave Sep 23, 2022
64e3f35
common: improve MvsScalablePipeline.py to support existing modules an…
Oct 1, 2022
4595ac1
build: handle nvcc compilers that don't support --list-gpu-arch (#886)
pierotofy Oct 18, 2022
f0ef4b5
mesh: fix ObjModel::MaterialLib::Save() when using OpenMP (#891)
humanbeingZ Oct 20, 2022
e0783e4
dense: fix neighbor selection based on a mesh
cdcseacave Nov 3, 2022
291b9f1
dense: ignore invalid input 3D points during initialization
cdcseacave Nov 5, 2022
7cc2b78
dense: boost low-resolution depth propagation for textureless areas (…
itacernea Nov 6, 2022
a977bf5
transform: estimate scene's volume
cdcseacave Nov 12, 2022
6d6a199
texture: small code cleanup
cdcseacave Nov 17, 2022
191d475
transform: robustify volume estimation
cdcseacave Nov 19, 2022
3a738d5
common: fix some warnings
cdcseacave Nov 21, 2022
bcad1ea
common: fix small memory leak in Octree (#896)
cdcseacave Nov 22, 2022
29a8118
common: add continuous integration workflow
cdcseacave Nov 22, 2022
ae14fc5
texture: use virtual faces for charts creation (#807)
MikeCernea Nov 22, 2022
ce8bbdb
common: CI uploads release artifact
cdcseacave Nov 22, 2022
99185ed
common: fix warnings
cdcseacave Nov 24, 2022
79214de
build: add workaround missing zstd library in vcpkg boost
cdcseacave Nov 24, 2022
99caa9c
build: disable Appveyor CI
cdcseacave Nov 24, 2022
c1fdb29
build: add tests
cdcseacave Nov 25, 2022
ccce4b5
build: add pipeline test
cdcseacave Nov 26, 2022
1598696
dense: add postprocess-dmaps and remove-dmaps params
cdcseacave Nov 26, 2022
58ba572
common: update octree code to use union
cdcseacave Nov 26, 2022
f08b44c
transform: add texture transfer between two meshes
cdcseacave Nov 27, 2022
517e8da
texture: add texture sharpening
cdcseacave Nov 27, 2022
7103c6b
Merge branch 'master' into develop
cdcseacave Nov 28, 2022
917f552
mesh: add transfer texture between two identical meshes
cdcseacave Dec 2, 2022
56a6536
transform: add --export-type param
cdcseacave Dec 3, 2022
a8507a0
transform: import face IDs subset to use for texture transfer
cdcseacave Dec 4, 2022
0c9d912
interface: add Python API
cdcseacave Dec 6, 2022
0c2228e
common: disable TImage::Show() on release
cdcseacave Dec 6, 2022
000443e
build: disable CUDA during continuous integration
cdcseacave Dec 6, 2022
516306a
common: implement custom RQ decomposition
cdcseacave Dec 27, 2022
2874f19
dense: load mask with predefined '.mask.png' extension
cdcseacave Dec 27, 2022
6702bf4
common: fix OBB::GetCorners()
cdcseacave Jan 30, 2023
0f83ba4
interface: fix import for ContextCapture BlocksExchange format
cdcseacave Mar 16, 2023
fe94580
build: update vcpkg for CI
cdcseacave Mar 16, 2023
97776fe
dense: add --mask-path to specify folder containing mask images (#940)
kenshi84 Mar 17, 2023
5adaa5c
build: simplify docker build and reduce build image (#952)
yanxke Mar 17, 2023
7d4c444
interface: fix InterfaceOpenMVG and InterfaceVisualSFM build (#951)
yanxke Mar 17, 2023
98aca50
interface: fix Metashape import with point-cloud
cdcseacave Mar 17, 2023
148b129
interface: initialize average scene depth per image while importing M…
cdcseacave Mar 20, 2023
8093255
build: added GUI support to docker; working viewer (#954)
satyajitghana Apr 1, 2023
6d0e772
build: add script to build Docker container on Windows (#966)
cdcseacave Apr 9, 2023
744d456
interface: import images with invalid poses
cdcseacave Apr 11, 2023
285de9b
common: add COLMAP SfM to MvgMvsPipeline.py (#977)
Apr 28, 2023
b41a8ce
texture: detect and ignore invalid image pixels generated by lens dis…
PxGluz May 4, 2023
af8578a
transform: transform scene by the given matrix
cdcseacave May 4, 2023
2c82a66
viewer: add support for importing a point-cloud
cdcseacave May 4, 2023
af5c939
build: update vcpkg in CI
cdcseacave May 18, 2023
c69bae4
texture: add image mask support (#967)
Sanheiii May 20, 2023
845f664
interface: export to COLMAP in binary format
cdcseacave May 24, 2023
15d4fd3
interface: force sparse point cloud COLMAP export
cdcseacave Jun 1, 2023
ced6ff3
interface: detect same platform for MVSNet import
cdcseacave Jun 1, 2023
4efd9b4
dense: estimate point-cloud scales
cdcseacave Jun 16, 2023
017161e
build: update vcpkg in CI
cdcseacave Jun 16, 2023
2d95bdc
common: fix incorrect comparison in BufferedOutputStream (#1010)
dllu Jun 20, 2023
3cb7f7a
interface: add Polycam importer
cdcseacave Jun 28, 2023
cbe6c93
build: update vcpkg in CI
cdcseacave Jun 28, 2023
5fb4d9e
dense: detect and improve tower like structure reconstruction (#1017)
cdcseacave Jul 2, 2023
f790ad6
interface: fix BlocksExchange importer
cdcseacave Jul 4, 2023
fb0a65d
mesh: crop mesh to input ROI
cdcseacave Jul 4, 2023
632a9bc
Merge branch 'master' into develop
cdcseacave Jul 4, 2023
d2d874d
common: v2.2.0
cdcseacave Jul 4, 2023
5347df2
transform: simplify transform matrix parsing (#1026)
nianjiuhuiyi Jul 13, 2023
a12e182
io: support images with .jpeg file extension (#1027)
csparker247 Jul 14, 2023
028c806
common: fix some warnings
cdcseacave Jul 14, 2023
742eabf
common: remove all usages of cv::String (#1028)
csparker247 Jul 14, 2023
b58a687
common: save/load results as point-cloud/mesh PLY instead of MVS files
cdcseacave Aug 5, 2023
a84072d
build: enable SSE on non-ARM systems only (#1042)
autoantwort Aug 14, 2023
a5707ae
interface: add Nerfstudio and RTMV importer (#1047)
cdcseacave Aug 18, 2023
f57daf5
interface: add depth and mask importer to RTMV
cdcseacave Aug 20, 2023
e3664e5
interface: fix color import from BlocksExchange
cdcseacave Aug 30, 2023
0a6ef82
viewer: refactor scene with external geometry loading
cdcseacave Aug 31, 2023
70de228
build: fix optional python with vcpkg
cdcseacave Sep 1, 2023
c84b15b
interface: fix for old GCC without filesystem support
cdcseacave Sep 1, 2023
91c9c2c
common: add an A100 CUDA parameter (#1053)
t-kusanagi Sep 6, 2023
c1b1cc9
common: add Python utility for reading DMAP files (#1059)
Sep 21, 2023
19fc792
mesh: improve texture transfer
cdcseacave Oct 17, 2023
f711e4a
interface: account for different pixel center conventions as COLMAP u…
cdcseacave Oct 17, 2023
95decea
texture: add multi texture support (#1074)
cdcseacave Oct 23, 2023
ecd5dde
interface: add Python utility for reading MVS scenes (#1069)
Oct 23, 2023
15a1407
build: enforce Eigen >= 3.4 (#1078)
magwe Oct 27, 2023
34961de
common: clean frustum creation
cdcseacave Nov 4, 2023
88765f6
mesh: improve fix non-manifold algorithm
cdcseacave Nov 7, 2023
b7adc80
common: support culling on/off in rasterization
cdcseacave Nov 8, 2023
d9b7416
mesh: unify vector calling convention
cdcseacave Nov 8, 2023
48cc91c
transform: improve texture transfer robustness
cdcseacave Nov 9, 2023
40800a4
common: unify library initialization and closing
cdcseacave Nov 11, 2023
3c19cdd
common: improve Eigen interface for custom types
cdcseacave Nov 11, 2023
ac43899
texture: fix non-OMP code and some warnings
cdcseacave Nov 11, 2023
bc67cf9
dense: estimate normal-map from depth-map during fusion if requested
cdcseacave Nov 22, 2023
186eb29
interface: make depth import optional in polycam
cdcseacave Dec 2, 2023
6449134
dense: use tower mode 4 by default
cdcseacave Dec 7, 2023
496c4a9
viewer: add option to crop scene to bounding box
cdcseacave Dec 7, 2023
add11b7
dense: fix fusion with invalid depth-map
cdcseacave Dec 9, 2023
da4b76c
v2.3.0
cdcseacave Jan 6, 2024
3c22ba7
Merge remote-tracking branch 'origin/master' into develop
cdcseacave Jan 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ SET(OpenMVS_BUILD_TOOLS ON CACHE BOOL "Build example applications")
SET(OpenMVS_USE_OPENMP ON CACHE BOOL "Enable OpenMP library")
SET(OpenMVS_USE_OPENGL ON CACHE BOOL "Enable OpenGL library")
SET(OpenMVS_USE_BREAKPAD ON CACHE BOOL "Enable BreakPad library")
SET(OpenMVS_USE_PYTHON OFF CACHE BOOL "Enable Python library bindings")
SET(OpenMVS_USE_PYTHON ON CACHE BOOL "Enable Python library bindings")
SET(OpenMVS_USE_CERES OFF CACHE BOOL "Enable CERES optimization library")
SET(OpenMVS_USE_CUDA ON CACHE BOOL "Enable CUDA library")
SET(OpenMVS_USE_FAST_FLOAT2INT ON CACHE BOOL "Use an optimized code to convert real numbers to int")
SET(OpenMVS_USE_FAST_FLOAT2INT OFF CACHE BOOL "Use an optimized code to convert real numbers to int")
SET(OpenMVS_USE_FAST_INVSQRT OFF CACHE BOOL "Use an optimized code to compute the inverse square root (slower in fact on modern compilers)")
SET(OpenMVS_USE_FAST_CBRT ON CACHE BOOL "Use an optimized code to compute the cubic root")
SET(OpenMVS_USE_FAST_CBRT OFF CACHE BOOL "Use an optimized code to compute the cubic root")
SET(OpenMVS_USE_SSE ON CACHE BOOL "Enable SSE optimizations")
SET(OpenMVS_MAX_CUDA_COMPATIBILITY OFF CACHE BOOL "Build for maximum CUDA device compatibility")
SET(OpenMVS_ENABLE_TESTS ON CACHE BOOL "Enable test code")
Expand Down Expand Up @@ -52,10 +52,15 @@ ENDIF()
PROJECT(OpenMVS)

SET(OpenMVS_MAJOR_VERSION 2)
SET(OpenMVS_MINOR_VERSION 2)
SET(OpenMVS_MINOR_VERSION 3)
SET(OpenMVS_PATCH_VERSION 0)
SET(OpenMVS_VERSION ${OpenMVS_MAJOR_VERSION}.${OpenMVS_MINOR_VERSION}.${OpenMVS_PATCH_VERSION})

# Disable SSE on unsuported platforms
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|ARM|aarch64|AARCH64)")
SET(OpenMVS_USE_SSE OFF)
ENDIF()

# Define helper functions and macros.
INCLUDE(build/Utils.cmake)

Expand Down Expand Up @@ -109,16 +114,15 @@ if(OpenMVS_USE_CUDA)
ENABLE_LANGUAGE(CUDA)
# CUDA-11.x can not be compiled using C++14 standard on Windows
string(REGEX MATCH "^[0-9]+" CUDA_MAJOR ${CMAKE_CUDA_COMPILER_VERSION})
if(${CUDA_MAJOR} GREATER 10 AND CMAKE_CXX_COMPILER MATCHES "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.29")
message("Working around windows build failure with visual studio. Visual studio 16.10 introduced a compiler bug with compilng CUDA code with C++14. Set the cuda standard to 17 as a workaround.")
set(CMAKE_CUDA_STANDARD 17)
if(${CUDA_MAJOR} GREATER 10)
SET(CMAKE_CUDA_STANDARD 17)
endif()
EXECUTE_PROCESS(COMMAND "${CMAKE_CUDA_COMPILER}" --list-gpu-arch
OUTPUT_VARIABLE LIST_GPU_ARCH
ERROR_QUIET)
if(NOT LIST_GPU_ARCH AND OpenMVS_MAX_CUDA_COMPATIBILITY)
message(WARNING "Cannot compile for max CUDA compatibility, nvcc does not support --list-gpu-arch")
set(OpenMVS_MAX_CUDA_COMPATIBILITY NO)
SET(OpenMVS_MAX_CUDA_COMPATIBILITY OFF)
endif()
if(NOT OpenMVS_MAX_CUDA_COMPATIBILITY)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
Expand Down Expand Up @@ -172,19 +176,21 @@ if(OpenMVS_USE_BREAKPAD)
endif()
endif()

SET(Boost_EXTRA_COMPONENTS "")
if(OpenMVS_USE_PYTHON)
FIND_PACKAGE(PythonLibs 3.0 REQUIRED)
if(PythonLibs_FOUND)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
LIST(APPEND OpenMVS_EXTRA_INCLUDES ${PYTHON_INCLUDE_DIRS})
LIST(APPEND OpenMVS_EXTRA_LIBS ${PYTHON_LIBRARIES})
MESSAGE(STATUS "Python ${PYTHON_VERSION} found (include: ${PYTHON_INCLUDE_DIRS})")
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development REQUIRED)
if(Python3_FOUND)
INCLUDE_DIRECTORIES(${Python3_INCLUDE_DIRS})
LIST(APPEND OpenMVS_EXTRA_INCLUDES ${Python3_INCLUDE_DIRS})
LIST(APPEND OpenMVS_EXTRA_LIBS ${Python3_LIBRARIES})
LIST(APPEND Boost_EXTRA_COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
MESSAGE(STATUS "Python ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} found (include: ${Python3_INCLUDE_DIRS})")
else()
MESSAGE("-- Can't find Python. Continuing without it.")
endif()
endif()

FIND_PACKAGE(Boost REQUIRED COMPONENTS iostreams program_options system serialization OPTIONAL_COMPONENTS python3)
FIND_PACKAGE(Boost REQUIRED COMPONENTS iostreams program_options system serialization OPTIONAL_COMPONENTS ${Boost_EXTRA_COMPONENTS})
if(Boost_FOUND)
LIST(APPEND OpenMVS_EXTRA_INCLUDES ${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
Expand All @@ -195,12 +201,12 @@ if(Boost_FOUND)
LIST(APPEND Boost_LIBRARIES zstd)
endif()
SET(_USE_BOOST TRUE)
if(Boost_python3_FOUND)
if(OpenMVS_USE_PYTHON AND Boost_${Boost_EXTRA_COMPONENTS}_FOUND)
SET(_USE_BOOST_PYTHON TRUE)
endif()
endif()

FIND_PACKAGE(Eigen3 REQUIRED)
FIND_PACKAGE(Eigen3 3.4 REQUIRED)
if(EIGEN3_FOUND)
LIST(APPEND OpenMVS_EXTRA_INCLUDES ${EIGEN3_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
Expand Down
71 changes: 34 additions & 37 deletions apps/DensifyPointCloud/DensifyPointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace {

namespace OPT {
String strInputFileName;
String strPointCloudFileName;
String strOutputFileName;
String strViewNeighborsFileName;
String strOutputViewNeighborsFileName;
Expand All @@ -73,8 +74,17 @@ String strConfigFileName;
boost::program_options::variables_map vm;
} // namespace OPT

class Application {
public:
Application() {}
~Application() { Finalize(); }

bool Initialize(size_t argc, LPCTSTR* argv);
void Finalize();
}; // Application

// initialize and parse the command line parameters
bool Initialize(size_t argc, LPCTSTR* argv)
bool Application::Initialize(size_t argc, LPCTSTR* argv)
{
// initialize log and console
OPEN_LOG();
Expand All @@ -86,7 +96,7 @@ bool Initialize(size_t argc, LPCTSTR* argv)
("help,h", "produce this help message")
("working-folder,w", boost::program_options::value<std::string>(&WORKING_FOLDER), "working directory (default current directory)")
("config-file,c", boost::program_options::value<std::string>(&OPT::strConfigFileName)->default_value(APPNAME _T(".cfg")), "file name containing program options")
("archive-type", boost::program_options::value(&OPT::nArchiveType)->default_value(ARCHIVE_DEFAULT), "project archive type: 0-text, 1-binary, 2-compressed binary")
("archive-type", boost::program_options::value(&OPT::nArchiveType)->default_value(ARCHIVE_MVS), "project archive type: -1-interface, 0-text, 1-binary, 2-compressed binary")
("process-priority", boost::program_options::value(&OPT::nProcessPriority)->default_value(-1), "process priority (below normal by default)")
("max-threads", boost::program_options::value(&OPT::nMaxThreads)->default_value(0), "maximum number of threads (0 for using all available cores)")
#if TD_VERBOSE != TD_VERBOSE_OFF
Expand Down Expand Up @@ -127,6 +137,7 @@ bool Initialize(size_t argc, LPCTSTR* argv)
boost::program_options::options_description config("Densify options");
config.add_options()
("input-file,i", boost::program_options::value<std::string>(&OPT::strInputFileName), "input filename containing camera poses and image list")
("pointcloud-file,p", boost::program_options::value<std::string>(&OPT::strPointCloudFileName), "sparse point-cloud with views file name to densify (overwrite existing point-cloud)")
("output-file,o", boost::program_options::value<std::string>(&OPT::strOutputFileName), "output filename for storing the dense point-cloud (optional)")
("view-neighbors-file", boost::program_options::value<std::string>(&OPT::strViewNeighborsFileName), "input filename containing the list of views and their neighbors (optional)")
("output-view-neighbors-file", boost::program_options::value<std::string>(&OPT::strOutputViewNeighborsFileName), "output filename containing the generated list of views and their neighbors")
Expand All @@ -153,7 +164,7 @@ bool Initialize(size_t argc, LPCTSTR* argv)
("estimate-roi", boost::program_options::value(&OPT::nEstimateROI)->default_value(2), "estimate and set region-of-interest (0 - disabled, 1 - enabled, 2 - adaptive)")
("crop-to-roi", boost::program_options::value(&OPT::bCrop2ROI)->default_value(true), "crop scene using the region-of-interest")
("remove-dmaps", boost::program_options::value(&bRemoveDmaps)->default_value(false), "remove depth-maps after fusion")
("tower-mode", boost::program_options::value(&OPT::nTowerMode)->default_value(3), "add a cylinder of points in the center of ROI; scene assume to be Z-up oriented (0 - disabled, 1 - replace, 2 - append, 3 - select neighbors, <0 - force tower mode)")
("tower-mode", boost::program_options::value(&OPT::nTowerMode)->default_value(4), "add a cylinder of points in the center of ROI; scene assume to be Z-up oriented (0 - disabled, 1 - replace, 2 - append, 3 - select neighbors, 4 - select neighbors & append, <0 - force tower mode)")
;

// hidden options, allowed both on command line and
Expand Down Expand Up @@ -211,6 +222,7 @@ bool Initialize(size_t argc, LPCTSTR* argv)
return false;

// initialize optional options
Util::ensureValidPath(OPT::strPointCloudFileName);
Util::ensureValidPath(OPT::strOutputFileName);
Util::ensureValidPath(OPT::strViewNeighborsFileName);
Util::ensureValidPath(OPT::strOutputViewNeighborsFileName);
Expand Down Expand Up @@ -242,29 +254,14 @@ bool Initialize(size_t argc, LPCTSTR* argv)
if (!bValidConfig && !OPT::strDenseConfigFileName.empty())
OPTDENSE::oConfig.Save(OPT::strDenseConfigFileName);

// initialize global options
Process::setCurrentProcessPriority((Process::Priority)OPT::nProcessPriority);
#ifdef _USE_OPENMP
if (OPT::nMaxThreads != 0)
omp_set_num_threads(OPT::nMaxThreads);
#endif

#ifdef _USE_BREAKPAD
// start memory dumper
MiniDumper::Create(APPNAME, WORKING_FOLDER);
#endif

Util::Init();
MVS::Initialize(APPNAME, OPT::nMaxThreads, OPT::nProcessPriority);
return true;
}

// finalize application instance
void Finalize()
void Application::Finalize()
{
#if TD_VERBOSE != TD_VERBOSE_OFF
// print memory statistics
Util::LogMemoryInfo();
#endif
MVS::Finalize();

CLOSE_LOGFILE();
CLOSE_LOGCONSOLE();
Expand All @@ -280,7 +277,8 @@ int main(int argc, LPCTSTR* argv)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);// | _CRTDBG_CHECK_ALWAYS_DF);
#endif

if (!Initialize(argc, argv))
Application application;
if (!application.Initialize(argc, argv))
return EXIT_FAILURE;

Scene scene(OPT::nMaxThreads);
Expand All @@ -296,12 +294,16 @@ int main(int argc, LPCTSTR* argv)
scene.mesh.SamplePoints(ROUND2INT<unsigned>(-OPT::fSampleMesh), pointcloud);
VERBOSE("Sample mesh completed: %u points (%s)", pointcloud.GetSize(), TD_TIMER_GET_FMT().c_str());
pointcloud.Save(MAKE_PATH_SAFE(Util::getFileFullName(OPT::strOutputFileName))+_T(".ply"));
Finalize();
return EXIT_SUCCESS;
}
// load and estimate a dense point-cloud
if (!scene.Load(MAKE_PATH_SAFE(OPT::strInputFileName)))
const Scene::SCENE_TYPE sceneType(scene.Load(MAKE_PATH_SAFE(OPT::strInputFileName)));
if (sceneType == Scene::SCENE_NA)
return EXIT_FAILURE;
if (!OPT::strPointCloudFileName.empty() && !scene.pointcloud.Load(MAKE_PATH_SAFE(OPT::strPointCloudFileName))) {
VERBOSE("error: cannot load point-cloud file");
return EXIT_FAILURE;
}
if (!OPT::strMaskPath.empty()) {
Util::ensureValidFolderPath(OPT::strMaskPath);
for (Image& image : scene.images) {
Expand All @@ -322,7 +324,6 @@ int main(int argc, LPCTSTR* argv)
return EXIT_FAILURE;
fs >> scene.obb;
scene.Save(MAKE_PATH_SAFE(Util::getFileFullName(OPT::strOutputFileName))+_T(".mvs"), (ARCHIVE_TYPE)OPT::nArchiveType);
Finalize();
return EXIT_SUCCESS;
}
if (!scene.IsBounded())
Expand All @@ -332,7 +333,6 @@ int main(int argc, LPCTSTR* argv)
if (!fs)
return EXIT_FAILURE;
fs << scene.obb;
Finalize();
return EXIT_SUCCESS;
}
if (OPT::nTowerMode!=0)
Expand All @@ -355,15 +355,13 @@ int main(int argc, LPCTSTR* argv)
if (!scene.ExportMeshToDepthMaps(MAKE_PATH_SAFE(OPT::strExportDepthMapsName)))
return EXIT_FAILURE;
VERBOSE("Mesh projection completed: %u depth-maps (%s)", scene.images.size(), TD_TIMER_GET_FMT().c_str());
Finalize();
return EXIT_SUCCESS;
}
if (OPT::fMaxSubsceneArea > 0) {
// split the scene in sub-scenes by maximum sampling area
Scene::ImagesChunkArr chunks;
scene.Split(chunks, OPT::fMaxSubsceneArea);
scene.ExportChunks(chunks, GET_PATH_FULL(OPT::strOutputFileName), (ARCHIVE_TYPE)OPT::nArchiveType);
Finalize();
return EXIT_SUCCESS;
}
if (OPT::thFilterPointCloud < 0) {
Expand All @@ -372,7 +370,6 @@ int main(int argc, LPCTSTR* argv)
const String baseFileName(MAKE_PATH_SAFE(Util::getFileFullName(OPT::strOutputFileName))+_T("_filtered"));
scene.Save(baseFileName+_T(".mvs"), (ARCHIVE_TYPE)OPT::nArchiveType);
scene.pointcloud.Save(baseFileName+_T(".ply"));
Finalize();
return EXIT_SUCCESS;
}
if (OPT::nExportNumViews && scene.pointcloud.IsValid()) {
Expand All @@ -388,7 +385,6 @@ int main(int argc, LPCTSTR* argv)
scene.Save(baseFileName+_T(".mvs"), (ARCHIVE_TYPE)OPT::nArchiveType);
scene.pointcloud.Save(baseFileName+_T(".ply"));
}
Finalize();
return EXIT_SUCCESS;
}
if (OPT::fEstimateScale > 0 && !scene.pointcloud.IsEmpty() && !scene.images.empty()) {
Expand All @@ -402,35 +398,36 @@ int main(int argc, LPCTSTR* argv)
}
const String baseFileName(MAKE_PATH_SAFE(Util::getFileFullName(OPT::strOutputFileName)));
scene.pointcloud.SaveWithScale(baseFileName+_T("_scale.ply"), scene.images, OPT::fEstimateScale);
Finalize();
return EXIT_SUCCESS;
}
if ((ARCHIVE_TYPE)OPT::nArchiveType != ARCHIVE_MVS) {
PointCloud sparsePointCloud;
if ((ARCHIVE_TYPE)OPT::nArchiveType != ARCHIVE_MVS || sceneType == Scene::SCENE_INTERFACE) {
#if TD_VERBOSE != TD_VERBOSE_OFF
if (VERBOSITY_LEVEL > 1 && !scene.pointcloud.IsEmpty())
scene.pointcloud.PrintStatistics(scene.images.data(), &scene.obb);
#endif
if ((ARCHIVE_TYPE)OPT::nArchiveType == ARCHIVE_MVS)
sparsePointCloud = scene.pointcloud;
TD_TIMER_START();
if (!scene.DenseReconstruction(OPT::nFusionMode, OPT::bCrop2ROI, OPT::fBorderROI)) {
if (ABS(OPT::nFusionMode) != 1)
return EXIT_FAILURE;
VERBOSE("Depth-maps estimated (%s)", TD_TIMER_GET_FMT().c_str());
Finalize();
return EXIT_SUCCESS;
}
VERBOSE("Densifying point-cloud completed: %u points (%s)", scene.pointcloud.GetSize(), TD_TIMER_GET_FMT().c_str());
}

// save the final point-cloud
const String baseFileName(MAKE_PATH_SAFE(Util::getFileFullName(OPT::strOutputFileName)));
scene.Save(baseFileName+_T(".mvs"), (ARCHIVE_TYPE)OPT::nArchiveType);
scene.pointcloud.Save(baseFileName+_T(".ply"));
scene.pointcloud.Save(baseFileName+_T(".ply"), (ARCHIVE_TYPE)OPT::nArchiveType == ARCHIVE_MVS);
#if TD_VERBOSE != TD_VERBOSE_OFF
if (VERBOSITY_LEVEL > 2)
scene.ExportCamerasMLP(baseFileName+_T(".mlp"), baseFileName+_T(".ply"));
#endif

Finalize();
if ((ARCHIVE_TYPE)OPT::nArchiveType == ARCHIVE_MVS)
scene.pointcloud.Swap(sparsePointCloud);
scene.Save(baseFileName+_T(".mvs"), (ARCHIVE_TYPE)OPT::nArchiveType);
return EXIT_SUCCESS;
}
/*----------------------------------------------------------------*/
Loading
Loading