Coder Social home page Coder Social logo

dhash's Introduction

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

dhash's People

Contributors

hjaurum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.