code wiki / (root) / nx_cam.nx

nx_cam.nx

buildroot/runtime/nx_cam.nx

7131 B202 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind librarytopic cam
docsdependenciesstructsconstsfunctions

about

nx_cam.nx -- camera + homography primitives (V9). Pinhole camera model (Hartley+Zisserman 2004 chapter 6) and 3x3 planar homography arithmetic. Pure i64 with Q14 homography coefficients. Closes the geometry stack for 3D reasoning. What this unlocks: + perspective correction (warp tilted photo of a book to rectangular) + image stitching (homography between overlapping photos) + augmented reality (project 3D world points onto image plane) + planar object recognition (rectify then match) + camera calibration scaffolding Homography is a 9-element i64 array in Q14 row-major: [H0 H1 H2] [H3 H4 H5] [H6 H7 H8] genealogy_id: hartley_zisserman_2004 + faugeras_1993_3d_vision lineage_id: pinhole_projection + planar_homography

dependencies 2 imports · 1 importers

syscalls.nx nx_image.nx nx_cam.nx nx_cam_test.nx

imports: syscalls.nxnx_image.nx

imported by: nx_cam_test.nx

structs

none

consts

30const NX_MAGIC_1024: i64 = 1024
32const NX_CAM_Q: i64 = 16384 // Q14

functions

42func nx_cam_pinhole_project(X: i64, Y: i64, Z: i64,
called by 1: main
54func nx_cam_homography_identity(H: *i64) -> i64
called by 1: main
64func nx_cam_homography_translate(H: *i64, tx: i64, ty: i64) -> i64
called by 1: main
74func nx_cam_homography_scale(H: *i64, sx_q: i64, sy_q: i64) -> i64
called by 1: main
85func nx_cam_homography_rotate(H: *i64, theta_deg: i64) -> i64
called by 1: main
133func nx_cam_homography_apply(H: *i64, u: i64, v: i64,
150func nx_cam_warp_image(src: *Image, H_inv: *i64) -> *Image
185func nx_cam_homography_compose(A: *i64, B: *i64, C: *i64) -> i64
called by 1: main