Perceptual Hash

Announcements pertaining to ImageMagick, or ImageMagick related software. This list is moderated. No discussions here, instead post to the users group instead.
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Perceptual Hash

Post by magick »

A perceptual hash maps visually identical images to the same or similar hash-- useful in image retrieval, authentication, indexing, or copy detection as well as digital watermarking. See Tests Of Perceptual Hash (PHASH) Compare Metric @ http://www.fmwconcepts.com/misc_tests/p ... index.html for a detailed discussion. Thanks to Fred Weinhaus for the design based on a modification of this paper: http://www.naturalspublishing.com/files ... g3omq1.pdf.

Note, perceptual hash is supported in ImageMagick 6.8.8-3. There will be an algorithm correction to properly handle "zero" image moments (e.g. in an all black image) in the upcoming 6.8.8-5 release.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Perceptual Hash

Post by fmw42 »

The algorithm is under review and may change for the next release such that values are different for non-black images. But the concept is demonstrated in the current documentation referenced above.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Perceptual Hash

Post by fmw42 »

The algorithm has been changed now in IM 6.8.8.5 and some values are only slightly different than in IM 6.8.8.3 and 6.8.8.4. Documentation and examples can be found at http://www.fmwconcepts.com/misc_tests/p ... index.html
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Perceptual Hash

Post by fmw42 »

User snibgo has done some extensive testing. His test and result can be found at http://im.snibgo.com/phashtest.htm
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Perceptual Hash

Post by fmw42 »

As of IM 7.0.3.8, the perceptual hash now allows one to choose up to six colorspace and allows the phash compare metric to be normalized per number of channels. It is not implemented in IM 6. See http://www.imagemagick.org/script/comma ... php#define
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Perceptual Hash

Post by snibgo »

Good stuff.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Perceptual Hash

Post by fmw42 »

snibgo wrote:Good stuff.
Check it out and make sure it is working properly. The selection of individual channels was not implemented yet. Magick only had limit time to do what was the easier parts. It is only in IM 7.
Post Reply