Skip to content

Commit 2289a04

Browse files
authored
Merge branch 'develop' into master (#512)
- open depth-map `DMAP` file format for easy utilization outside `OpenMVS` (see `ExportDepthDataRaw()` and `ImportDepthDataRaw()`) - expose some depth-map functions in `SceneDensify.h` - add global `ID` support to image structure to allow processing large scenes by splitting them into multiple sub-scenes to be processed individually
1 parent c0b7a6f commit 2289a04

33 files changed

+653
-352
lines changed

.appveyor.yml

Lines changed: 81 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Specify version format
1+
# specify version format
22
version: "{build}"
33

44
image:
55
- Visual Studio 2017
66
- ubuntu1804
7+
- macos
78

89
platform:
910
- x64
@@ -17,105 +18,107 @@ configuration:
1718
- Debug
1819
- Release
1920

20-
# scripts that are called at very beginning, before repo cloning
21-
init:
22-
#------------------
23-
# Windows 10
24-
#------------------
25-
- cmd: ver
26-
- cmd: cmake --version
27-
- cmd: msbuild /version
28-
29-
#------------------
30-
# Ubuntu 18.04 LTS
31-
#------------------
32-
- sh: lsb_release -a
33-
- sh: cmake --version
34-
3521
# branches to build
3622
branches:
3723
# blacklist
3824
except:
3925
- gh-pages
4026

41-
# scripts that run after cloning repository
42-
install:
27+
for:
28+
-
4329
#------------------
4430
# Windows 10
4531
#------------------
46-
# update vcpkg
47-
- cmd: cd C:\tools\vcpkg
48-
- cmd: git pull
49-
- cmd: .\bootstrap-vcpkg.bat
50-
51-
- cmd: if "%platform%"=="Win32" set VCPKG_ARCH=x86-windows
52-
- cmd: if "%platform%"=="x64" set VCPKG_ARCH=x64-windows
53-
54-
# remove outdated versions
55-
- cmd: vcpkg remove --outdated --recurse
56-
57-
# install required dependencies
58-
- cmd: vcpkg install --recurse --triplet %VCPKG_ARCH% zlib boost-iostreams boost-program-options boost-system boost-serialization eigen3 cgal[core] opencv
59-
60-
# install optional dependencies
61-
- cmd: vcpkg install --recurse --triplet %VCPKG_ARCH% glew glfw3
62-
63-
- cmd: vcpkg integrate install
64-
- cmd: cd "%APPVEYOR_BUILD_FOLDER%"
65-
66-
#------------------
67-
# Ubuntu 18.04 LTS
68-
#------------------
69-
- sh: sudo apt-get update -qq && sudo apt-get install -qq
70-
- sh: sudo apt-get -y install build-essential git mercurial cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libxmu-dev libxi-dev
71-
- sh: sudo apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev
72-
- sh: sudo apt-get -y install libopencv-dev libcgal-dev libcgal-qt5-dev libatlas-base-dev
73-
#- sh: sudo apt-get -y install libsuitesparse-dev libceres-dev
74-
- sh: sudo apt-get -y install freeglut3-dev libglew-dev libglfw3-dev
75-
76-
# preserve contents of selected directories and files across project builds
77-
for:
78-
-
7932
matrix:
8033
only:
8134
- image: Visual Studio 2017
35+
# scripts that are called at very beginning, before repo cloning
36+
init:
37+
- ver
38+
- cmake --version
39+
- msbuild /version
40+
# scripts that run after cloning repository
41+
install:
42+
# update vcpkg
43+
- cd C:\tools\vcpkg
44+
- git pull
45+
- .\bootstrap-vcpkg.bat
46+
- if "%platform%"=="Win32" set VCPKG_ARCH=x86-windows
47+
- if "%platform%"=="x64" set VCPKG_ARCH=x64-windows
48+
# remove outdated versions
49+
- vcpkg remove --outdated --recurse
50+
# install dependencies
51+
- vcpkg install --recurse --triplet %VCPKG_ARCH% zlib boost-iostreams boost-program-options boost-system boost-serialization eigen3 cgal[core] opencv glew glfw3
52+
- vcpkg integrate install
53+
- cd "%APPVEYOR_BUILD_FOLDER%"
54+
# preserve contents of selected directories and files across project builds
8255
cache:
8356
- 'C:\tools\vcpkg\installed'
57+
build_script:
58+
- git clone https://github.com/cdcseacave/VCG.git
59+
- if "%platform%"=="Win32" set CMAKE_GENERATOR=-G"Visual Studio 15 2017"
60+
- if "%platform%"=="x64" set CMAKE_GENERATOR=-G"Visual Studio 15 2017 Win64"
61+
- mkdir bin && cd bin
62+
- cmake %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%Configuration% -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCG_ROOT="%APPVEYOR_BUILD_FOLDER%\VCG" ..
63+
- cmake --build . --target ALL_BUILD --config %Configuration% -- /maxcpucount:4
8464
-
65+
#------------------
66+
# Ubuntu 18.04 LTS
67+
#------------------
8568
matrix:
8669
only:
8770
- image: ubuntu1804
71+
# scripts that are called at very beginning, before repo cloning
72+
init:
73+
- lsb_release -a
74+
- cmake --version
75+
- gcc -v
76+
# scripts that run after cloning repository
77+
install:
78+
- sudo apt-get update -qq && sudo apt-get install -qq
79+
- sudo apt-get -y install build-essential git cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libxmu-dev libxi-dev
80+
- sudo apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev
81+
- sudo apt-get -y install libopencv-dev libcgal-dev libcgal-qt5-dev libatlas-base-dev
82+
- sudo apt-get -y install freeglut3-dev libglew-dev libglfw3-dev
83+
# preserve contents of selected directories and files across project builds
8884
cache:
8985
- '/usr/lib/x86_64-linux-gnu/'
90-
91-
build_script:
92-
# get VCG library
93-
- git clone https://github.com/cdcseacave/VCG.git
94-
95-
#------------------
96-
# Windows 10
97-
#------------------
98-
- cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR=-G"Visual Studio 15 2017"
99-
- cmd: if "%platform%"=="x64" set CMAKE_GENERATOR=-G"Visual Studio 15 2017 Win64"
100-
- cmd: mkdir bin && cd bin
101-
- cmd: cmake %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%Configuration% -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCG_ROOT="%APPVEYOR_BUILD_FOLDER%\VCG" ..
102-
- cmd: cmake --build . --target ALL_BUILD --config %Configuration% -- /maxcpucount:4
103-
86+
build_script:
87+
- git clone https://github.com/cdcseacave/VCG.git
88+
- git clone --single-branch --branch 3.2 https://gitlab.com/libeigen/eigen.git
89+
- mkdir eigen_build && cd eigen_build
90+
- cmake . ../eigen
91+
- make && sudo make install
92+
- cd ..
93+
- mkdir bin && cd bin
94+
- cmake -DCMAKE_BUILD_TYPE=$Configuration -DVCG_ROOT="$APPVEYOR_BUILD_FOLDER/VCG" ..
95+
- make
96+
-
10497
#------------------
105-
# Ubuntu 18.04 LTS
98+
# MacOS
10699
#------------------
107-
- sh: hg clone https://bitbucket.org/eigen/eigen#3.2
108-
- sh: mkdir eigen_build && cd eigen_build
109-
- sh: cmake . ../eigen
110-
- sh: make && sudo make install
111-
- sh: cd ..
112-
- sh: mkdir bin && cd bin
113-
- sh: cmake -DCMAKE_BUILD_TYPE=$Configuration -DVCG_ROOT="$APPVEYOR_BUILD_FOLDER/VCG" ..
114-
- sh: make
115-
116-
test_script:
117-
#- cmd: ctest --build-config %Configuration% --parallel 4 --output-on-failure
118-
#- sh: ctest -j4
100+
matrix:
101+
only:
102+
- image: macos
103+
# scripts that are called at very beginning, before repo cloning
104+
init:
105+
- system_profiler SPSoftwareDataType
106+
- cmake --version
107+
- gcc -v
108+
# scripts that run after cloning repository
109+
install:
110+
- brew update
111+
- printf "#%s/bin/bash\nbrew install libomp boost eigen opencv cgal glew glfw3\nexit 0\n" "!" > install.sh
112+
- chmod +x install.sh
113+
- ./install.sh
114+
# preserve contents of selected directories and files across project builds
115+
cache:
116+
- '/usr/local/Cellar/'
117+
build_script:
118+
- git clone https://github.com/cdcseacave/VCG.git
119+
- mkdir bin && cd bin
120+
- cmake -DCMAKE_BUILD_TYPE=$CONFIGURATION -DVCG_ROOT="$APPVEYOR_BUILD_FOLDER/VCG" ..
121+
- make
119122

120123
on_success:
121124
- cmd: 7z a OpenMVS_x64.7z "C:\projects\openmvs\bin\bin\vc15\x64\%Configuration%\*.exe" "C:\projects\openmvs\bin\bin\vc15\x64\%Configuration%\*.dll"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ CMakeSettings.json
3434
.vs/
3535
.idea/
3636
.vscode/
37+
out/
3738
bin/
3839
binaries/

BUILD.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Dependencies
33
------------
44

55
*OpenMVS* relies on a number of open source libraries, some of which are optional. For details on customizing the build process, see the compilation instructions.
6-
* [Eigen](http://eigen.tuxfamily.org) version 3.2 or higher
6+
* [Eigen](http://eigen.tuxfamily.org) version 3.2 (or higher on Windows only)
77
* [OpenCV](http://opencv.org) version 2.4 or higher
88
* [Ceres](http://ceres-solver.org) version 1.10 or higher
99
* [CGAL](http://www.cgal.org) version 4.2 or higher
@@ -60,11 +60,11 @@ Linux compilation
6060
```
6161
#Prepare and empty machine for building:
6262
sudo apt-get update -qq && sudo apt-get install -qq
63-
sudo apt-get -y install git mercurial cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev
63+
sudo apt-get -y install git cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev
6464
main_path=`pwd`
6565
6666
#Eigen (Required)
67-
hg clone https://bitbucket.org/eigen/eigen#3.2
67+
git clone https://gitlab.com/libeigen/eigen.git --branch 3.2
6868
mkdir eigen_build && cd eigen_build
6969
cmake . ../eigen
7070
make && sudo make install
@@ -114,10 +114,12 @@ Install dependencies, run CMake and make.
114114
```
115115
#Install dependencies
116116
brew update
117-
brew tap homebrew/science
118-
brew install boost eigen opencv cgal ceres-solver
117+
brew install boost eigen opencv cgal
119118
main_path=`pwd`
120119
120+
#GLFW3 (Optional)
121+
brew install glew glfw3
122+
121123
#VCGLib (Required)
122124
git clone https://github.com/cdcseacave/VCG.git vcglib
123125

CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
1212
# ${OpenMVS_BINARY_DIR}.
1313
PROJECT(OpenMVS)
1414

15-
set(OpenMVS_MAJOR_VERSION 0)
16-
set(OpenMVS_MINOR_VERSION 7)
17-
set(OpenMVS_PATCH_VERSION 0)
15+
set(OpenMVS_MAJOR_VERSION 1)
16+
set(OpenMVS_MINOR_VERSION 0)
17+
set(OpenMVS_PATCH_VERSION 1)
1818
set(OpenMVS_VERSION ${OpenMVS_MAJOR_VERSION}.${OpenMVS_MINOR_VERSION}.${OpenMVS_PATCH_VERSION})
1919

2020
# Find dependencies:
@@ -55,12 +55,20 @@ SET(OpenMVS_CONFIG_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to creat
5555
INCLUDE_DIRECTORIES("${OpenMVS_SOURCE_DIR}")
5656

5757
# Find required packages
58+
SET(OpenMVS_EXTRA_LIBS "")
5859
if(OpenMVS_USE_OPENMP)
60+
SET(OpenMP_LIBS "")
5961
FIND_PACKAGE(OpenMP)
6062
if(OPENMP_FOUND)
6163
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
6264
ADD_DEFINITIONS(-D_USE_OPENMP)
6365
SET(_USE_OPENMP TRUE)
66+
#cmake only check for separate OpenMP library on AppleClang 7+
67+
#https://github.com/Kitware/CMake/blob/42212f7539040139ecec092547b7d58ef12a4d72/Modules/FindOpenMP.cmake#L252
68+
if (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
69+
SET(OpenMP_LIBS ${OpenMP_libomp_LIBRARY})
70+
LIST(APPEND OpenMVS_EXTRA_LIBS ${OpenMP_LIBS})
71+
endif()
6472
else()
6573
message("-- Can't find OpenMP. Continuing without it.")
6674
endif()
@@ -97,6 +105,7 @@ if(OpenMVS_USE_BREAKPAD)
97105
INCLUDE_DIRECTORIES(${BREAKPAD_INCLUDE_DIRS})
98106
ADD_DEFINITIONS(${BREAKPAD_DEFINITIONS} -D_USE_BREAKPAD)
99107
SET(_USE_BREAKPAD TRUE)
108+
LIST(APPEND OpenMVS_EXTRA_LIBS ${BREAKPAD_LIBS})
100109
else()
101110
MESSAGE("-- Can't find BreakPad. Continuing without it.")
102111
endif()

apps/DensifyPointCloud/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ else()
55
endif()
66
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")
77

8-
cxx_executable_with_flags_no_pch(DensifyPointCloud "Apps" "${cxx_default}" "MVS" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
9-
10-
if(OpenMVS_USE_BREAKPAD AND BREAKPAD_FOUND)
11-
target_link_libraries(DensifyPointCloud ${BREAKPAD_LIBS})
12-
endif()
8+
cxx_executable_with_flags_no_pch(DensifyPointCloud "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
139

1410
# Install
1511
INSTALL(TARGETS DensifyPointCloud

apps/InterfaceCOLMAP/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ else()
55
endif()
66
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")
77

8-
cxx_executable_with_flags_no_pch(InterfaceCOLMAP "Apps" "${cxx_default}" "MVS" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
9-
10-
if(3Dnovator_USE_BREAKPAD AND BREAKPAD_FOUND)
11-
target_link_libraries(InterfaceCOLMAP ${BREAKPAD_LIBS})
12-
endif()
8+
cxx_executable_with_flags_no_pch(InterfaceCOLMAP "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
139

1410
# Install
1511
INSTALL(TARGETS InterfaceCOLMAP
16-
EXPORT 3DnovatorTargets
12+
EXPORT OpenMVSTargets
1713
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin)

apps/InterfaceCOLMAP/InterfaceCOLMAP.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ bool ImportScene(const String& strFolder, Interface& scene)
449449
scene.platforms.push_back(platform);
450450
}
451451
}
452+
if (mapCameras.empty()) {
453+
VERBOSE("error: no valid cameras (make sure they are in PINHOLE model)");
454+
return false;
455+
}
452456

453457
// read images list
454458
typedef std::map<COLMAP::Image, uint32_t> ImagesMap;
@@ -472,6 +476,7 @@ bool ImportScene(const String& strFolder, Interface& scene)
472476
image.name = OPT::strImageFolder+imageColmap.name;
473477
image.platformID = mapCameras.at(imageColmap.idCamera);
474478
image.cameraID = 0;
479+
image.ID = imageColmap.ID;
475480
Interface::Platform& platform = scene.platforms[image.platformID];
476481
image.poseID = (uint32_t)platform.poses.size();
477482
platform.poses.push_back(pose);

apps/InterfaceOpenMVG/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ else()
1515
endif()
1616
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")
1717

18-
cxx_executable_with_flags_no_pch(InterfaceOpenMVG "Apps" "${cxx_default}" "${LIBS_DEPEND}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
19-
20-
if(OpenMVS_USE_BREAKPAD AND BREAKPAD_FOUND)
21-
target_link_libraries(InterfaceOpenMVG ${BREAKPAD_LIBS})
22-
endif()
18+
cxx_executable_with_flags_no_pch(InterfaceOpenMVG "Apps" "${cxx_default}" "${LIBS_DEPEND};${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
2319

2420
# Install
2521
INSTALL(TARGETS InterfaceOpenMVG

apps/InterfaceOpenMVG/InterfaceOpenMVG.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ int main(int argc, LPCTSTR* argv)
602602
const String srcImage(MAKE_PATH_FULL(WORKING_FOLDER_FULL, pathRoot+image.name));
603603
image.name = MAKE_PATH_FULL(WORKING_FOLDER_FULL, OPT::strOutputImageFolder+image.name);
604604
Util::ensureDirectory(image.name);
605+
image.ID = static_cast<MVS::IIndex>(view.first);
605606
image.platformID = map_intrinsic.at(view.second->id_intrinsic);
606607
MVS::Platform& platform = scene.platforms[image.platformID];
607608
image.cameraID = 0;
@@ -688,6 +689,7 @@ int main(int argc, LPCTSTR* argv)
688689
image.name = imageBAF.name;
689690
Util::ensureUnifySlash(image.name);
690691
image.name = MAKE_PATH_FULL(WORKING_FOLDER_FULL, image.name);
692+
image.ID = imageBAF.id_camera;
691693
image.platformID = imageBAF.id_camera;
692694
MVS::Platform& platform = scene.platforms[image.platformID];
693695
image.cameraID = 0;

apps/InterfacePhotoScan/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ else()
55
endif()
66
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")
77

8-
cxx_executable_with_flags_no_pch(InterfacePhotoScan "Apps" "${cxx_default}" "${LIBS_DEPEND}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
9-
10-
if(OpenMVS_USE_BREAKPAD AND BREAKPAD_FOUND)
11-
target_link_libraries(InterfacePhotoScan ${BREAKPAD_LIBS})
12-
endif()
8+
cxx_executable_with_flags_no_pch(InterfacePhotoScan "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
139

1410
# Install
1511
INSTALL(TARGETS InterfacePhotoScan

0 commit comments

Comments
 (0)