code wiki / (root) / nx_image_feature_extract.nx

nx_image_feature_extract.nx

buildroot/runtime/nx_image_feature_extract.nx

7574 B161 linesdepth 8pulls 15 transitivereach 5 importersview sourcekind librarytopic image
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_image.nx nx_aesthetics.nx nx_self_similarity.nx nx_symmetry_group.nx nx_image_feature_extract.nx nx_concept_embedding.nx nx_concept_embedding_test.nx nx_image_feature_extract_test.nx nx_render_target_match.nx nx_render_target_match_test.nx

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

71const NX_IMAGE_FEATURE_LEN: nx_int = 16
74const NX_IMG_FEAT_COLOR_HARMONY: nx_int = 0
75const NX_IMG_FEAT_LIGHTING: nx_int = 1
76const NX_IMG_FEAT_COMPOSITION: nx_int = 2
77const NX_IMG_FEAT_CLARITY: nx_int = 3
78const NX_IMG_FEAT_SHARPNESS: nx_int = 4
79const NX_IMG_FEAT_AESTHETIC_COMPOSITE: nx_int = 5
80const NX_IMG_FEAT_FRACTAL_DIM: nx_int = 6
81const NX_IMG_FEAT_FRACTAL_AESTHETIC: nx_int = 7
82const NX_IMG_FEAT_EDGE_DENSITY: nx_int = 8
83const NX_IMG_FEAT_SYM_COMPOSITE: nx_int = 9
84const NX_IMG_FEAT_SYM_H: nx_int = 10
85const NX_IMG_FEAT_SYM_V: nx_int = 11
86const NX_IMG_FEAT_SYM_DIAG: nx_int = 12
87const NX_IMG_FEAT_SYM_ROT_180: nx_int = 13
88const NX_IMG_FEAT_SYM_N_AXES_PRESENT: nx_int = 14
89const NX_IMG_FEAT_SYM_TRANS_PERIOD: nx_int = 15

functions

102func nx_image_feature_extract(rgb: *Image, gray: *Image, out: *nx_int) -> nx_int
146func nx_image_feature_centroid(vectors: *nx_int, n_vectors: nx_int,
called by 1: main