GithubHelp home page GithubHelp logo

clearscene / phash Goto Github PK

View Code? Open in Web Editor NEW
221.0 221.0 46.0 5.58 MB

Github-Repository of the pHash.org library for perceptual hashing.

Home Page: http://phash.org/

License: GNU General Public License v3.0

C# 0.37% Java 0.43% C++ 12.22% Awk 0.20% Shell 45.20% C 20.88% PHP 5.35% Python 1.67% Makefile 6.34% M4 7.32% JavaScript 0.01%

phash's People

Contributors

michaelxavier avatar sdepold avatar trolldbois avatar waynebooth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phash's Issues

load image from buffer

I wasn't able to find a way to load an image from a buffer (where the file was previously loaded) instead of directly from the file, is there anything somewhere or is it a limitation of the library (or of a dependency) ?

pHash won't build on recent Amazon Linux

Amazon Linux recently required gcc72 as a dependency of the kernel-devel package as of kernel-devel 4.14. This broke pHash builds on x64 Amazon Linux:

checking for uint64_t... no
configure: error:

*** Required type uint64_t not found.
pHash requires 64-bit integers for video and image hashes.

As a workaround, remove gcc72, libgcc72, and kernel-devel to get pHash to build.

False 1.0 similarity for PNG on Mac OS El Captain

I was using pHash via Ruby gem phash on a bit outdated Mac OS. After installing El Captain on new HDD (and so reinstalling pHash) it started to give false positive (1.0) similarity when at least one image is PNG. For example:

Values for JPEG didn't start to be wrong so when I convert the above images to JPEG, it says 0.46875
I forced an old version of gem ffi, but it had no effect -- probably smth changed in these binaries:

==> Installing dependencies for homebrew/boneyard/phash: cimg, x264, lame, xvid, ffmpeg, flac, libogg, l
==> Installing homebrew/boneyard/phash dependency: cimg
==> Downloading https://homebrew.bintray.com/bottles/cimg-1.6.9.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring cimg-1.6.9.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/cimg/1.6.9: 72 files, 14.3M
==> Installing homebrew/boneyard/phash dependency: x264
==> Downloading https://homebrew.bintray.com/bottles/x264-r2668.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring x264-r2668.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/x264/r2668: 10 files, 3.3M
==> Installing homebrew/boneyard/phash dependency: lame
==> Downloading https://homebrew.bintray.com/bottles/lame-3.99.5.el_capitan.bottle.1.tar.gz
######################################################################## 100,0%
==> Pouring lame-3.99.5.el_capitan.bottle.1.tar.gz
๐Ÿบ  /usr/local/Cellar/lame/3.99.5: 26 files, 2M
==> Installing homebrew/boneyard/phash dependency: xvid
==> Downloading https://homebrew.bintray.com/bottles/xvid-1.3.4.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring xvid-1.3.4.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/xvid/1.3.4: 9 files, 1.3M
==> Installing homebrew/boneyard/phash dependency: ffmpeg
==> Downloading https://homebrew.bintray.com/bottles/ffmpeg-3.1.1_1.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring ffmpeg-3.1.1_1.el_capitan.bottle.tar.gz
==> Caveats
The native FFmpeg AAC encoder has been stable since FFmpeg 3.0. If you
were using libvo-aacenc or libaacplus, both of which have been dropped in
FFmpeg 3.0, please consider switching to the native encoder (-c:a aac),
fdk-aac (-c:a libfdk_aac, ffmpeg needs to be installed with the
--with-fdk-aac option), or faac (-c:a libfaac, ffmpeg needs to be
installed with the --with-faac option).

