Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Visual

factors::visual — everything that goes through a camera.

All projection factors share a smooth cheirality penalty. A landmark behind the camera cannot be projected, but returning zero would make an invalid configuration look optimal, so they emit

with , — large enough to dominate any plausible in-image residual, small enough not to ill-condition the normal equations, and carrying a gradient that pushes the point back in front.

Two derivatives recur throughout. For a world-to-camera pose acting directly, :

For an inverted pose, , a right perturbation gives :

Both come from SE3::act, which reports them itself.


ProjectionFactor<CAM, OP>

Monocular reprojection over observations of one pose, generic over the camera model and over which blocks are optimized.

Blocks , selected at compile time by OP: OptimizationConfig — BundleAdjustment, SelfCalibration, OnlyPose, OnlyLandmarks, OnlyIntrinsics, PoseAndIntrinsics, LandmarksAndIntrinsics. Unused blocks cost nothing; the const-generic flags remove their columns entirely.

Residual , Jacobian .

Error

Jacobian

The camera model supplies (2×3) and (2×) analytically. For a pinhole model,

Nine models are available (Pinhole, RadTan, KannalaBrandt, DoubleSphere, Eucm, Ucm, Fov, …).


ExtrinsicProjectionFactor<CAM>

Reprojection with the camera-to-body transform as a variable. On a real rig the extrinsics are the least trustworthy part of the setup and are shared by every observation from that camera, so they belong in the graph where many observations determine them.

Blocks — residual 2, Jacobian . Both poses read the way a calibration file does: body-in-world, camera-in-body.

Error

Jacobian

With (2×6),

The factor is , which compose reports directly. The extrinsics block gets unchanged because .


TimeOffsetProjectionFactor<CAM>

Reprojection with the camera-to-IMU clock offset as a variable. The two clocks differ by a constant lag ; unmodelled it is indistinguishable from an extrinsic rotation error at constant angular rate, and 20 ms at 1 m/s is 2 cm of position error.

Blocks — residual 2, Jacobian .

Error

A first-order expansion of the state to the exposure instant,

then and the same reprojection as above. The state is SE23 because it already carries ; is the bias-corrected gyro sample, a measurement, since the graph has no angular rate to estimate.

Jacobian

The SE23 tangent pushes to the exposure pose’s SE(3) tangent as

and the offset column is the exposure pose’s own tangent velocity,

Both are then chained with exactly as above. Note the offset column vanishes when and : a stationary platform cannot observe , which the tests assert directly.


StereoFactor

Rectified stereo, so disparity fixes depth in a single observation.

Blocks — residual 3, Jacobian .

Error

Jacobian

chained with and . Calibration is fixed at construction — this is the one camera factor not generic over CameraModel.


InverseDepthFactor<CAM>

A landmark parameterized in its anchor camera by pixel and inverse depth , which stays well-conditioned for distant, low-parallax points where a Euclidean 3D point blows up.

Blocks — residual 2, Jacobian .

The anchor block’s Jacobian carries , which is what makes the parameterization behave as : the inverse depth stays finite and its derivative bounded where would not.


SmartProjectionFactor<CAM>

Structure-less: connects poses to a landmark that is never a variable. The point is re-triangulated by DLT from the current poses at every linearization, then eliminated exactly by the implicit Schur complement.

Blocks poses — residual , Jacobian . Whitens internally; register with NoiseModel::null().

Jacobian

Writing (2×6) and (2×3),

The triangulated point satisfies the first-order optimality condition , so this dense is the total derivative of the re-triangulated residual, and

is exactly the Schur complement. Degenerate geometry (pure rotation, rank-deficient DLT) returns a bounded penalty; status() reports which.


EssentialMatrixFactor / EssentialMatrixConstraint

2D–2D epipolar geometry over a relative pose, for initialization and loop-closure verification before any landmark exists. Points are normalized camera coordinates.

The direction normalization contributes , which is rank 2 — both factors are scale-free by construction. Only the translation direction is observable from epipolar geometry, so a graph containing only these has a one-dimensional null space; the constraint’s six rows are effectively rank 5.


DepthFactor<ONESIDED> / HomogeneousPointFactor

Both act on a homogeneous 4D landmark , the parameterization that keeps points at infinity representable.

DepthFactor — an RGB-D-style depth reading

Blocks — residual 1, Jacobian .

With ONESIDED = true (OneSidedDepthFactor) both residual and Jacobian are zeroed when , penalizing only points that come too close — a free-space constraint rather than a depth measurement.

HomogeneousPointFactor — a unary prior on the dehomogenized position

Blocks — residual 3, Jacobian .

Both whiten internally.