Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrefhref/erlpuzzle
Erlang NIF to libpuzzle, a library to quickly find visually similar images
https://github.com/hrefhref/erlpuzzle
erlang image-processing image-recognition jpg libpuzzle signature
Last synced: 28 days ago
JSON representation
Erlang NIF to libpuzzle, a library to quickly find visually similar images
- Host: GitHub
- URL: https://github.com/hrefhref/erlpuzzle
- Owner: hrefhref
- Created: 2014-02-24T18:51:36.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-03T14:25:19.000Z (over 9 years ago)
- Last Synced: 2024-11-07T06:14:20.233Z (3 months ago)
- Topics: erlang, image-processing, image-recognition, jpg, libpuzzle, signature
- Language: C
- Homepage:
- Size: 355 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](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`).```erlang
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