See the announcement
https://ffmpeg.org/index.html#removing_external_aac_encoders for details,
and https://trac.ffmpeg.org/wiki/Encode/AAC on best practices of encoding
AAC with FFmpeg.
==> Summary
๐Ÿบ  /usr/local/Cellar/ffmpeg/3.1.1_1: 236 files, 50.1M
==> Installing homebrew/boneyard/phash dependency: flac
==> Downloading https://homebrew.bintray.com/bottles/flac-1.3.1.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring flac-1.3.1.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/flac/1.3.1: 52 files, 2.2M
==> Installing homebrew/boneyard/phash dependency: libogg
==> Downloading https://homebrew.bintray.com/bottles/libogg-1.3.2.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring libogg-1.3.2.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libogg/1.3.2: 96 files, 457.3K
==> Installing homebrew/boneyard/phash dependency: libvorbis
==> Downloading https://homebrew.bintray.com/bottles/libvorbis-1.3.5.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring libvorbis-1.3.5.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libvorbis/1.3.5: 158 files, 2.3M
==> Installing homebrew/boneyard/phash dependency: libsndfile
==> Downloading https://homebrew.bintray.com/bottles/libsndfile-1.0.26.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring libsndfile-1.0.26.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libsndfile/1.0.26: 48 files, 1.8M
==> Installing homebrew/boneyard/phash dependency: libsamplerate
==> Downloading https://homebrew.bintray.com/bottles/libsamplerate-0.1.8.el_capitan.bottle.2.tar.gz
######################################################################## 100,0%
==> Pouring libsamplerate-0.1.8.el_capitan.bottle.2.tar.gz
==> Caveats
Unless this formula is built with libsndfile, the example program,
"sndfile-resample", is broken and hence, removed from installation.
==> Summary
๐Ÿบ  /usr/local/Cellar/libsamplerate/0.1.8: 26 files, 3.0M
==> Installing homebrew/boneyard/phash dependency: mpg123
==> Downloading https://homebrew.bintray.com/bottles/mpg123-1.23.6.el_capitan.bottle.tar.gz
######################################################################## 100,0%
==> Pouring mpg123-1.23.6.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/mpg123/1.23.6: 22 files, 687.9K

See some background about installation: toy/pHash#8

Can not compile against php 5.5.3

โžœ php git:(master) โœ— make
/bin/bash /tmp/pHash/bindings/php/libtool --mode=compile g++ -I. -I/tmp/pHash/bindings/php -DPHP_ATOM_INC -I/tmp/pHash/bindings/php/include -I/tmp/pHash/bindings/php/main -I/tmp/pHash/bindings/php -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pHash/bindings/php/pHash.cpp -o pHash.lo
libtool: compile: g++ -I. -I/tmp/pHash/bindings/php -DPHP_ATOM_INC -I/tmp/pHash/bindings/php/include -I/tmp/pHash/bindings/php/main -I/tmp/pHash/bindings/php -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pHash/bindings/php/pHash.cpp -fPIC -DPIC -o .libs/pHash.o
/tmp/pHash/bindings/php/pHash.cpp:49:23: fatal error: php_logos.h: No such file or directory

as I know, logos are not supported anymore

[Java Bindings] .so not being built on Ubuntu 16.04

Steps to reproduce:

  • sudo ./configure --enable-shared --enable-java --disable-audio-hash --disable-video-hash --disable-pthread
  • sudo make
  • cd bindings/java
  • javac org/pHash/*.java
  • sudo make install

Result:
java -Djava.library.path=/usr/local/lib org.pHash.pHash -mh img1.jpg img2.jpg

Exception in thread "main" java.lang.UnsatisfiedLinkError: no pHash-jni in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.pHash.pHash.<clinit>(pHash.java:22)

Since there is no libpHash-jni.so nor libpHash.so at /usr/local/lib

Current code?

Is there where the active development is done?
I.e is this project abandoned?

You need FFmpeg

I have installed ffmpeg 4.0.2 still gives error You need FFmpeg

ffmpeg
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --disable-x86asm
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100

Error at ./configure

./configure
*** Configuring image hash ***

checking CImg.h usability... yes
checking CImg.h presence... yes
checking for CImg.h... yes

*** Configuring video Hash ***

checking whether FFmpeg is present... checking for avcodec_alloc_frame in -lavcodec... no
configure: error:

*** libavcodec not found.
You need FFmpeg. Get it at http://ffmpeg.org/

Project Ownership

Hi,
I'd like to take ownership of this project.
I use pHash in one of my projects and have found that, because of it's inactivity Debian has dropped it from the repositories. I'm starting the process of getting it accepted again, but will need a git-repo to work from. For that I may was well use the closest thing to a canonical repo - which is this.
Any concerns/questions, do let me know.
Cheers.

[Crash] Query failed

Trying to query the mvptree on a large database.
In the function _ph_query_mvptree:

DP *sv1 = ph_read_datapoint(m);
DP *sv2 = ph_read_datapoint(m);

sv1 can be NULL.

So the following line will crash:
float d1 = hashdist(query,sv1);

pHash under package org.phash

After I move the classes under a package the following error occurs.

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.phash.pHash.pHashInit()V
	at org.phash.pHash.pHashInit(Native Method)
	at org.phash.pHash.<clinit>(pHash.java:13)

Line 13
pHashInit();

Any ideas?
Thank you.

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.