Expand description
Local CBIR proxy embeddings — specialized_libs::computer_vision::embeddings.
Modules§
- color_
hist_ embed - Fixed-size RGB colour histogram → L2-normalized
f32embedding (caller buffer). - embed_
distance - Distances for local visual embedding proxies (hash Hamming + float cosine).
- perceptual_
hash_ u64 - aHash / dHash perceptual hashes over a gray buffer.
Constants§
- AHASH_
SIDE - Side length for aHash (8×8 → 64 bits).
- COLOR_
HIST_ BINS - Bins per RGB channel for the joint histogram.
- COLOR_
HIST_ EMBED_ DIM - Embedding dimension: joint 4×4×4 RGB histogram (64 floats).
- DHASH_
HEIGHT - DHASH_
WIDTH - dHash samples (WIDTH+1)×HEIGHT so adjacent horizontal diffs yield 64 bits.
Functions§
- ahash_
u64 - Average hash: nearest-neighbor sample to 8×8, bit = pixel ≥ mean.
- color_
hist_ embed_ rgb - Fill
out[..COLOR_HIST_EMBED_DIM]with an L2-normalized joint RGB histogram. - cosine_
distance - Cosine distance
1 − cosine_similarity(identical unit vectors → 0). - cosine_
similarity - Cosine similarity
dot(a,b) / (|a||b|)over equal-length slices. - dhash_
u64 - Difference hash: nearest-neighbor sample to 9×8, bit = right ≥ left (row-wise).
- hamming_
distance_ u64 - Popcount of XOR bits between two 64-bit perceptual hashes.