hash op• Data kinds: phash × phash → measurement
• Call: import imgforensics; imgforensics.hash_distance(hash1, hash2) -> 'int' (or opsimgforensics.get("hash_distance"))
Hamming distance between two perceptual hashes (the number of differing bits).
> The detailed description below is the original text — the summary and the headings are translated.
dtype と長さを検査して fail-closed する。float の 1-D を受け取って
`!=` で数えると、ほぼ確実に「全ビット違う」= 最大距離という
*もっともらしい* 値が出る —— それは型の取り違えであって画像の違いではない。
返りは Python の `int(measurement` 語彙)。ビット長で割った
正規化距離が欲しければ `hash_distance(a, b) / a.size`。
• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).
• Operator provenance and references — the sources of the research/methods this op family came from.
• The canonical algorithm (author, year) and its uses are named in the family usage guide above.
• image_forensics_audit — py -3.11 examples/image_forensics_audit.py
measurement as input)hash)*Provenance: imgforensics.py — IMGFORENSICS operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.