KilianB / JImageHash

Perceptual image hashing library used to match similar images
MIT License
401 stars 81 forks source link

Can hog feature descriptor be used to create an efficient hash? #8

Open KilianB opened 5 years ago

KilianB commented 5 years ago

The hog feature descriptor pools gradient vectors based on their unsigned direction. It is successfully used in pedestrian detection.

So far a derived descriptor based on https://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf is implemented but we are still left with way to many numbers to encode them into a short hash.

hogtest

Images to compare normalized hamming distance
Similar images
HQ - HQ: 0.000
HQ - LQ: 0.292
HQ - Copy: 0.119
HQ - Thumb0.422
LQ - Copy0.319
LQ - Thumb0.396
Copy - Thumb0.424
Unlike Images
HQ - Ballon: 0.496
HQ - Lena: 0.491
LQ - Ballon0.484
LQ - Lena0.483
Copy - Ballon0.491
Copy - Lena0.493
Thumb - Ballon0.506
Thumb - Lena0.481

While similar images can be differentiated from unlike images it's rather expensive, the hash is long. A todo on figuring out if the approach can be tweaked to produce usable results.

KilianB commented 5 years ago

5134663727920127093d2846a3c157dd3a8b4a12 doesn't look promising so far.