Skip to content

Commit fe8f82a

Browse files
committed
Initial commit
0 parents  commit fe8f82a

511 files changed

Lines changed: 344010 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Custom files
2+
LocalConfig.cmake
3+
4+
# Custom directories
5+
.idea/
6+
.DS_Store
7+
build-debug/
8+
build-release/
9+
data/
10+
doc/_build
11+
12+
# Compiled Object files
13+
*.slo
14+
*.lo
15+
*.o
16+
*.obj
17+
*.pyc
18+
19+
# Precompiled Headers
20+
*.gch
21+
*.pch
22+
23+
# Compiled Dynamic libraries
24+
*.so
25+
*.dylib
26+
*.dll
27+
28+
# Fortran module files
29+
*.mod
30+
31+
# Compiled Static libraries
32+
*.lai
33+
*.la
34+
*.a
35+
*.lib
36+
37+
# Executables
38+
*.exe
39+
*.out
40+
*.app

‎CMakeLists.txt‎

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
3+
project(COLMAP)
4+
add_definitions("-DCOLMAP_VERSION=\"1.0\"")
5+
6+
7+
################################################################################
8+
# Include CMake dependencies
9+
################################################################################
10+
11+
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
12+
13+
include(CheckCXXCompilerFlag)
14+
15+
# Include helper macros and commands, and allow the included file to override
16+
# the CMake policies in this file
17+
include(${CMAKE_SOURCE_DIR}/cmake/cmake_helper.cmake NO_POLICY_SCOPE)
18+
19+
if(EXISTS ${CMAKE_SOURCE_DIR}/LocalConfig.cmake)
20+
include(${CMAKE_SOURCE_DIR}/LocalConfig.cmake)
21+
endif()
22+
23+
24+
################################################################################
25+
# Options
26+
################################################################################
27+
28+
enable_testing()
29+
30+
option(OPENMP_ENABLED "Whether to enable OpenMP" ON)
31+
option(LTO_ENABLED "Whether to enable link-time optimization" ON)
32+
option(CUDA_ENABLED "Whether to enable CUDA, if available" ON)
33+
34+
set(Boost_USE_STATIC_LIBS ON)
35+
36+
37+
################################################################################
38+
# Find packages
39+
################################################################################
40+
41+
if(OPENMP_ENABLED)
42+
find_package(OpenMP QUIET)
43+
endif()
44+
45+
find_package(Boost COMPONENTS
46+
program_options
47+
filesystem
48+
system
49+
chrono
50+
regex
51+
unit_test_framework
52+
REQUIRED)
53+
54+
find_package(Eigen3 REQUIRED)
55+
56+
find_package(FreeImage REQUIRED)
57+
58+
find_package(Glog REQUIRED)
59+
60+
find_package(Ceres REQUIRED)
61+
62+
find_package(OpenGL REQUIRED)
63+
find_package(GLUT REQUIRED)
64+
find_package(Glew REQUIRED)
65+
66+
if(CUDA_ENABLED)
67+
find_package(CUDA QUIET)
68+
endif()
69+
70+
find_package(Qt5Core REQUIRED)
71+
find_package(Qt5OpenGL REQUIRED)
72+
73+
74+
################################################################################
75+
# Compiler specific configuration
76+
################################################################################
77+
78+
if(NOT CMAKE_BUILD_TYPE)
79+
message(STATUS "Build type not specified, using RelWithDebInfo")
80+
set(CMAKE_BUILD_TYPE RelWithDebInfo)
81+
set(IS_DEBUG TRUE)
82+
endif()
83+
84+
if(IS_MSVC)
85+
add_definitions("-DGLOG_NO_ABBREVIATED_SEVERITIES")
86+
add_definitions("-DGL_GLEXT_PROTOTYPES")
87+
else()
88+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
89+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter")
90+
endif()
91+
92+
93+
if(OPENMP_ENABLED AND OPENMP_FOUND)
94+
add_definitions("-DOPENMP_ENABLED")
95+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
96+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
97+
else()
98+
message(STATUS "Disabling OpenMP support")
99+
endif()
100+
101+
if(LTO_ENABLED AND NOT IS_DEBUG AND NOT IS_GNU)
102+
CHECK_CXX_COMPILER_FLAG("-flto" HAS_LTO)
103+
if(HAS_LTO)
104+
message(STATUS "Enabling link-time optimization (-flto)")
105+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
106+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
107+
endif()
108+
else()
109+
message(STATUS "Disabling link-time optimization (-flto)")
110+
endif()
111+
112+
if(CUDA_FOUND)
113+
if(CUDA_ENABLED)
114+
add_definitions("-DCUDA_ENABLED")
115+
message(STATUS "Enabling CUDA support")
116+
else()
117+
set(CUDA_FOUND FALSE)
118+
message(STATUS "Disabling CUDA support")
119+
endif()
120+
else()
121+
set(CUDA_ENABLED FALSE)
122+
message(STATUS "Disabling CUDA support")
123+
endif()
124+
125+
# Qt5 was built with -reduce-relocations.
126+
if(Qt5_POSITION_INDEPENDENT_CODE)
127+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
128+
endif()
129+
130+
131+
################################################################################
132+
# Add sources
133+
################################################################################
134+
135+
add_subdirectory(src)
136+
137+
138+
################################################################################
139+
# Uninstall script
140+
################################################################################
141+
142+
configure_file("${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake"
143+
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
144+
IMMEDIATE @ONLY)
145+
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
146+
set_target_properties(uninstall PROPERTIES FOLDER ${CMAKE_TARGETS_ROOT_FOLDER})

