code wiki / (root) / nx_register3d.nx

nx_register3d.nx

buildroot/runtime/nx_register3d.nx

11025 B252 linesdepth 2pulls 4 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_register3d.nx -- 3D RIGID REGISTRATION (Horn's absolute-orientation, quaternion method) -- the "align two 3D scans into one frame" capability (cadtwin: fuse multi-view/multi-scan captures of a car into ONE twin; extends nx_pc's 2D ICP to 3D). Given two corresponding 3D point sets P,Q, recovers the rotation R + translation t s.t. R*P + t ~= Q. SVD-FREE: builds Horn's 4x4 symmetric matrix N from the cross-covariance and finds its dominant eigenvector (the optimal rotation quaternion) by POWER ITERATION on a Gershgorin-shifted N (guarantees convergence to the most-positive eigenvalue). All fixed-point Q14, deterministic. Benchmarked by residual RMS. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_vecmath.nx nx_register3d.nx

imports: nx_syscalls.nxnx_vecmath.nx

imported by: nobody (leaf or entry point)

structs

none

consts

11const RG_Q: i64 = 16384

functions

13func rg_isqrt(n: i64) -> i64 { return vm_isqrt(n) }
14func rg_abs(a: i64) -> i64 { if a < 0 { return 0 - a } return a }
called by 1: rg_register
17func rg_quat_to_r(q: *i64, r: *i64) -> i64
called by 1: rg_register
43func rg_apply(r: *i64, tx: i64, ty: i64, tz: i64, px: i64, py: i64, pz: i64, out3: *i64) -> i64
51func rg_register(p: *i64, q: *i64, n: i64, out_r: *i64, out_t: *i64) -> i64
155func rg_centroid(p: *i64, n: i64, c3: *i64) -> i64
165func rg_spread(p: *i64, n: i64) -> i64
called by 1: rg_scale calls 2: sys_mmaprg_centroid
181func rg_scale(p: *i64, q: *i64, n: i64) -> i64
called by 1: rg_register_sim calls 2: rg_spreadrg_isqrt
190func rg_apply_s(r: *i64, s: i64, tx: i64, ty: i64, tz: i64, px: i64, py: i64, pz: i64, out3: *i64) -> i64
206func rg_register_sim(p: *i64, q: *i64, n: i64, out_r: *i64, out_s: *i64, out_t: *i64) -> i64
223func rg_residual_s(p: *i64, q: *i64, n: i64, r: *i64, s: i64, t: *i64) -> i64
239func rg_residual(p: *i64, q: *i64, n: i64, r: *i64, t: *i64) -> i64