Ale*_*lex 5 hash image image-processing
在基于块平均值图像感知哈希卞押嗯提出了说,一个散列方法:
第一个感知散列函数基于均值
a) Normalize the original image into a preset sizes;
b) Divide the size-normalized image I into non overlapped blocks I1, I2, …, IN,
in which N is the block number equal to length of the final hash bit string;
c) Calculate the mean value sequence {M1, M2, …, MN} from corresponding
block sequence {I’1, I’2, …, I’N } and obtain the median value Md of
this sequence as: Md = median (Mi) (i=1,2,…, N)
d) Normalize the mean value sequence into a binaryform and obtain the hash
values h as:
h(i)=0 if Mi<Md
h(i)=1 if Mi>= Md
Run Code Online (Sandbox Code Playgroud)
我的问题是部分"b",任何人都知道图像是如何分成块的?是这样的吗?

是的,你是对的。大多数实现会在 32 个展开的非重叠块中执行一般图像哈希处理,但是,您也可以识别人脸和哈希,或者如果您知道特定的地方有额外的细节,例如底部的文本,在那里投入更多的块。
您可以在此处查看 JS 的完整实现:https://github.com/danm/image-hash/blob/master/src/block-hash.ts(image-hash npm 的一部分,引用了您所引用的同一篇论文)指的是)。
主要思想是将图像的视觉信息压缩成更小且固定大小的东西(以便您可以快速使用固定大小的哈希比较)。
块的顺序对算法来说并不重要,唯一重要的是在进行比较时使用相同的顺序,因为顺序会改变哈希输出。
另外,正如您在评论中提到的,它只关心块不重叠。它将最终计算块的中值,因此,如果您给它一个 8k 版本的图像或一个 32x32 像素版本的图像,大多数实现都会产生相同的输出,因为它们将块分散在完全按照您的方式进行(尽管他们可能会改变方向并从左到右或其他什么)。