MCPcopy Create free account
hub / github.com/colmap/colmap / SetTwoViewGeometryModel

Function SetTwoViewGeometryModel

src/colmap/scene/synthetic.cc:78–99  ·  view source on GitHub ↗

Fill the configuration, essential matrix, and (for perspective pairs) fundamental matrix of a synthetic two-view geometry.

Source from the content-addressed store, hash-verified

76// Fill the configuration, essential matrix, and (for perspective pairs)
77// fundamental matrix of a synthetic two-view geometry.
78void SetTwoViewGeometryModel(const Camera& camera1,
79 const Camera& camera2,
80 const Rigid3d& cam2_from_cam1,
81 TwoViewGeometry* two_view_geometry) {
82 two_view_geometry->E = EssentialMatrixFromPose(cam2_from_cam1);
83 if (camera1.IsSpherical() || camera2.IsSpherical()) {
84 // Omnidirectional cameras (e.g. EQUIRECTANGULAR) have no pinhole
85 // calibration matrix, so the fundamental matrix is undefined; they are
86 // always calibrated and use the bearing-based essential-matrix
87 // configuration.
88 two_view_geometry->config = TwoViewGeometry::CALIBRATED;
89 return;
90 }
91 const bool is_calibrated =
92 camera1.has_prior_focal_length && camera2.has_prior_focal_length;
93 two_view_geometry->config = is_calibrated ? TwoViewGeometry::CALIBRATED
94 : TwoViewGeometry::UNCALIBRATED;
95 two_view_geometry->F =
96 FundamentalFromEssentialMatrix(camera2.CalibrationMatrix(),
97 *two_view_geometry->E,
98 camera1.CalibrationMatrix());
99}
100
101TwoViewGeometry BuildTwoViewGeometry(bool has_relative_pose,
102 const Reconstruction& reconstruction,

Callers 2

BuildTwoViewGeometryFunction · 0.85
SynthesizeChainedMatchesFunction · 0.85

Calls 4

EssentialMatrixFromPoseFunction · 0.85
IsSphericalMethod · 0.80
CalibrationMatrixMethod · 0.80

Tested by

no test coverage detected