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
2
votes
0 answers

Search similar images solution with pHash

A lot of images stored in database. I compute every image's hash with pHash and store the hash value into database. How can I search the known image's similar images? Need I traversal every images stored in database and compute the distance with…
daydayfree
  • 29
  • 2
2
votes
1 answer

How to build pHash on MacOSX Lion (using latest ffmpeg-devel)

Building pHash 0.9.4 on OSX can turn out to be tricky. For those of you who've run into issues, my somewhat lengthy answer below might help.
Anri Digholm
  • 89
  • 1
  • 7
1
vote
1 answer

Building the pHash library on Windows

I've been trying to build pHash(http://phash.org/) on my windows machine and haven't been having any luck. I'm new to programming desktop applications. I will be using the pHash library with Python through ctypes. Could someone post the steps…
user594044
  • 255
  • 2
  • 4
  • 13
1
vote
0 answers

HashMap implementation such that that inputs less than some specified hamming distance away from a key map to the same bucket as that key?

Okay, this one is a bit of a doozy, but here goes... ‎ I have computed perceptual hashes for some amount of images where I wish to count occurrences of near-duplicates. The way this is currently being done is by throwing every hash into a HashMap,…
memeko
  • 163
  • 1
  • 7
1
vote
0 answers

How can I use imagehash to identify visually identical images?

I'm trying to use the imagehash library (https://pypi.org/project/ImageHash/) to identify visually identical files. I'm testing with 3 files. The second is just a reduced resolution of the first. File 3 is very different. Images below. I wrote a…
1
vote
0 answers

How to save phash in MySQL 8 and calculate hamming distance?

I am trying to find similar images within a MySQL 8.0 table compared to a given phash. The phashes are generated via python and currently stored within a varchar(255) field. Typically they look like this: ae95916ec1354a9d My query is supposed to…
merlin
  • 2,717
  • 3
  • 29
  • 59
1
vote
0 answers

Using PHash (OpenCV) in Java

I use the org.openpnp:opencv:4.5.1-2 library to integrate OpenCV with a server backend but somehow I miss the pHash function / implementation. Did anyone have managed to get the OpenCV pHash version working in Java?
Martin Kersten
  • 5,127
  • 8
  • 46
  • 77
1
vote
1 answer

Perceptual Hash (pHash) Image Color vs Gray scale vs Threshold which is best input source

I've researched a lot and could not find a definitive answer. What kind of image color is most used for pHash input to generate the hash/fingerprint. For example I have a target image that I'm looking for within a source image, but the target can…
P_C
  • 185
  • 2
  • 11
1
vote
3 answers

I want to generate a hash for a given video, in a react native app

I have a video file which has been recorded from the React-native App. Now I want to generate a digital signature, or a hash for this video file, and associate it to the blockchain. Is there any way I can create a hash for the video file in the…
1
vote
1 answer

Elasticsearch Aggregation with hamming distance of a phash

Trying to group together similar documents with matching keyword field values and phashes of their related images. At the moment I have the following which works well for exact matching phashes 'duplicate_docs': A('terms', …
1
vote
0 answers

bitmap.ToLuminanceImage() is not a method

all I wont use Shipwreck.Phash(https://github.com/pgrho/phash) for image,but I have trouble with the example: var bitmap = (Bitmap)Image.FromFile(fullPathToImage); var hash = ImagePhash.ComputeDigest(bitmap.ToLuminanceImage()); vs2015 cannot find…
dongdong
  • 77
  • 1
  • 9
1
vote
1 answer

MySQL: Grouping results by perceptual hash similarity

Let's say we have MySQL table Image with following columns id user_id p_hash I know how to calculate hamming distance (to reveal similar images) between newly inserted row's perceptual hash and all existing data in table. SQL query looks like…
Donnie Sparko
  • 59
  • 1
  • 1
  • 5
1
vote
1 answer

What mechanism can be used to quantify similarity between non-numeric lists?

I have a database of recipes which is essentially structured as a list of ingredients and their associated quantities. If you are given a recipe how would you identify similar recipes allowing for variations and omissions? For example using milk…
Peter Pudaite
  • 406
  • 8
  • 18
1
vote
1 answer

Threshold for pHash Image Similarity

I am trying find similar images using pHash comparison. pHash of an image is 64-bit number. What I am doing is comparing hashes of two images and then count the number of 1 in the resulting hash, then calculate the my result into percentage. I have…
Ammad
  • 21
  • 8
1
vote
0 answers

Could not open library "pHash.dll"

This is my first time using Ruby. Currently I am trying to run this Ruby script on Windows. I have downloaded an extracted this to c:/PhotoOrganizer-master It also requires pHash so I have downloaded and extracted (to c:/pHash). I have set the…
p_mcp
  • 2,643
  • 8
  • 36
  • 75