symforce.examples.bundle_adjustment_in_the_large.bundle_adjustment_in_the_large module

Symbolic factor and codegen for the Bundle-Adjustment-in-the-Large problem

snavely_reprojection_residual(cam_T_world, intrinsics, point, pixel, epsilon)[source]

Reprojection residual for the camera model used in the Bundle-Adjustment-in-the-Large dataset, a polynomial camera with two distortion coefficients, cx == cy == 0, and fx == fy

See https://grail.cs.washington.edu/projects/bal/ for more information

Parameters:
  • cam_T_world (Pose3) – The (inverse) pose of the camera

  • intrinsics (Matrix31) – Camera intrinsics (f, k1, k2)

  • point (Matrix31) – The world point to be projected

  • pixel (Matrix21) – The measured pixel in the camera (with (0, 0) == center of image)

  • epsilon (float) –

Returns:

The reprojection residual

Return type:

residual

generate(output_dir)[source]

Generates the snavely_reprojection_factor into C++, as well as a set of Keys to help construct the optimization problem in C++, and puts them into output_dir. This is called by symforce/test/symforce_examples_bundle_adjustment_in_the_large_codegen_test.py to generate the contents of the gen folder inside this directory.

Parameters:

output_dir (Path) –

Return type:

None