ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
bundle_adjustment_test.cc File Reference
Include dependency graph for bundle_adjustment_test.cc:

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)
 

Macro Definition Documentation

◆ CheckConstantCamera

#define CheckConstantCamera (   camera,
  orig_camera 
)
Value:
{ \
const size_t focal_length_idx = \
SimpleRadialCameraModel::focal_length_idxs[0]; \
const size_t extra_param_idx = \
SimpleRadialCameraModel::extra_params_idxs[0]; \
BOOST_CHECK_EQUAL(camera.Params(focal_length_idx), \
orig_camera.Params(focal_length_idx)); \
BOOST_CHECK_EQUAL(camera.Params(extra_param_idx), \
orig_camera.Params(extra_param_idx)); \
}

Definition at line 53 of file bundle_adjustment_test.cc.

◆ CheckConstantCameraRig

#define CheckConstantCameraRig (   camera_rig,
  orig_camera_rig,
  camera_id 
)
Value:
{ \
BOOST_CHECK_EQUAL(camera_rig.RelativeQvec(camera_id), \
orig_camera_rig.RelativeQvec(camera_id)); \
BOOST_CHECK_EQUAL(camera_rig.RelativeTvec(camera_id), \
orig_camera_rig.RelativeTvec(camera_id)); \
}

Definition at line 83 of file bundle_adjustment_test.cc.

◆ CheckConstantImage

#define CheckConstantImage (   image,
  orig_image 
)
Value:
{ \
BOOST_CHECK_EQUAL(image.Qvec(), orig_image.Qvec()); \
BOOST_CHECK_EQUAL(image.Tvec(), orig_image.Tvec()); \
}
std::shared_ptr< core::Tensor > image

Definition at line 71 of file bundle_adjustment_test.cc.

◆ CheckConstantPoint

#define CheckConstantPoint (   point,
  orig_point 
)     { BOOST_CHECK_EQUAL(point.XYZ(), orig_point.XYZ()); }

Definition at line 106 of file bundle_adjustment_test.cc.

◆ CheckConstantXImage

#define CheckConstantXImage (   image,
  orig_image 
)
Value:
{ \
CheckVariableImage(image, orig_image); \
BOOST_CHECK_EQUAL(image.Tvec(0), orig_image.Tvec(0)); \
}

Definition at line 77 of file bundle_adjustment_test.cc.

◆ CheckVariableCamera

#define CheckVariableCamera (   camera,
  orig_camera 
)
Value:
{ \
const size_t focal_length_idx = \
SimpleRadialCameraModel::focal_length_idxs[0]; \
const size_t extra_param_idx = \
SimpleRadialCameraModel::extra_params_idxs[0]; \
BOOST_CHECK_NE(camera.Params(focal_length_idx), \
orig_camera.Params(focal_length_idx)); \
BOOST_CHECK_NE(camera.Params(extra_param_idx), \
orig_camera.Params(extra_param_idx)); \
}

Definition at line 41 of file bundle_adjustment_test.cc.

◆ CheckVariableCameraRig

#define CheckVariableCameraRig (   camera_rig,
  orig_camera_rig,
  camera_id 
)
Value:
{ \
if (camera_rig.RefCameraId() == camera_id) { \
CheckConstantCameraRig(camera_rig, orig_camera_rig, camera_id); \
} else { \
BOOST_CHECK_NE(camera_rig.RelativeQvec(camera_id), \
orig_camera_rig.RelativeQvec(camera_id)); \
BOOST_CHECK_NE(camera_rig.RelativeTvec(camera_id), \
orig_camera_rig.RelativeTvec(camera_id)); \
} \
}

Definition at line 91 of file bundle_adjustment_test.cc.

◆ CheckVariableImage

#define CheckVariableImage (   image,
  orig_image 
)
Value:
{ \
BOOST_CHECK_NE(image.Qvec(), orig_image.Qvec()); \
BOOST_CHECK_NE(image.Tvec(), orig_image.Tvec()); \
}

Definition at line 65 of file bundle_adjustment_test.cc.

◆ CheckVariablePoint

#define CheckVariablePoint (   point,
  orig_point 
)     { BOOST_CHECK_NE(point.XYZ(), orig_point.XYZ()); }

Definition at line 103 of file bundle_adjustment_test.cc.

◆ TEST_NAME

#define TEST_NAME   "optim/bundle_adjustment"

Definition at line 32 of file bundle_adjustment_test.cc.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/14]

◆ BOOST_AUTO_TEST_CASE() [2/14]

◆ BOOST_AUTO_TEST_CASE() [3/14]

◆ BOOST_AUTO_TEST_CASE() [4/14]

◆ BOOST_AUTO_TEST_CASE() [5/14]

◆ BOOST_AUTO_TEST_CASE() [6/14]

◆ BOOST_AUTO_TEST_CASE() [7/14]

◆ BOOST_AUTO_TEST_CASE() [8/14]

◆ BOOST_AUTO_TEST_CASE() [9/14]

◆ BOOST_AUTO_TEST_CASE() [10/14]

◆ BOOST_AUTO_TEST_CASE() [11/14]

◆ BOOST_AUTO_TEST_CASE() [12/14]

◆ BOOST_AUTO_TEST_CASE() [13/14]

◆ BOOST_AUTO_TEST_CASE() [14/14]

◆ GeneratePointCloud()

void GeneratePointCloud ( const size_t  num_points,
const Eigen::Vector3d &  min,
const Eigen::Vector3d &  max,
Reconstruction reconstruction 
)

◆ GenerateReconstruction()