nx_image_feature_extract.nx
buildroot/runtime/nx_image_feature_extract.nx
about
nx_image_feature_extract.nx -- fixed-length feature vector emitter.
Composes existing image-quality detectors (nx_aesthetics +
nx_self_similarity + nx_symmetry_group) into a 16-element Q10
feature vector. Pair with nx_cosine_similarity for image-to-image
comparison, concept-embedding lookup, clustering, recommendation.
FOUNDATION FOR THE "AI GROWS BY INGESTING IMAGE" ROADMAP:
user uploads N images of a new outfit
-> nx_image_feature_extract on each -> N feature vectors
-> average them (centroid) -> "outfit_X" concept embedding
-> store as content-addressed manifest in nishi-library
later prompt mentions "outfit_X"
-> blend stored embedding into prompt embedding (IP-adapter path)
-> render conditioned on the new concept
No LoRA training, no base-model fine-tune. The substrate GROWS.
Idea-provenance (patent-clean):
CLIP image-encoder pattern (Radford 2021)
IP-Adapter (Ye 2023)
Textual Inversion (Gal 2022)
The architecture absorbs the IDEA -- fixed-length embedding per
image -- without copying any third-party code. Today's
features are substrate-native (aesthetics + fractal +
multi-axis symmetry) rather than CLIP-encoder weights.
VECTOR LAYOUT (each Q10):
[ 0] COLOR_HARMONY hue distribution narrowness
[ 1] LIGHTING exposure / range / clipping composite
[ 2] COMPOSITION thirds + symmetry + balance composite
[ 3] CLARITY salience peakedness
[ 4] SHARPNESS mean Sobel magnitude
[ 5] AESTHETIC_COMPOSITE mean of [0..4]
[ 6] FRACTAL_DIM box-counting Q10 of (D-1) for D in [1, 2]
[ 7] FRACTAL_AESTHETIC Spehar 2003 D~1.4 peak-fit
[ 8] EDGE_DENSITY Sobel-thresh fraction
[ 9] SYM_COMPOSITE max across 7 symmetry axes
[10] SYM_H horizontal bilateral
[11] SYM_V vertical bilateral
[12] SYM_DIAG diagonal mirror
dependencies 6 imports · 5 importers
imports: nx_syscalls.nxnx_tier.nxnx_image.nxnx_aesthetics.nxnx_self_similarity.nxnx_symmetry_group.nx
imported by: nx_concept_embedding.nxnx_concept_embedding_test.nxnx_image_feature_extract_test.nxnx_render_target_match.nxnx_render_target_match_test.nx
structs
| none |
consts
| 71 | const NX_IMAGE_FEATURE_LEN: nx_int = 16 |
| 74 | const NX_IMG_FEAT_COLOR_HARMONY: nx_int = 0 |
| 75 | const NX_IMG_FEAT_LIGHTING: nx_int = 1 |
| 76 | const NX_IMG_FEAT_COMPOSITION: nx_int = 2 |
| 77 | const NX_IMG_FEAT_CLARITY: nx_int = 3 |
| 78 | const NX_IMG_FEAT_SHARPNESS: nx_int = 4 |
| 79 | const NX_IMG_FEAT_AESTHETIC_COMPOSITE: nx_int = 5 |
| 80 | const NX_IMG_FEAT_FRACTAL_DIM: nx_int = 6 |
| 81 | const NX_IMG_FEAT_FRACTAL_AESTHETIC: nx_int = 7 |
| 82 | const NX_IMG_FEAT_EDGE_DENSITY: nx_int = 8 |
| 83 | const NX_IMG_FEAT_SYM_COMPOSITE: nx_int = 9 |
| 84 | const NX_IMG_FEAT_SYM_H: nx_int = 10 |
| 85 | const NX_IMG_FEAT_SYM_V: nx_int = 11 |
| 86 | const NX_IMG_FEAT_SYM_DIAG: nx_int = 12 |
| 87 | const NX_IMG_FEAT_SYM_ROT_180: nx_int = 13 |
| 88 | const NX_IMG_FEAT_SYM_N_AXES_PRESENT: nx_int = 14 |
| 89 | const NX_IMG_FEAT_SYM_TRANS_PERIOD: nx_int = 15 |
functions
| 102 | func nx_image_feature_extract(rgb: *Image, gray: *Image, out: *nx_int) -> nx_int called by 1: main calls 4: sys_mmapnx_aesthetics_computenx_self_similarity_computenx_symmetry_compute |
| 146 | func nx_image_feature_centroid(vectors: *nx_int, n_vectors: nx_int, called by 1: main |