Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

similie

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

similie

  • 0.3.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= 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}[http://www.phash.org/]

= License

{CC BY-SA 3.0}[http://creativecommons.org/licenses/by-sa/3.0/]

FAQs

Package last updated on 24 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc