v2e4lisp / ImagePhash

phash binding for perl ( http://phash.org )

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImagePhash

ImagePhash - Perl binding for pHash (http://phash.org)

SYNOPSIS

use ImagePhash qw(pdiff phash);

my $hash1 = phash("img1.jpg");
my $hash2 = phash("img1.png");

my $diff = pdiff($hash1, $hash2);

DESCRIPTION

Measure similarity between images.

EXPORT

None by default.

phash($img)

Calculate a perceptual hash for an image and returns a 16-byte long lowercase hex string which itself represents a 64bit unsinged integer.

pdiff($hash1, $hash2)

Calculate the hamming distance between the two image hashes and returns a positive integer less than 64. A small value means that the two images look similar to each other.

INSTALL

  • For linux, libjpeg-dev and libpng-dev are requried.

  • For Mac, ImageMagic and libjpeg are required.

  • Windows is not supported.

perl Makefile.PL
make
make test
make install

SEE ALSO

AUTHOR

Wenjun Yan, <wenjun.yan.dev@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2017 by Wenjun Yan

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.

About

phash binding for perl ( http://phash.org )


Languages

Language:C++ 96.5%Language:Perl 2.6%Language:XS 0.8%