Need help with DHash?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

hjaurum
147 Stars 77 Forks 5 Commits 0 Opened issues

Description

Comparing images with dHash algorithm.

Services available

!
?

Need anything else?

Contributors list

# 306,519
Python
5 commits

DHash

Image comparing with dHash algorithm. 使用dHash算法实现图片对比、相似图片查重。

dHash简介

dHash算法属于感知哈希算法,用于图片相似度对比。

感知哈希算法目前有:

  1. aHash:平均值哈希,速度快,但准确率较低。
  2. pHash:感知哈希,准确率高,但速度较慢。
  3. dHash:差异值哈希,速度快,且准确率高。

Function

1. 获得图片的dHash值:

hash = DHash.calculate_hash(image)

2. 计算两张图片间的汉明距离:

hamming_distance = DHash.hamming_distance(image1, image2)

3. 计算两个dHash值间的汉明距离:

hamming_distance = DHash.hamming_distance(dHash1, dHash2)

dHash算法实现详解:

http://www.jianshu.com/p/193f0089b7a2

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.