You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after updating hexdec column you can run this query SELECT images.*, BIT_COUNT(2098406171686304051^ hexdec) as hamming_distance FROM images HAVING hamming_distance < 30 ORDER BY hamming_distance ASC LIMIT 10
I've got three test images ..
ImageHash gives following hashes ..
Image 1: 0405794952704d4a
Image 2: 0405714972704d48
Image 3: 0445714972704d4a
Distances in ImageHash are always 3 using example:
use Jenssegers\ImageHash\ImageHash;
use Jenssegers\ImageHash\Implementations\DifferenceHash ;
$hasher = new ImageHash(new DifferenceHash());
$distance = $hasher->distance($hash1, $hash2); // = 3
$distance = $hasher->distance($hash1, $hash3); // = 3
If the hashes are inserted into MySQL DB in column "hash" ( data type varchar() ) ...
SELECT images.*, BIT_COUNT('0405794952704d4a' ^ hash) as hamming_distance
FROM images
HAVING hamming_distance < 50
Distances are as followed ..
Image 1: 0405794952704d4a -> 0
Image 2: 0405714972704d48 -> 12
Image 3: 0445714972704d4a -> 21
I am expecting hamming distance of 3 like using the ImageHash DifferenceHash() Class.
Where is my fault?
The text was updated successfully, but these errors were encountered: