Code Monkey home page Code Monkey logo

similie's Introduction

Similie

Similie is a simple DCT based image hashing interface that,

  • computes a fingerprint based on low frequencies of an image.

  • computes hamming distance between 2 fingerprints.

Example

require 'similie'

img1 = Similie.new("test/lena1.png")
img2 = Similie.new("test/lena2.png") # lena1.png cropped and scaled
img3 = Similie.new("test/lena5.png") # a different image

img1.fingerprint #=> 64bit int

img1.distance(img2) #=> 2
img1.distance(img5) #=> 12

# class methods, if you want to deallocate image buffers immediately.
Similie.distance("test/lena1.png", "test/lena5.png") #=> 12
Similie.fingerprint("test/lena1.png")

# utility method that exposes hamming distance http://en.wikipedia.org/wiki/Hamming_weight
Similie.popcount(0x03 ^ 0x08) #=> 3

Dependencies

  • ruby 1.9.1+

  • opencv 2.1+ (libcv-dev and libhighgui-dev on debian systems)

See Also

pHash - The open source perceptual hash library

License

CC BY-SA 3.0

similie's People

Contributors

deepfryed avatar

Watchers

Per Wigren avatar James Cloos 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.