‎LocalConfigExample.cmake‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This is an example of a LocalConfig.cmake file. This is useful on Windows
2+
# platforms, where CMake cannot find many of the libraries automatically and
3+
# it is tedious to set their paths manually in the GUI. To use this file, copy
4+
# and rename it to LocalConfig.cmake
5+
6+
message(STATUS "NOTE: Using LocalConfig.cmake to override CMake settings in the GUI")
7+
8+
set(Ceres_DIR "<ceres-solver-dir>/build/install/CMake" CACHE PATH "" FORCE)
9+
10+
set(EIGEN3_INCLUDE_DIRS "<Eigen-dir>" CACHE PATH "" FORCE)
11+
12+
set(GLOG_INCLUDE_DIR_HINTS "<glog-dir>/src/windows" CACHE PATH "" FORCE)
13+
set(GLOG_LIBRARY_DIR_HINTS "<glog-dir>/x64/Release" CACHE FILEPATH "" FORCE)
14+
15+
set(BOOST_ROOT "<boost-dir>" CACHE PATH "" FORCE)
16+
set(BOOST_LIBRARYDIR "<boost-lib-dir>" CACHE PATH "" FORCE)
17+
18+
set(OPENGL_gl_LIBRARY "opengl32" CACHE STRING "" FORCE)
19+
set(OPENGL_glu_LIBRARY "glu32" CACHE STRING "" FORCE)
20+
21+
set(GLUT_INCLUDE_DIR "<freeglut-dir>/include" CACHE PATH "" FORCE)
22+
set(GLUT_glut_LIBRARY "<freeglut-dir>/lib/freeglut.lib" CACHE FILEPATH "" FORCE)
23+
24+
set(GLEW_INCLUDE_DIR_HINTS "<glew-dir>/include" CACHE PATH "" FORCE)
25+
set(GLEW_LIBRARY_DIR_HINTS "<glew-dir>/lib/Release/x64" CACHE FILEPATH "" FORCE)
26+
27+
set(Qt5_CMAKE_DIR "<Qt-precompiled-dir>/lib/cmake" CACHE PATH "" FORCE)
28+
set(Qt5Core_DIR ${Qt5_CMAKE_DIR}/Qt5Core CACHE PATH "" FORCE)
29+
set(Qt5OpenGL_DIR ${Qt5_CMAKE_DIR}/Qt5OpenGL CACHE PATH "" FORCE)
30+
31+
set(FREEIMAGE_INCLUDE_DIR_HINTS "<FreeImage-dir>/Dist/x64" CACHE PATH "" FORCE)
32+
set(FREEIMAGE_LIBRARY_DIR_HINTS "<FreeImage-dir>/Dist/x64" CACHE PATH "" FORCE)

