Skip to main content

Module perceptual_hash_u64

Module perceptual_hash_u64 

Source
Expand description

aHash / dHash perceptual hashes over a gray buffer.

Honest scope: compact image fingerprints for local near-duplicate / CBIR proxy search — not semantic CLIP embeddings. When ONNX CLIP (or similar) lands under vendor/vision/embeddings/, use that for open-vocab meaning; keep these hashes for cheap layout/structure pre-filter.

Constants§

AHASH_SIDE
Side length for aHash (8×8 → 64 bits).
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.
dhash_u64
Difference hash: nearest-neighbor sample to 9×8, bit = right ≥ left (row-wise).