• Stars
    star
    140
  • Rank 252,904 (Top 6 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created almost 14 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

python bindings for pHash

py-pHash

Python bindings for libpHash (http://phash.org/)

A perceptual hash is a fingerprint of a multimedia file derived from various features from its content. Unlike cryptographic hash functions which rely on the avalanche effect of small changes in input leading to drastic changes in the output, perceptual hashes are "close" to one another if the features are similar.

Installation

python setup.py install

(for python 3 checkout python3 branch)

You may wish to install imagemagick or graphicsmagick for additional file format support.

Usage

DCT hash

int phash_imagehash( str file ) int phash_distance( int hash1, int hash2 )

Radial hash

pHash.Digest phash_image_digest( str file, float sigma, float gamma, int angles=180 ) int phash_crosscorr( phash.Digest digest1, phash.Digest digest2 )

Mexican hat wavelet

list pHash.mh_imagehash( str file ) float pHash.hamming_distance2( list byteList1, list byteList2 )

Peak of Cross Correlation

float pHash.compare_images( str file1, str file2 )

import pHash
hash1 = pHash.imagehash( 'file.1.jpg' )
hash2 = pHash.imagehash( 'file.2.jpg' )
print 'Hamming distance: %d (%08x / %08x)' % ( pHash.hamming_distance( hash1, hash2 ), hash1, hash2 )

digest1 = pHash.image_digest( 'file.1.jpg', 1.0, 1.0, 180 )
digest2 = pHash.image_digest( 'file.2.jpg', 1.0, 1.0, 180 )
print 'Cross-correelation: %d' % ( pHash.crosscorr( digest1, digest2 ) )

Todo

  • Return peak cross-correlation for radial hashing
  • Add audio and video support
  • Beautify the code, add comments
  • Unify with python 3 branch

More Repositories

1

fahrenheit

toy futures executor ๐Ÿš’๐Ÿ“–๐Ÿ”ฅ
Rust
231
star
2

echinus

echinus is a lightweight and easily configurable tiling window manager
C
65
star
3

pnetlink

netlink library for rust
Rust
41
star
4

gtk-vikb

vi keybindings for gtk2 TextView & Entry
C
27
star
5

liburing-sys

raw bindings for git://git.kernel.dk/liburing
Rust
17
star
6

passfd

One weird unix trick
Rust
17
star
7

gdax

futures 0.3 + tokio compat layer example project
Rust
17
star
8

libvirt-rpc

Pure rust implementation of libvirt protocol (no C bindings required) ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ
Rust
15
star
9

skb

simple keyboard indicator
C
15
star
10

seccomp

Seccomp high-level wrapper
Rust
12
star
11

seccomp-sys

low-level bindings to libseccomp
Rust
11
star
12

mpsc

Rust MPSC library
Rust
9
star
13

tokio-futures-faq

frequently asked questions about rust futures & tokio
8
star
14

go-soap

Simple SOAP coder / decoder
Go
8
star
15

xonar-freebsd

ASUS Xonar STX driver for FreeBSD
C
8
star
16

mio-afpacket

AF_PACKET socket support for mio
Rust
7
star
17

pt

dumb terminal
Rust
6
star
18

tokio-timerfd

Timerfd for Tokio
Rust
6
star
19

bdf2wscons

convert bdf font to wscons header
Haskell
6
star
20

nss-multipasswd

glibc nss module for multiple passwd files (/etc/passwd.d/)
Rust
6
star
21

xbattbar

Xbattbar shows the current (laptop) battery status in the X window environment
Haskell
6
star
22

rust-gitlab-ci-example

rust gitlab ci example
Rust
5
star
23

psnotify

Go
5
star
24

pscnv

Improve FreeBSD support for pscnv
C
5
star
25

bpfjit

BPF JIT from FreeBSD
C
4
star
26

derive-diff

Rust
4
star
27

sdnotify

Notify service manager about start-up completion and other daemon status changes
Rust
4
star
28

hyper-bench

Rust
3
star
29

rust-cnproc

Proc connector
Rust
3
star
30

tokio-eventfd

Rust
3
star
31

envytools

C
3
star
32

netmap-rs

Higher level interface to netmap
Rust
3
star
33

qemu-n311

Qemu fork emulating Acer N311
C
2
star
34

lerison

various dotfiles
Shell
2
star
35

libmarisa-sys

marisa trie wrapper
C++
2
star
36

xwinfs

FUSE-based filesystem representing X Windows objects
C
2
star
37

mio-netlink

Netlink sockets for mio
Rust
2
star
38

tuntap

Linux TUN/TAP device manipulation for rust
Rust
2
star
39

intmap

lock free hashmap for rust
Rust
2
star
40

iriq

GUI configuration editor for echinus wm
Python
2
star
41

serde-sbe

sbe test
Rust
2
star
42

hyper-json-server

post json & get json reply
Rust
2
star
43

tokio-amqp

Rust
2
star
44

marisa-trie-c

dumb marisa-trie (http://code.google.com/p/marisa-trie/) C wrapper
C++
2
star
45

test-tokio-fairness

Rust
1
star
46

rund

Rust
1
star
47

ej

simple dejavu reader
C
1
star
48

node-cnproc

Node.js process connector module
C++
1
star
49

sirena-types

Rust
1
star
50

tokio-consul

Rust
1
star
51

pool-performance

tokio-threadpool fun
Rust
1
star
52

libpnet-bench

libpnet performance compared to crude byte manipulation
Rust
1
star
53

digi96-freebsd

RME Digi96 driver for FreeBSD
C
1
star
54

iproute2

Iproute2 is a collection of utilities for controlling TCP / IP networking and traffic control in Linux.
C
1
star
55

pnet-test

Rust
1
star
56

libmarisa

Higher level libmarisa bindings
Rust
1
star
57

async-tokio

test interop
Rust
1
star
58

iata-types

iata coding types
Rust
1
star
59

libstdcpp-sys

libstdc++ shim for rust
Rust
1
star
60

cwm-openbsd

cwm - a lightweight and efficient window manager for X11
C
1
star
61

ipv4-cmp-bench

comparing ipv4
Rust
1
star
62

tokio-fifo

Rust
1
star
63

libpnet-custom-packet

Rust
1
star
64

atpco-types

Rust
1
star
65

tokio-signalfd

Rust
1
star
66

hyper-json-rpc

Rust
1
star
67

sha-bench

Benchmarking linux kernel sha1 implementations
C
1
star
68

yodawg

DWG parsing library in Haskell
Haskell
1
star
69

tokyocabinet-sys

Rust tokyocabinet bindings
Rust
1
star
70

tokio-syslog

Rust
1
star
71

hdict

simple sdcv replacement
Haskell
1
star
72

cargo-failed

Reproducing cargo git problem
Rust
1
star
73

hs-nginx

Nginx config parsing library
Haskell
1
star
74

unigit

ะ’ััะบะธะต ัˆั‚ัƒะบะธ ะฟะพ ัƒั‡ั‘ะฑะต
Haskell
1
star
75

reqwest-cache

lol kek
Rust
1
star
76

rust-output-type-mismatch

Encountered error `OutputTypeParameterMismatch`
Rust
1
star
77

i40e-netmap

i40e drivers from e1000.sf.net with netmap patches
C
1
star
78

quepasa

keepassxc-compatible daemon
Rust
1
star
79

xonar-openbsd

Xonar DS/DSX for openbsd
C
1
star