【图像算法】ImageHash(Python 图像哈希库)

用Python编写的图像哈希库。ImageHash支持:

  • 平均哈希(aHash
  • 感知哈希(pHash
  • 差异哈希(dHash

  • 小波散列(wHash

要求

基于PIL,numpy和scipy.fftpack(用于pHash)通过pypi轻松安装

基本用法

from PIL import Image
import imagehash
hash = imagehash.average_hash(Image.open('test.png'))
print(hash)
# d879f8f89b1bbf
otherhash = imagehash.average_hash(Image.open('other.bmp'))
print(otherhash)
# ffff3720200ffff


应用


ImageHash主要用于计算图像hash值,值为16进制数,可用于图像相似度匹配。

猜你喜欢

转载自blog.csdn.net/chenvast/article/details/80152012