Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

SmartProjectionFactor

Open In Colab

SmartProjectionFactor<CAMERA> is a “smart” factor designed for Structure from Motion (SfM) or visual SLAM problems where both camera poses and calibration are being optimized. It implicitly represents a 3D point landmark that has been observed by multiple cameras.

Key characteristics:

  • Implicit Point: The 3D point is not an explicit variable in the factor graph. Instead, the factor internally triangulates the point based on the current camera estimates whenever needed (e.g., during linearization or error calculation).

  • Marginalization: When linearized (e.g., to a Hessian factor), it effectively marginalizes out the 3D point, creating a dense factor connecting only the cameras that observed the point.

  • CAMERA Template: This template parameter must represent a camera model that includes both pose and calibration (e.g., PinholeCameraCal3_S2, PinholeCameraBundler).

  • Values Requirement: When using this factor, the Values object passed to methods like error or linearize must contain CAMERA objects (not separate Pose3 and Calib objects) associated with the factor’s keys.

  • Configuration: Its behavior (linearization method, handling of degenerate triangulations) is controlled by SmartProjectionParams.

Use Case: Suitable for Bundle Adjustment or SfM problems where calibration parameters are unknown or need refinement along with camera poses. Alternative: If calibration is known and fixed, use SmartProjectionPoseFactor for better efficiency.

If you are using the factor, please cite:

L. Carlone, Z. Kira, C. Beall, V. Indelman, F. Dellaert, “Eliminating conditionally independent sets in factor graphs: a unifying perspective based on smart factors”, Int. Conf. on Robotics and Automation (ICRA), 2014.

Creating and Adding Measurements

  1. Create the factor with a noise model and parameters.

  2. Add measurements (2D points) and the corresponding camera keys one by one or in batches.

Smart factor involves 3 measurements.
SmartFactor: SmartProjectionFactor
linearizationMode: 0
triangulationParameters:
rankTolerance = 1
enableEPI = 0
landmarkDistanceThreshold = -1
dynamicOutlierRejectionThreshold = -1
useLOST = 0
noise model

result:
no point, status = 1

SmartFactorBase, z = 
measurement 0, px = 
150
505
noise model = unit (2) 
measurement 1, px = 
470
495
noise model = unit (2) 
measurement 2, px = 
480
150
noise model = unit (2) 
  keys = { c0 c1 c2 }

Evaluating the Error

The .error(values) method implicitly triangulates the point based on the CAMERA objects in values and computes the sum of squared reprojection errors.

Triangulated point result:
Status.BEHIND_CAMERA

Triangulation failed, error calculation depends on degeneracyMode.