Questions tagged [phash]

pHash or perceptual hash is an algorithm for creating fingerprints of multimedia data (images, audio, etc).

What is a perceptual hash?

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.

Relevance of Perceptual Hashing

Perceptual hashes must be robust enough to take into account transformations or "attacks" on a given input and yet be flexible enough to distinguish between dissimilar files. Such attacks can include rotation, skew, contrast adjustment and different compression/formats. All of these challenges make perceptual hashing an interesting field of study and at the forefront of computer science research.

What is pHash?

pHash is an open source software library released under the license that implements several perceptual hashing algorithms, and provides a -like API to use those functions in your own programs. pHash itself is written in . pHash was created by Evan Klinger.

Project URL: http://www.phash.org

76 questions
43
votes
7 answers

Similar image search by pHash distance in Elasticsearch

Similar image search problem Millions of images pHash'ed and stored in Elasticsearch. Format is "11001101...11" (length 64), but can be changed (better not). Given subject image's hash "100111..10" we want to find all similar image hashes in…
TautrimasPajarskas
  • 2,686
  • 1
  • 32
  • 40
13
votes
1 answer

What alternatives are there to the pHash open source perceptual hash library?

I know you can use pHash from .NET or Java, but I would like a pure .NET (preferably) or Java implementation. Are there any others available? I am interested in the image hashing functionality specifically. A perceptual hash is a way of creating a…
Jim McKeeth
  • 38,225
  • 23
  • 120
  • 194
13
votes
1 answer

Compiling pHash for iOS

How to compile pHash for iOS? I read the documentation but there's no mention of iOS/arm and Google doesn't help. So if anyone was able to compile pHash for iOS please share your experience.
tagyro
  • 1,638
  • 2
  • 21
  • 36
12
votes
3 answers

Using OpenCV's Image Hashing Module from Python

I want to use OpenCV's perceptual hashing functions from Python. This isn't working. import cv2 a_1 = cv2.imread('a.jpg') cv2.img_hash_BlockMeanHash.compute(a_1) I get: TypeError: descriptor 'compute' requires a 'cv2.img_hash_ImgHashBase' object…
andandandand
  • 21,946
  • 60
  • 170
  • 271
8
votes
1 answer

Phash vs. SIFT in identifying similar image

I have questions about both sift and phash First of all, I'm using SIFT to identify similar image in real-time service. Like pictures by phone-camera, small amount of rotation and blurred effect could be. And I found Phash. So, I test phash on its…
jeyraof
  • 863
  • 9
  • 28
7
votes
1 answer

Locality Sensitive Hash or pHash?

I'm trying to implement a general fingerprint memoizator: we have a file that can be expressed through an intelligent fingerprint (like pHash for images or chromaprint for audio) and if our desidered (expensive) function has already been computed on…
justHelloWorld
  • 6,478
  • 8
  • 58
  • 138
7
votes
2 answers

How to know if an images is similar to another (slightly different angle but same point of view)

I've checked methods like Phasher to get similar images. Basically to resize images to 8x8, grayscale, get average pixel and create a binary hash of each pixel comparing if it's above or below the average pixel. This method is very well explained…
FlamingMoe
  • 2,709
  • 5
  • 39
  • 64
6
votes
3 answers

Hamming Distance optimization for MySQL or PostgreSQL?

I trying to improve search similar images pHashed in MySQL database. Right now I comparing pHash counting hamming distance like this: SELECT * FROM images WHERE BIT_COUNT(hash ^ 2028359052535108275) <= 4 Results for selecting (engine MyISAM) 20000…
mateuszdw
  • 61
  • 1
  • 8
5
votes
3 answers

How can I calculate the difference between two hashes in a MySQL query?

I'm attempting to calculate the Hamming distance between an input hash and database-stored hashes. These are perceptual hashes, so the Hamming distance between them are important to me and tell me how similar two different images are (see…
jeremy
  • 9,965
  • 4
  • 39
  • 59
5
votes
1 answer

Changing hash size in ImageHash Python library

I'm using ImageHash library to generate the perceptual hash of an image. The library claims to be able to generate hashes of different size (64, 128, 256), but I can't figure how to get a 128 hash. The hash size is determined by the image size when…
Hyperion
  • 2,515
  • 11
  • 37
  • 59
5
votes
1 answer

"initializer_list" file not found

trying to install phash-image for node but i get this error: > phash-image@3.1.0 install /Users/jong/Workspace/mgmtio/phash-image > node-gyp rebuild CXX(target) Release/obj.target/pHash/phash.o In file included from ../phash.cpp:4: In file…
Jonathan Ong
  • 19,927
  • 17
  • 79
  • 118
5
votes
1 answer

Using SOLR to calculate "similarity"/"bitcount" between two ulongs

We have a database of images where I have calculated the PHASH using Dr. Neal Krawetz's method as implemented by David Oftedal. Part of the sample code calculates the difference between these longs is here: ulong hash1 = AverageHash(theImage); ulong…
5
votes
2 answers

Using pHash to search agaist a huge image database, what is the best approach?

I need to search a huge image database to find possible duplicate using pHash assuming those image records have the hash code generated using the pHash. Now I have to compare a new image and I have to create the hash for this using pHash against…
Emily Webb
  • 325
  • 2
  • 6
  • 16
5
votes
2 answers

Convert an image loaded using PIL to a Cimg image object

I am trying to convert a iamge loaded using PIL to a Cimg image object. I understand that Cimg is a c++ library and PIL is a python imaging library. Given an image url, my aim is to calculate the pHash of an image without writing it onto a disk.…
Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124
4
votes
1 answer

Detecting somewhat different Images - Is there any java implementation for perceptual hash and differential hash?

I am working on a solution for detecting similar and somewhat different media Images. I have come across many articles suggesting techniques for handling Images for instance - Image comparison - fast algorithm file-hash based (md5,sha1,etc) -…
Sumeet
  • 180
  • 2
  • 9
1
2 3 4 5 6