code wiki / (root) / nx_pnprefine.nx

nx_pnprefine.nx

buildroot/runtime/nx_pnprefine.nx

12301 B302 linesdepth 3pulls 5 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_pnprefine.nx -- Refines camera pose by minimizing reprojection error with a Gauss-Newton linear solve.

dependencies 1 imports · 1 importers

nx_recon3d.nx nx_pnprefine.nx nx_selfcalib.nx

imports: nx_recon3d.nx

imported by: nx_selfcalib.nx

structs

none

consts

18const PNP_DT: i64 = 32 // translation probe step, coord units
19const PNP_DW: i64 = 96 // rotation probe step, Q14 radians (~0.0059 rad)
20const PNP_SQ: i64 = 1024 // fixed-point scale for the linear solve
21const PNP_MAXSTEP: i64 = 8 // clamp a single update to 8 probe steps (a runaway solve cannot bolt)
26const PNP_TARGET_PX: i64 = 4

functions

46func pnp_probe_px(dist: i64, f: i64) -> i64
53func pnp_dist_to(cam: *i64, p3: *i64, n: i64) -> i64
called by 1: pnp_probe_auto calls 1: r3_isqrt
71func pnp_probe_auto(cam: *i64, p3: *i64, n: i64, f: i64) -> i64
75func pnp_resid(cx: i64, cy: i64, cz: i64, basis: *i64, f: i64, p3: *i64, obs: *i64, n: i64, r: *i64) -> i64
96func pnp_rot(basis: *i64, wx: i64, wy: i64, wz: i64) -> i64
127func pnp_solve6(A: *i64, b: *i64, x: *i64) -> i64
called by 1: pnp_step
183func pnp_step(cam: *i64, basis: *i64, f: i64, p3: *i64, obs: *i64, n: i64, w: *i64) -> i64
257func pnp_refine(cam: *i64, basis: *i64, f: i64, p3: *i64, obs: *i64, n: i64, iters: i64, w: *i64) -> i64