nx_imgcorpus.nx
buildroot/runtime/nx_imgcorpus.nx
about
nx_imgcorpus.nx -- DETERMINISTIC SYNTHETIC IMAGE CORPUS for reverse-image measurement.
Every organ that measures the reverse-image stack (the ruler, the engine gate, the CLI self-test)
must agree on what "an image" is, or their numbers are not comparable. One generator, imported
everywhere.
WHY SYNTHETIC: a fixture corpus on disk makes a gate environment-dependent (missing file -> RED for
a reason unrelated to the code) and makes results irreproducible across machines. A procedural
corpus is byte-identical on the laptop, in the buildroot, and on the NAS, forever.
WHY *THIS* CORPUS: a perceptual-hash measurement is only meaningful on images with MULTI-SCALE
structure. Flat images would flatter every hash (nothing to lose under transformation); pure noise
would destroy every hash (nothing to preserve). Real photographs have a large-scale layout, a
mid-scale structure, and fine detail, so each image here is the sum of exactly those three:
coarse -- an 8x8 random control grid, nearest-upscaled: the large-scale light/dark layout
struct -- stripes, checkerboard, concentric rings, or a diagonal ramp, at a per-image period
fine -- low-amplitude deterministic detail
The measured mean pairwise dHash Hamming over the resulting corpus is ~32 of 64 -- exactly the
"unrelated images" separation the shipped nx_phash_test observes on real photographs (33), which is
the evidence that this corpus is a fair stand-in rather than a convenient one.
license_tier: ORIGINAL
dependencies 1 imports · 3 importers
imports: syscalls.nx
imported by: nx_imgbench.nxnx_imgsearch.nxnx_imgsearch_engine_gate.nx
structs
| none |
consts
| none |
functions
| 24 | func ic_rng(s: *i64) -> i64 { let x: i64 = s[0] * 0x5851F42D4C957F2D + 0x14057B7EF767814F; s[0] = x; return x } called by 1: ic_pos |
| 25 | func ic_pos(s: *i64) -> i64 { var r: i64 = ic_rng(s) >> 13; if r < 0 { r = 0 - r } return r } |
| 28 | func nx_imgcorpus_gen(idx: i64, w: i64, h: i64, out: *u8) -> i64 |
| 68 | func nx_imgcorpus_new(idx: i64, w: i64, h: i64) -> *u8 |
| 77 | func nx_imgcorpus_rgb(idx: i64, w: i64, h: i64, gray: *u8) -> *u8 |