Skip to content

Commit

Permalink
Move related code under new camera folder (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojnnes committed Jul 2, 2023
1 parent 91068ea commit 3c38248
Show file tree
Hide file tree
Showing 35 changed files with 78 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/build-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
CCACHE_BASEDIR: $(Build.SourcesDirectory)
CCACHE_VERSION: 1
${{ if eq(parameters.asanEnabled, false) }}:
ctestExclusions: "(mvs/gpu_mat_test)"
ctestExclusions: "(mvs/colmap_mvs_gpu_mat_test)"
${{ if eq(parameters.asanEnabled, true) }}:
ctestExclusions: "(feature/sift_test)|(util/opengl_utils_test)|(mvs/gpu_mat_test)"
ctestExclusions: "(feature/colmap_feature_sift_test)|(util/colmap_util_opengl_utils_test)|(mvs/colmap_mvs_gpu_mat_test)"
steps:
- script: |
sudo apt-get update && sudo apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- pwsh: |
$(Build.BinariesDirectory)/vcpkg/vcpkg.exe integrate install
ctest -E "(feature/sift_test)|(util/opengl_utils_test)|(mvs/gpu_mat_test)"
ctest -E "(feature/colmap_feature_sift_test)|(util/colmap_util_opengl_utils_test)|(mvs/colmap_mvs_gpu_mat_test)"
$tests_pass=$LastExitCode
if ($tests_pass -ne 0) {
echo "`n`n`nTests failed, rerunning with verbose output"
Expand Down
6 changes: 4 additions & 2 deletions cmake/CMakeHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ macro(COLMAP_ADD_EXECUTABLE TARGET_NAME)
endmacro(COLMAP_ADD_EXECUTABLE)

# Wrapper for test executables.
macro(COLMAP_ADD_TEST TARGET_NAME)
macro(COLMAP_ADD_TEST TEST_NAME)
if(TESTS_ENABLED)
# ${ARGN} will store the list of source files passed to this function.
set(TARGET_NAME "colmap_${FOLDER_NAME}_${TEST_NAME}")
add_executable(${TARGET_NAME} ${ARGN})
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER
${COLMAP_TARGETS_ROOT_FOLDER}/${FOLDER_NAME})
Expand All @@ -174,9 +175,10 @@ macro(COLMAP_ADD_TEST TARGET_NAME)
endmacro(COLMAP_ADD_TEST)

# Wrapper for CUDA test executables.
macro(COLMAP_ADD_CUDA_TEST TARGET_NAME)
macro(COLMAP_ADD_CUDA_TEST TEST_NAME)
if(TESTS_ENABLED)
# ${ARGN} will store the list of source files passed to this function.
set(TARGET_NAME "colmap_${FOLDER_NAME}_${TEST_NAME}")
add_executable(${TARGET_NAME} ${ARGN})
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER
${COLMAP_TARGETS_ROOT_FOLDER}/${FOLDER_NAME})
Expand Down
1 change: 1 addition & 0 deletions src/colmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ elseif(IS_GNU OR IS_CLANG)
endif()

add_subdirectory(base)
add_subdirectory(camera)
add_subdirectory(controllers)
add_subdirectory(estimators)
add_subdirectory(exe)
Expand Down
4 changes: 0 additions & 4 deletions src/colmap/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ set(FOLDER_NAME "base")

