![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include "util/testing.h"#include "base/camera_models.h"#include "base/correspondence_graph.h"#include "base/projection.h"#include "optim/bundle_adjustment.h"#include "util/random.h"
Go to the source code of this file.
Macros | |
| #define | TEST_NAME "optim/bundle_adjustment" |
| #define | CheckVariableCamera(camera, orig_camera) |
| #define | CheckConstantCamera(camera, orig_camera) |
| #define | CheckVariableImage(image, orig_image) |
| #define | CheckConstantImage(image, orig_image) |
| #define | CheckConstantXImage(image, orig_image) |
| #define | CheckConstantCameraRig(camera_rig, orig_camera_rig, camera_id) |
| #define | CheckVariableCameraRig(camera_rig, orig_camera_rig, camera_id) |
| #define | CheckVariablePoint(point, orig_point) { BOOST_CHECK_NE(point.XYZ(), orig_point.XYZ()); } |
| #define | CheckConstantPoint(point, orig_point) { BOOST_CHECK_EQUAL(point.XYZ(), orig_point.XYZ()); } |
Functions | |
| void | GeneratePointCloud (const size_t num_points, const Eigen::Vector3d &min, const Eigen::Vector3d &max, Reconstruction *reconstruction) |
| void | GenerateReconstruction (const size_t num_images, const size_t num_points, Reconstruction *reconstruction, CorrespondenceGraph *correspondence_graph) |
| BOOST_AUTO_TEST_CASE (TestConfigNumObservations) | |
| BOOST_AUTO_TEST_CASE (TestTwoView) | |
| BOOST_AUTO_TEST_CASE (TestTwoViewConstantCamera) | |
| BOOST_AUTO_TEST_CASE (TestPartiallyContainedTracks) | |
| BOOST_AUTO_TEST_CASE (TestPartiallyContainedTracksForceToOptimizePoint) | |
| BOOST_AUTO_TEST_CASE (TestConstantPoints) | |
| BOOST_AUTO_TEST_CASE (TestVariableImage) | |
| BOOST_AUTO_TEST_CASE (TestConstantFocalLength) | |
| BOOST_AUTO_TEST_CASE (TestVariablePrincipalPoint) | |
| BOOST_AUTO_TEST_CASE (TestConstantExtraParam) | |
| BOOST_AUTO_TEST_CASE (TestRigTwoView) | |
| BOOST_AUTO_TEST_CASE (TestRigFourView) | |
| BOOST_AUTO_TEST_CASE (TestConstantRigFourView) | |
| BOOST_AUTO_TEST_CASE (TestRigFourViewPartial) | |
| #define CheckConstantCamera | ( | camera, | |
| orig_camera | |||
| ) |
Definition at line 53 of file bundle_adjustment_test.cc.
| #define CheckConstantCameraRig | ( | camera_rig, | |
| orig_camera_rig, | |||
| camera_id | |||
| ) |
Definition at line 83 of file bundle_adjustment_test.cc.
| #define CheckConstantImage | ( | image, | |
| orig_image | |||
| ) |
Definition at line 71 of file bundle_adjustment_test.cc.
| #define CheckConstantPoint | ( | point, | |
| orig_point | |||
| ) | { BOOST_CHECK_EQUAL(point.XYZ(), orig_point.XYZ()); } |
Definition at line 106 of file bundle_adjustment_test.cc.
| #define CheckConstantXImage | ( | image, | |
| orig_image | |||
| ) |
Definition at line 77 of file bundle_adjustment_test.cc.
| #define CheckVariableCamera | ( | camera, | |
| orig_camera | |||
| ) |
Definition at line 41 of file bundle_adjustment_test.cc.
| #define CheckVariableCameraRig | ( | camera_rig, | |
| orig_camera_rig, | |||
| camera_id | |||
| ) |
Definition at line 91 of file bundle_adjustment_test.cc.
| #define CheckVariableImage | ( | image, | |
| orig_image | |||
| ) |
Definition at line 65 of file bundle_adjustment_test.cc.
| #define CheckVariablePoint | ( | point, | |
| orig_point | |||
| ) | { BOOST_CHECK_NE(point.XYZ(), orig_point.XYZ()); } |
Definition at line 103 of file bundle_adjustment_test.cc.
| #define TEST_NAME "optim/bundle_adjustment" |
Definition at line 32 of file bundle_adjustment_test.cc.
| BOOST_AUTO_TEST_CASE | ( | TestConfigNumObservations | ) |
| BOOST_AUTO_TEST_CASE | ( | TestConstantExtraParam | ) |
Definition at line 595 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantImage, CheckConstantXImage, CheckVariablePoint, colmap::SimpleRadialCameraModel::extra_params_idxs, colmap::SimpleRadialCameraModel::focal_length_idxs, GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentOptions::refine_extra_params, colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjustmentConfig::SetConstantTvec(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestConstantFocalLength | ) |
Definition at line 479 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantImage, CheckConstantXImage, CheckVariablePoint, colmap::SimpleRadialCameraModel::extra_params_idxs, colmap::SimpleRadialCameraModel::focal_length_idxs, GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentOptions::refine_focal_length, colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjustmentConfig::SetConstantTvec(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestConstantPoints | ) |
Definition at line 390 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddConstantPoint(), colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantImage, CheckConstantPoint, CheckVariableCamera, CheckVariablePoint, GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestConstantRigFourView | ) |
Definition at line 862 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantCameraRig, CheckVariableCamera, CheckVariableImage, CheckVariablePoint, colmap::ComposeIdentityQuaternion(), GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::RigBundleAdjuster::Options::refine_relative_poses, colmap::Image::SetCameraId(), colmap::RigBundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestPartiallyContainedTracks | ) |
Definition at line 284 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantCamera, CheckConstantImage, CheckConstantPoint, CheckVariableCamera, CheckVariablePoint, colmap::Reconstruction::DeleteObservation(), GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Image::Point2D(), colmap::Point2D::Point3DId(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestPartiallyContainedTracksForceToOptimizePoint | ) |
Definition at line 332 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddConstantPoint(), colmap::BundleAdjustmentConfig::AddImage(), colmap::BundleAdjustmentConfig::AddVariablePoint(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantCamera, CheckConstantImage, CheckConstantPoint, CheckVariableCamera, CheckVariablePoint, colmap::Reconstruction::DeleteObservation(), GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Image::Point2D(), colmap::Point2D::Point3DId(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestRigFourView | ) |
Definition at line 807 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckVariableCamera, CheckVariableCameraRig, CheckVariableImage, CheckVariablePoint, colmap::ComposeIdentityQuaternion(), GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::Image::SetCameraId(), colmap::RigBundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestRigFourViewPartial | ) |
Definition at line 917 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckVariableCamera, CheckVariableCameraRig, CheckVariableImage, CheckVariablePoint, colmap::ComposeIdentityQuaternion(), GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::Image::SetCameraId(), colmap::RigBundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestRigTwoView | ) |
Definition at line 757 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckVariableCamera, CheckVariableCameraRig, CheckVariableImage, CheckVariablePoint, colmap::ComposeIdentityQuaternion(), GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::RigBundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestTwoView | ) |
Definition at line 210 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantImage, CheckConstantXImage, CheckVariableCamera, CheckVariablePoint, GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjustmentConfig::SetConstantTvec(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestTwoViewConstantCamera | ) |
Definition at line 247 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantCamera, CheckConstantImage, CheckVariableCamera, CheckVariablePoint, GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentConfig::SetConstantCamera(), colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestVariableImage | ) |
Definition at line 437 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantImage, CheckConstantXImage, CheckVariableCamera, CheckVariableImage, CheckVariablePoint, GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjustmentConfig::SetConstantTvec(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| BOOST_AUTO_TEST_CASE | ( | TestVariablePrincipalPoint | ) |
Definition at line 531 of file bundle_adjustment_test.cc.
References colmap::BundleAdjustmentConfig::AddImage(), colmap::Camera::Camera(), colmap::Reconstruction::Camera(), CheckConstantImage, CheckConstantXImage, CheckVariablePoint, colmap::SimpleRadialCameraModel::extra_params_idxs, colmap::SimpleRadialCameraModel::focal_length_idxs, GenerateReconstruction(), colmap::Image::Image(), colmap::Reconstruction::Image(), colmap::Reconstruction::Points3D(), colmap::SimpleRadialCameraModel::principal_point_idxs, colmap::BundleAdjustmentOptions::refine_principal_point, colmap::BundleAdjustmentConfig::SetConstantPose(), colmap::BundleAdjustmentConfig::SetConstantTvec(), colmap::BundleAdjuster::Solve(), and colmap::BundleAdjuster::Summary().
| void GeneratePointCloud | ( | const size_t | num_points, |
| const Eigen::Vector3d & | min, | ||
| const Eigen::Vector3d & | max, | ||
| Reconstruction * | reconstruction | ||
| ) |
Definition at line 111 of file bundle_adjustment_test.cc.
References colmap::Reconstruction::AddPoint3D(), and colmap::RandomReal().
Referenced by GenerateReconstruction().
| void GenerateReconstruction | ( | const size_t | num_images, |
| const size_t | num_points, | ||
| Reconstruction * | reconstruction, | ||
| CorrespondenceGraph * | correspondence_graph | ||
| ) |
Definition at line 123 of file bundle_adjustment_test.cc.
References colmap::Reconstruction::AddCamera(), colmap::Reconstruction::AddImage(), colmap::CorrespondenceGraph::AddImage(), colmap::Reconstruction::AddObservation(), colmap::ComposeIdentityQuaternion(), GeneratePointCloud(), colmap::HasPointPositiveDepth(), image, colmap::Reconstruction::Image(), colmap::TrackElement::image_id, colmap::Camera::InitializeWithId(), colmap::SimpleRadialCameraModel::model_id, colmap::TrackElement::point2D_idx, colmap::Reconstruction::Points3D(), colmap::ProjectPointToImage(), colmap::RandomReal(), colmap::Camera::SetCameraId(), colmap::Image::SetPoints2D(), colmap::SetPRNGSeed(), colmap::Reconstruction::SetUp(), and patch::to_string().
Referenced by BOOST_AUTO_TEST_CASE().