Project

similie

0.01
No commit activity in last 3 years
No release in over 3 years
similie is an image fingerprinting & comparison utility
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

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(img3) #=> 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

MIT