Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another Good Image Hash Method #65

Open
mrlimbic opened this issue May 2, 2022 · 4 comments
Open

Another Good Image Hash Method #65

mrlimbic opened this issue May 2, 2022 · 4 comments

Comments

@mrlimbic
Copy link

mrlimbic commented May 2, 2022

Just thought you might also like this image hash method paper.

"AN IMAGE SIGNATURE FOR ANY KIND OF IMAGE" by H. Chi Wong, Marshall Bern, and David Goldberg

http://www.cs.cmu.edu/~hcwong/Pdfs/icip02.ps

@BigPanda97
Copy link

The file should be a PDF according to the website, but it is a “.ps” file. Are you sure it's clean? In a hex editor, you can see that it contains some kind of strange commands/codes.

@mrlimbic
Copy link
Author

mrlimbic commented May 2, 2022

It's in a folder with other PDFs but yes that particular file is postscript. On Mac OS it opens converted to a PDF in preview. I think it's legit as it's an academic site.

I came across it because it was referenced in a python image matching tool as "goldberg" hash. Apparently it works very well.

https://github.com/ProvenanceLabs/image-match/blob/master/image_match/goldberg.py

The reason I am interested is for matching frames in video. Most of the image hash methods don't work very well in my tests so far because obviously one video frame is often so similar to the previous & next that matches happen much too frequently.

One of the things that algorithm does is add a moire filter before hashing. That is good if you need to distinguish very similar images like I want. A slight movement shouldn't match as much.

@BigPanda97
Copy link

BigPanda97 commented May 2, 2022

Have you already seen https://github.com/facebook/ThreatExchange?
It was developed by Facebook and contains an image hashing algorithm (PDQ), a video hashing algorithm (TMK) and they implement another way of hashing videos soon. (vPDQ)

Explained in detail here: https://github.com/facebook/ThreatExchange/blob/main/hashing/hashing.pdf

@mrlimbic
Copy link
Author

mrlimbic commented May 2, 2022

I'll test out how noisy PDQ is compared to other hashes. My simple "hash noise" test is just to compare hashes of current frame to previous frame.

You can see how noisy perceptive hash from this JImageHash library is. The genuinely very different frames stand out (where a cut to a different shot is) but scene detection is not enough for me. I need much less noise from similar but not the exact same frame.

https://drive.google.com/file/d/1TBwNw1Ymh_iRSTsRAOBz9BSv8VnL8BWm/view?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants