Giter Site home page Giter Site logo

erlpuzzle's Introduction

ErlPuzzle - libpuzzle NIF for Erlang

The Puzzle library is designed to quickly find visually similar images (gif, png, jpg), even if they have been resized, recompressed, recolored or slightly modified. The library is free, lightweight yet very fast, configurable, easy to use and it has been designed with security in mind.

http://www.pureftpd.org/project/libpuzzle

You'll need:

  • erlang!!
  • libpuzzle
  • gd (+ jpg, + png).

Warning to create signatures from files (cvec_from_file/1) you'll need to build Erlang with dirty schedulers support (--enable-dirty-schedulers).

application:start(puzzle).

{ok,Cvec} = puzzle:cvec_from_file("/path/to/an/image").
{ok,Cvec2} = puzzle:cvec_from_file("/path/to/another/image").

{ok,Distance} = puzzle:compare_cvec(Cvec, Cvec2, fix_for_texts).
%% fix_for_texts is either 0 (disabled) or 1 (enabled).

Distance < puzzle:threshold()
%% if true, images are similar. :)

%% -- Compression
{ok,Ccvec} = puzzle:compress_cvec(Cvec).
{ok,Ccvec2} = puzzle:compress_cvec(Cvec2).

{ok,Ucvec} = puzzle:uncompress_cvec(Ccvec).
Ucvec == Cvec. %% true

%% Compare compressed cvec
{ok,DistanceC} = puzzle:compare_compressed_cvec(Ccvec, Ccvec2).
Distance == DistanceC. %% true

Licence: same as libpuzzle, 2-clauses BSD public license

erlpuzzle's People

Contributors

eraserewind avatar

Watchers

 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.