‎README.md‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
COLMAP
2+
======
3+
4+
COLMAP is a general-purpose Structure-from-Motion pipeline with a graphical and
5+
command-line interface. It offers a wide range of features for reconstruction of
6+
ordered and unordered image collections. The software is licensed under the GNU
7+
General Public License. If you use this project for your research, please cite:
8+
9+
@inproceedings{schoenberger2016sfm,
10+
author = {Sch\"{o}nberger, Johannes Lutz and Frahm, Jan-Michael},
11+
title = {Structure-from-Motion Revisited},
12+
booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
13+
year={2016},
14+
}
15+
16+
17+
Getting Started
18+
---------------
19+
20+
1. Download the pre-built binaries from
21+
https://drive.google.com/folderview?id=0B_oNOlzQHU_Ha2hkdlRQYzQ4RDA#list
22+
or build the library manually as described in the documentation.
23+
2. Watch the short introductory video at
24+
https://www.youtube.com/watch?v=P-EC0DzeVEU or read the tutorial
25+
in the documentation for more details.
26+
27+
28+
Documentation
29+
-------------
30+
31+
The documentation is available at https://colmap.github.io/.
32+
33+
34+
Support
35+
-------
36+
37+
Please, use the GitHub issue tracker at https://github.com/colmap/colmap for bug
38+
reports, questions, suggestions, etc.
39+
40+
41+
Contribution
42+
------------
43+
44+
Contributions (bug reports, bug fixes, improvements, etc.) are very welcome and
45+
should be submitted in the form of new issues and/or pull requests on GitHub.
46+
47+
Please, adhere to the Google coding style guide:
48+
49+
http://google-styleguide.googlecode.com/svn/trunk/cppguide.html
50+
51+
by using the provided ".clang-format" file.
52+
53+
Document functions, methods, classes, etc. with inline documentation strings
54+
describing the API, using the following format:
55+
56+
// Short description.
57+
//
58+
// Longer description with a few sentences and multiple lines.
59+
//
60+
// @param parameter1 Description for parameter 1.
61+
// @param parameter2 Description for parameter 2.
62+
//
63+
// @return Description of optional return value.
64+
65+
Add unit tests for all newly added code and make sure that algorithmic
66+
"improvements" generalize and actually improve the results of the pipeline on a
67+
variety of datasets.
68+
69+
70+
License
71+
-------
72+
73+
The software is licensed under the GNU General Public License v3 or later. If
74+
you are interested in licensing the software for commercial purposes, without
75+
disclosing your modifications, please contact the authors.
76+
77+
78+
COLMAP - Structure-from-Motion.
79+
Copyright (C) 2016 Johannes L. Schoenberger <jsch at cs.unc.edu>
80+
81+
This program is free software: you can redistribute it and/or modify
82+
it under the terms of the GNU General Public License as published by
83+
the Free Software Foundation, either version 3 of the License, or
84+
(at your option) any later version.
85+
86+
This program is distributed in the hope that it will be useful,
87+
but WITHOUT ANY WARRANTY; without even the implied warranty of
88+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89+
GNU General Public License for more details.
90+
91+
You should have received a copy of the GNU General Public License
92+
along with this program. If not, see <http://www.gnu.org/licenses/>.

‎cmake/FindEigen3.cmake‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Sets:
2+
# EIGEN3_FOUND - TRUE if System has Eigen library with correct version.
3+
# EIGEN3_INCLUDE_DIRS - The Eigen include directory.
4+
# EIGEN3_VERSION - Eigen version.
5+
6+
if(NOT Eigen3_FIND_VERSION)
7+
if(NOT Eigen3_FIND_VERSION_MAJOR)
8+
set(Eigen3_FIND_VERSION_MAJOR 2)
9+
endif()
10+
11+
if(NOT Eigen3_FIND_VERSION_MINOR)
12+
set(Eigen3_FIND_VERSION_MINOR 91)
13+
endif()
14+
15+
if(NOT Eigen3_FIND_VERSION_PATCH)
16+
set(Eigen3_FIND_VERSION_PATCH 0)
17+
endif()
18+
19+
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
20+
endif()
21+
22+
macro(_eigen3_check_version)
23+
file(READ "${EIGEN3_INCLUDE_DIRS}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
24+
25+
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
26+
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
27+
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
28+
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
29+
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
30+
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
31+
32+
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
33+
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
34+
set(EIGEN3_VERSION_OK FALSE)
35+
else()
36+
set(EIGEN3_VERSION_OK TRUE)
37+
endif()
38+
39+
if(NOT EIGEN3_VERSION_OK)
40+
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIRS}, "
41+
"but at least version ${Eigen3_FIND_VERSION} is required.")
42+
endif()
43+
endmacro()
44+
45+
if(EIGEN3_INCLUDE_DIRS)
46+
_eigen3_check_version()
47+
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
48+
else()
49+
find_path(EIGEN3_INCLUDE_DIRS
50+
NAMES
51+
signature_of_eigen3_matrix_library
52+
PATHS
53+
/usr/include
54+
/usr/local/include
55+
/opt/include
56+
/opt/local/include
57+
PATH_SUFFIXES
58+
eigen3
59+
eigen
60+
)
61+
62+
if(EIGEN3_INCLUDE_DIRS)
63+
_eigen3_check_version()
64+
endif()
65+
66+
include(FindPackageHandleStandardArgs)
67+
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIRS EIGEN3_VERSION_OK)
68+
69+
mark_as_advanced(EIGEN3_INCLUDE_DIRS)
70+
endif()
71+
72+
if(EIGEN3_FOUND)
73+
message(STATUS "Found Eigen3")
74+
message(STATUS " Includes : ${EIGEN3_INCLUDE_DIRS}")
75+
else()
76+
if(Eigen3_FIND_REQUIRED)
77+
message(FATAL_ERROR "Could not find Eigen3")
78+
endif()
79+
endif()

0 commit comments

Comments
 (0)