COLMAP_ADD_SOURCES(
camera.h camera.cc
camera_database.h camera_database.cc
camera_models.h camera_models.cc
camera_rig.h camera_rig.cc
correspondence_graph.h correspondence_graph.cc
database.h database.cc
Expand All @@ -58,8 +56,6 @@ COLMAP_ADD_SOURCES(
visibility_pyramid.h visibility_pyramid.cc
)

COLMAP_ADD_TEST(camera_database_test camera_database_test.cc)
COLMAP_ADD_TEST(camera_models_test camera_models_test.cc)
COLMAP_ADD_TEST(camera_rig_test camera_rig_test.cc)
COLMAP_ADD_TEST(camera_test camera_test.cc)
COLMAP_ADD_TEST(correspondence_graph_test correspondence_graph_test.cc)
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/base/camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "colmap/base/camera.h"

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"
#include "colmap/util/logging.h"
#include "colmap/util/misc.h"

Expand Down
2 changes: 1 addition & 1 deletion src/colmap/base/camera_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define TEST_NAME "base/camera"
#include "colmap/base/camera.h"

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"
#include "colmap/util/testing.h"

using namespace colmap;
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/base/cost_functions_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define TEST_NAME "base/cost_functions"
#include "colmap/base/cost_functions.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/pose.h"
#include "colmap/camera/models.h"
#include "colmap/util/testing.h"

using namespace colmap;
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/base/database_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#define COLMAP_SRC_BASE_DATABASE_CACHE_H_

#include "colmap/base/camera.h"
#include "colmap/base/camera_models.h"
#include "colmap/base/correspondence_graph.h"
#include "colmap/base/database.h"
#include "colmap/base/image.h"
#include "colmap/camera/models.h"
#include "colmap/util/types.h"

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/base/projection_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define TEST_NAME "base/projection"
#include "colmap/base/projection.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/pose.h"
#include "colmap/camera/models.h"
#include "colmap/util/math.h"
#include "colmap/util/testing.h"

Expand Down
2 changes: 1 addition & 1 deletion src/colmap/base/reconstruction_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#define TEST_NAME "base/reconstruction"
#include "colmap/base/reconstruction.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/correspondence_graph.h"
#include "colmap/base/pose.h"
#include "colmap/base/similarity_transform.h"
#include "colmap/camera/models.h"
#include "colmap/util/testing.h"

using namespace colmap;
Expand Down
41 changes: 41 additions & 0 deletions src/colmap/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2023, ETH Zurich and UNC Chapel Hill.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of
# its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

set(FOLDER_NAME "camera")

COLMAP_ADD_SOURCES(
database.h database.cc
models.h models.cc
specs.h specs.cc
)

COLMAP_ADD_TEST(database_test database_test.cc)
COLMAP_ADD_TEST(models_test models_test.cc)
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
//
// Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

#include "colmap/base/camera_database.h"

#include "colmap/camera/database.h"
#include "colmap/util/string.h"

namespace colmap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#ifndef COLMAP_SRC_BASE_CAMERA_DATABASE_H_
#define COLMAP_SRC_BASE_CAMERA_DATABASE_H_

#include "colmap/util/camera_specs.h"
#include "colmap/camera/specs.h"

#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
// Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

#define TEST_NAME "base/camera_database"
#include "colmap/base/camera_database.h"

#include "colmap/camera/database.h"
#include "colmap/util/testing.h"

using namespace colmap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"

#include <unordered_map>

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

#define TEST_NAME "base/camera_models"
#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"

#include "colmap/util/testing.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

#include "colmap/util/camera_specs.h"
#include "colmap/camera/specs.h"

namespace colmap {

Expand Down
6 changes: 3 additions & 3 deletions src/colmap/util/camera_specs.h → src/colmap/camera/specs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
//
// Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

#ifndef COLMAP_SRC_UTIL_CAMERA_SPECS_H_
#define COLMAP_SRC_UTIL_CAMERA_SPECS_H_
#ifndef COLMAP_SRC_CAMERA_SPECS_H_
#define COLMAP_SRC_CAMERA_SPECS_H_

#include <string>
#include <unordered_map>
Expand All @@ -46,4 +46,4 @@ camera_specs_t InitializeCameraSpecs();

} // namespace colmap

#endif // COLMAP_SRC_UTIL_CAMERA_SPECS_H_
#endif // COLMAP_SRC_CAMERA_SPECS_H_
2 changes: 1 addition & 1 deletion src/colmap/estimators/essential_matrix_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#define TEST_NAME "estimators/essential_matrix"
#include "colmap/base/essential_matrix.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/pose.h"
#include "colmap/base/projection.h"
#include "colmap/camera/models.h"
#include "colmap/estimators/essential_matrix.h"
#include "colmap/optim/ransac.h"
#include "colmap/util/random.h"
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/estimators/pose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

#include "colmap/estimators/pose.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/cost_functions.h"
#include "colmap/base/essential_matrix.h"
#include "colmap/base/pose.h"
#include "colmap/camera/models.h"
#include "colmap/estimators/absolute_pose.h"
#include "colmap/estimators/essential_matrix.h"
#include "colmap/optim/bundle_adjustment.h"
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/estimators/pose.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define COLMAP_SRC_ESTIMATORS_POSE_H_

#include "colmap/base/camera.h"
#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"
#include "colmap/optim/loransac.h"
#include "colmap/util/logging.h"
#include "colmap/util/threading.h"
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/exe/feature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "colmap/exe/feature.h"

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"
#include "colmap/exe/gui.h"
#include "colmap/feature/extraction.h"
#include "colmap/feature/matching.h"
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#
# Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

set(FOLDER_NAME "base")
set(FOLDER_NAME "image")

COLMAP_ADD_SOURCES(
bitmap.h bitmap.cc
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/image/bitmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "colmap/image/bitmap.h"

#include "colmap/base/camera_database.h"
#include "colmap/camera/database.h"
#include "colmap/util/logging.h"
#include "colmap/util/math.h"
#include "colmap/util/misc.h"
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/image/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "colmap/image/reader.h"

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"
#include "colmap/util/misc.h"

namespace colmap {
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/image/undistortion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

#include "colmap/image/undistortion.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/pose.h"
#include "colmap/camera/models.h"
#include "colmap/image/warp.h"
#include "colmap/util/misc.h"

Expand Down
2 changes: 1 addition & 1 deletion src/colmap/mvs/model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

#include "colmap/mvs/model.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/pose.h"
#include "colmap/base/projection.h"
#include "colmap/base/reconstruction.h"
#include "colmap/base/triangulation.h"
#include "colmap/camera/models.h"
#include "colmap/util/misc.h"

namespace colmap {
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/optim/bundle_adjustment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include <omp.h>
#endif

#include "colmap/base/camera_models.h"
#include "colmap/base/cost_functions.h"
#include "colmap/base/projection.h"
#include "colmap/camera/models.h"
#include "colmap/util/misc.h"
#include "colmap/util/threading.h"
#include "colmap/util/timer.h"
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/optim/bundle_adjustment_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#define TEST_NAME "optim/bundle_adjustment"
#include "colmap/optim/bundle_adjustment.h"

#include "colmap/base/camera_models.h"
#include "colmap/base/correspondence_graph.h"
#include "colmap/base/projection.h"
#include "colmap/camera/models.h"
#include "colmap/util/random.h"
#include "colmap/util/testing.h"

Expand Down
2 changes: 1 addition & 1 deletion src/colmap/ui/database_management_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "colmap/ui/database_management_widget.h"

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"

namespace colmap {

Expand Down
2 changes: 1 addition & 1 deletion src/colmap/ui/feature_extraction_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "colmap/ui/feature_extraction_widget.h"

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"
#include "colmap/feature/extraction.h"
#include "colmap/ui/options_widget.h"
#include "colmap/ui/qt_utils.h"
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/ui/qt_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "colmap/ui/qt_utils.h"

#include "colmap/base/camera_models.h"
#include "colmap/camera/models.h"
#include "colmap/util/misc.h"

namespace colmap {
Expand Down
1 change: 0 additions & 1 deletion src/colmap/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ set(FOLDER_NAME "util")

COLMAP_ADD_SOURCES(
cache.h
camera_specs.h camera_specs.cc
logging.h logging.cc
math.h math.cc
matrix.h
Expand Down

0 comments on commit 3c38248

Please sign in to comment.