code wiki / (root) / nx_bundleadjust.nx

nx_bundleadjust.nx

buildroot/runtime/nx_bundleadjust.nx

6680 B140 linesdepth 4pulls 4 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_bundleadjust.nx -- POSE REFINEMENT / bundle-adjustment (cadtwin P1, the named fix for the fixed-point 8-point estimation-precision limit). Real SfM: the 8-point gives an initial (R,t); nonlinear minimization of REPROJECTION error refines it to metric accuracy. Here: two-view pose-only refinement by COORDINATE DESCENT (greedy hill-climbing) -- no Jacobians/linear-solves (fixed-point-friendly): try +-delta on each of 3 rotation axes + 3 translation components; keep any move that lowers total reprojection error; shrink delta when stuck. Points are implicitly re-triangulated (nx_recon3d midpoint) each cost eval. Composes nx_epose. Deterministic. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_epose.nx nx_bundleadjust.nx nx_bundleadjust_gate.nx

imports: nx_epose.nx

imported by: nx_bundleadjust_gate.nx

structs

none

consts

9const BA_MAGIC_1143: i64 = 1143
10const BA_MAGIC_16344: i64 = 16344
11const BA_MAGIC_16374: i64 = 16374
12const BA_MAGIC_16381: i64 = 16381
13const BA_MAGIC_16383: i64 = 16383
14const BA_MAGIC_16384: i64 = 16384
16const BA_Q: i64 = 16384

functions

18func ba_abs(a: i64) -> i64 { if a < 0 { return 0 - a } return a }
called by 1: ba_cost
24func ba_cost(R: *i64, t: *i64, corr: *i64, n: i64) -> i64
called by 2: ba_refinemain calls 2: ep_build_Eba_abs
44func ba_rotmat(axis: i64, s: i64, c: i64, out: *i64) -> i64
called by 1: ba_rot_apply
53func ba_rot_apply(R: *i64, axis: i64, s: i64, c: i64, Rout: *i64) -> i64
called by 2: ba_refinemain calls 2: ba_rotmatep_matmul
64func ba_refine(R0: *i64, t0: *i64, corr: *i64, n: i64, R: *i64, t: *i64) -> i64