Skip to content

Commit

Permalink
Merge branch 'develop' into master (#512)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
cdcseacave authored Jan 5, 2020
1 parent c0b7a6f commit 2289a04
Show file tree
Hide file tree
Showing 33 changed files with 653 additions and 352 deletions.
159 changes: 81 additions & 78 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Specify version format
# specify version format
version: "{build}"

image:
- Visual Studio 2017
- ubuntu1804
- macos

platform:
- x64
Expand All @@ -17,105 +18,107 @@ configuration:
- Debug
- Release

# scripts that are called at very beginning, before repo cloning
init:
#------------------
# Windows 10
#------------------
- cmd: ver
- cmd: cmake --version
- cmd: msbuild /version

#------------------
# Ubuntu 18.04 LTS
#------------------
- sh: lsb_release -a
- sh: cmake --version

# branches to build
branches:
# blacklist
except:
- gh-pages

# scripts that run after cloning repository
install:
for:
-
#------------------
# Windows 10
#------------------
# update vcpkg
- cmd: cd C:\tools\vcpkg
- cmd: git pull
- cmd: .\bootstrap-vcpkg.bat

- cmd: if "%platform%"=="Win32" set VCPKG_ARCH=x86-windows
- cmd: if "%platform%"=="x64" set VCPKG_ARCH=x64-windows

# remove outdated versions
- cmd: vcpkg remove --outdated --recurse

# install required dependencies
- cmd: vcpkg install --recurse --triplet %VCPKG_ARCH% zlib boost-iostreams boost-program-options boost-system boost-serialization eigen3 cgal[core] opencv

# install optional dependencies
- cmd: vcpkg install --recurse --triplet %VCPKG_ARCH% glew glfw3

- cmd: vcpkg integrate install
- cmd: cd "%APPVEYOR_BUILD_FOLDER%"

#------------------
# Ubuntu 18.04 LTS
#------------------
- sh: sudo apt-get update -qq && sudo apt-get install -qq
- sh: sudo apt-get -y install build-essential git mercurial cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libxmu-dev libxi-dev
- sh: sudo apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev
- sh: sudo apt-get -y install libopencv-dev libcgal-dev libcgal-qt5-dev libatlas-base-dev
#- sh: sudo apt-get -y install libsuitesparse-dev libceres-dev
- sh: sudo apt-get -y install freeglut3-dev libglew-dev libglfw3-dev

# preserve contents of selected directories and files across project builds
for:
-
matrix:
only:
- image: Visual Studio 2017
# scripts that are called at very beginning, before repo cloning
init:
- ver
- cmake --version
- msbuild /version
# scripts that run after cloning repository
install:
# update vcpkg
- cd C:\tools\vcpkg
- git pull
- .\bootstrap-vcpkg.bat
- if "%platform%"=="Win32" set VCPKG_ARCH=x86-windows
- if "%platform%"=="x64" set VCPKG_ARCH=x64-windows
# remove outdated versions
- vcpkg remove --outdated --recurse
# install dependencies
- vcpkg install --recurse --triplet %VCPKG_ARCH% zlib boost-iostreams boost-program-options boost-system boost-serialization eigen3 cgal[core] opencv glew glfw3
- vcpkg integrate install
- cd "%APPVEYOR_BUILD_FOLDER%"
# preserve contents of selected directories and files across project builds
cache:
- 'C:\tools\vcpkg\installed'
build_script:
- git clone https://github.com/cdcseacave/VCG.git
- if "%platform%"=="Win32" set CMAKE_GENERATOR=-G"Visual Studio 15 2017"
- if "%platform%"=="x64" set CMAKE_GENERATOR=-G"Visual Studio 15 2017 Win64"
- mkdir bin && cd bin
- cmake %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%Configuration% -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCG_ROOT="%APPVEYOR_BUILD_FOLDER%\VCG" ..
- cmake --build . --target ALL_BUILD --config %Configuration% -- /maxcpucount:4
-
#------------------
# Ubuntu 18.04 LTS
#------------------
matrix:
only:
- image: ubuntu1804
# scripts that are called at very beginning, before repo cloning
init:
- lsb_release -a
- cmake --version
- gcc -v
# scripts that run after cloning repository
install:
- sudo apt-get update -qq && sudo apt-get install -qq
- sudo apt-get -y install build-essential git cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libxmu-dev libxi-dev
- sudo apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev
- sudo apt-get -y install libopencv-dev libcgal-dev libcgal-qt5-dev libatlas-base-dev
- sudo apt-get -y install freeglut3-dev libglew-dev libglfw3-dev
# preserve contents of selected directories and files across project builds
cache:
- '/usr/lib/x86_64-linux-gnu/'

build_script:
# get VCG library
- git clone https://github.com/cdcseacave/VCG.git

#------------------
# Windows 10
#------------------
- cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR=-G"Visual Studio 15 2017"
- cmd: if "%platform%"=="x64" set CMAKE_GENERATOR=-G"Visual Studio 15 2017 Win64"
- cmd: mkdir bin && cd bin
- cmd: cmake %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%Configuration% -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCG_ROOT="%APPVEYOR_BUILD_FOLDER%\VCG" ..
- cmd: cmake --build . --target ALL_BUILD --config %Configuration% -- /maxcpucount:4

build_script:
- git clone https://github.com/cdcseacave/VCG.git
- git clone --single-branch --branch 3.2 https://gitlab.com/libeigen/eigen.git
- mkdir eigen_build && cd eigen_build
- cmake . ../eigen
- make && sudo make install
- cd ..
- mkdir bin && cd bin
- cmake -DCMAKE_BUILD_TYPE=$Configuration -DVCG_ROOT="$APPVEYOR_BUILD_FOLDER/VCG" ..
- make
-
#------------------
# Ubuntu 18.04 LTS
# MacOS
#------------------
- sh: hg clone https://bitbucket.org/eigen/eigen#3.2
- sh: mkdir eigen_build && cd eigen_build
- sh: cmake . ../eigen
- sh: make && sudo make install
- sh: cd ..
- sh: mkdir bin && cd bin
- sh: cmake -DCMAKE_BUILD_TYPE=$Configuration -DVCG_ROOT="$APPVEYOR_BUILD_FOLDER/VCG" ..
- sh: make

test_script:
#- cmd: ctest --build-config %Configuration% --parallel 4 --output-on-failure
#- sh: ctest -j4
matrix:
only:
- image: macos
# scripts that are called at very beginning, before repo cloning
init:
- system_profiler SPSoftwareDataType
- cmake --version
- gcc -v
# scripts that run after cloning repository
install:
- brew update
- printf "#%s/bin/bash\nbrew install libomp boost eigen opencv cgal glew glfw3\nexit 0\n" "!" > install.sh
- chmod +x install.sh
- ./install.sh
# preserve contents of selected directories and files across project builds
cache:
- '/usr/local/Cellar/'
build_script:
- git clone https://github.com/cdcseacave/VCG.git
- mkdir bin && cd bin
- cmake -DCMAKE_BUILD_TYPE=$CONFIGURATION -DVCG_ROOT="$APPVEYOR_BUILD_FOLDER/VCG" ..
- make

on_success:
- cmd: 7z a OpenMVS_x64.7z "C:\projects\openmvs\bin\bin\vc15\x64\%Configuration%\*.exe" "C:\projects\openmvs\bin\bin\vc15\x64\%Configuration%\*.dll"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ CMakeSettings.json
.vs/
.idea/
.vscode/
out/
bin/
binaries/
12 changes: 7 additions & 5 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Dependencies
------------

*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.
* [Eigen](http://eigen.tuxfamily.org) version 3.2 or higher
* [Eigen](http://eigen.tuxfamily.org) version 3.2 (or higher on Windows only)
* [OpenCV](http://opencv.org) version 2.4 or higher
* [Ceres](http://ceres-solver.org) version 1.10 or higher
* [CGAL](http://www.cgal.org) version 4.2 or higher
Expand Down Expand Up @@ -60,11 +60,11 @@ Linux compilation
```
#Prepare and empty machine for building:
sudo apt-get update -qq && sudo apt-get install -qq
sudo apt-get -y install git mercurial cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev
sudo apt-get -y install git cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev
main_path=`pwd`
#Eigen (Required)
hg clone https://bitbucket.org/eigen/eigen#3.2
git clone https://gitlab.com/libeigen/eigen.git --branch 3.2
mkdir eigen_build && cd eigen_build
cmake . ../eigen
make && sudo make install
Expand Down Expand Up @@ -114,10 +114,12 @@ Install dependencies, run CMake and make.
```
#Install dependencies
brew update
brew tap homebrew/science
brew install boost eigen opencv cgal ceres-solver
brew install boost eigen opencv cgal
main_path=`pwd`
#GLFW3 (Optional)
brew install glew glfw3
#VCGLib (Required)
git clone https://github.com/cdcseacave/VCG.git vcglib
Expand Down
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
# ${OpenMVS_BINARY_DIR}.
PROJECT(OpenMVS)

set(OpenMVS_MAJOR_VERSION 0)
set(OpenMVS_MINOR_VERSION 7)
set(OpenMVS_PATCH_VERSION 0)
set(OpenMVS_MAJOR_VERSION 1)
set(OpenMVS_MINOR_VERSION 0)
set(OpenMVS_PATCH_VERSION 1)
set(OpenMVS_VERSION ${OpenMVS_MAJOR_VERSION}.${OpenMVS_MINOR_VERSION}.${OpenMVS_PATCH_VERSION})

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

# Find required packages
SET(OpenMVS_EXTRA_LIBS "")
if(OpenMVS_USE_OPENMP)
SET(OpenMP_LIBS "")
FIND_PACKAGE(OpenMP)
if(OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ADD_DEFINITIONS(-D_USE_OPENMP)
SET(_USE_OPENMP TRUE)
#cmake only check for separate OpenMP library on AppleClang 7+
#https://github.com/Kitware/CMake/blob/42212f7539040139ecec092547b7d58ef12a4d72/Modules/FindOpenMP.cmake#L252
if (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
SET(OpenMP_LIBS ${OpenMP_libomp_LIBRARY})
LIST(APPEND OpenMVS_EXTRA_LIBS ${OpenMP_LIBS})
endif()
else()
message("-- Can't find OpenMP. Continuing without it.")
endif()
Expand Down Expand Up @@ -97,6 +105,7 @@ if(OpenMVS_USE_BREAKPAD)
INCLUDE_DIRECTORIES(${BREAKPAD_INCLUDE_DIRS})
ADD_DEFINITIONS(${BREAKPAD_DEFINITIONS} -D_USE_BREAKPAD)
SET(_USE_BREAKPAD TRUE)
LIST(APPEND OpenMVS_EXTRA_LIBS ${BREAKPAD_LIBS})
else()
MESSAGE("-- Can't find BreakPad. Continuing without it.")
endif()
Expand Down
6 changes: 1 addition & 5 deletions apps/DensifyPointCloud/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ else()
endif()
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")

cxx_executable_with_flags_no_pch(DensifyPointCloud "Apps" "${cxx_default}" "MVS" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

if(OpenMVS_USE_BREAKPAD AND BREAKPAD_FOUND)
target_link_libraries(DensifyPointCloud ${BREAKPAD_LIBS})
endif()
cxx_executable_with_flags_no_pch(DensifyPointCloud "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

# Install
INSTALL(TARGETS DensifyPointCloud
Expand Down
8 changes: 2 additions & 6 deletions apps/InterfaceCOLMAP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ else()
endif()
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")

cxx_executable_with_flags_no_pch(InterfaceCOLMAP "Apps" "${cxx_default}" "MVS" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

if(3Dnovator_USE_BREAKPAD AND BREAKPAD_FOUND)
target_link_libraries(InterfaceCOLMAP ${BREAKPAD_LIBS})
endif()
cxx_executable_with_flags_no_pch(InterfaceCOLMAP "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

# Install
INSTALL(TARGETS InterfaceCOLMAP
EXPORT 3DnovatorTargets
EXPORT OpenMVSTargets
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin)
5 changes: 5 additions & 0 deletions apps/InterfaceCOLMAP/InterfaceCOLMAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ bool ImportScene(const String& strFolder, Interface& scene)
scene.platforms.push_back(platform);
}
}
if (mapCameras.empty()) {
VERBOSE("error: no valid cameras (make sure they are in PINHOLE model)");
return false;
}

// read images list
typedef std::map<COLMAP::Image, uint32_t> ImagesMap;
Expand All @@ -472,6 +476,7 @@ bool ImportScene(const String& strFolder, Interface& scene)
image.name = OPT::strImageFolder+imageColmap.name;
image.platformID = mapCameras.at(imageColmap.idCamera);
image.cameraID = 0;
image.ID = imageColmap.ID;
Interface::Platform& platform = scene.platforms[image.platformID];
image.poseID = (uint32_t)platform.poses.size();
platform.poses.push_back(pose);
Expand Down
6 changes: 1 addition & 5 deletions apps/InterfaceOpenMVG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ else()
endif()
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")

cxx_executable_with_flags_no_pch(InterfaceOpenMVG "Apps" "${cxx_default}" "${LIBS_DEPEND}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

if(OpenMVS_USE_BREAKPAD AND BREAKPAD_FOUND)
target_link_libraries(InterfaceOpenMVG ${BREAKPAD_LIBS})
endif()
cxx_executable_with_flags_no_pch(InterfaceOpenMVG "Apps" "${cxx_default}" "${LIBS_DEPEND};${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

# Install
INSTALL(TARGETS InterfaceOpenMVG
Expand Down
2 changes: 2 additions & 0 deletions apps/InterfaceOpenMVG/InterfaceOpenMVG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ int main(int argc, LPCTSTR* argv)
const String srcImage(MAKE_PATH_FULL(WORKING_FOLDER_FULL, pathRoot+image.name));
image.name = MAKE_PATH_FULL(WORKING_FOLDER_FULL, OPT::strOutputImageFolder+image.name);
Util::ensureDirectory(image.name);
image.ID = static_cast<MVS::IIndex>(view.first);
image.platformID = map_intrinsic.at(view.second->id_intrinsic);
MVS::Platform& platform = scene.platforms[image.platformID];
image.cameraID = 0;
Expand Down Expand Up @@ -688,6 +689,7 @@ int main(int argc, LPCTSTR* argv)
image.name = imageBAF.name;
Util::ensureUnifySlash(image.name);
image.name = MAKE_PATH_FULL(WORKING_FOLDER_FULL, image.name);
image.ID = imageBAF.id_camera;
image.platformID = imageBAF.id_camera;
MVS::Platform& platform = scene.platforms[image.platformID];
image.cameraID = 0;
Expand Down
6 changes: 1 addition & 5 deletions apps/InterfacePhotoScan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ else()
endif()
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")

cxx_executable_with_flags_no_pch(InterfacePhotoScan "Apps" "${cxx_default}" "${LIBS_DEPEND}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

if(OpenMVS_USE_BREAKPAD AND BREAKPAD_FOUND)
target_link_libraries(InterfacePhotoScan ${BREAKPAD_LIBS})
endif()
cxx_executable_with_flags_no_pch(InterfacePhotoScan "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

# Install
INSTALL(TARGETS InterfacePhotoScan
Expand Down
1 change: 1 addition & 0 deletions apps/InterfacePhotoScan/InterfacePhotoScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ bool ParseImageListXML(MVS::Scene& scene, PlatformDistCoeffs& pltDistCoeffs, siz
imageData.name = MAKE_PATH_FULL(strPath, imageData.name);
imageData.platformID = camera->UnsignedAttribute(_T("sensor_id"));
imageData.cameraID = 0; // only one camera per platform supported by this format
imageData.ID = ID;
if (!camera->BoolAttribute(_T("enabled"))) {
imageData.poseID = NO_ID;
DEBUG_EXTRA("warning: uncalibrated image '%s'", name);
Expand Down
6 changes: 1 addition & 5 deletions apps/InterfaceVisualSFM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ else()
endif()
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")

cxx_executable_with_flags_no_pch(InterfaceVisualSFM "Apps" "${cxx_default}" "MVS" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

if(OpenMVS_USE_BREAKPAD AND BREAKPAD_FOUND)
target_link_libraries(InterfaceVisualSFM ${BREAKPAD_LIBS})
endif()
cxx_executable_with_flags_no_pch(InterfaceVisualSFM "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

# Install
INSTALL(TARGETS InterfaceVisualSFM
Expand Down
Loading

0 comments on commit 2289a04

Please sign in to comment.