mysql hamming distance between two phash

前端 未结 1 328
無奈伤痛
無奈伤痛 2020-12-29 08:46

I have a table A which has a column \'template_phash\'. I store the phash generated from 400K images.

Now I take a random image and generate a phash from that image.

相关标签:
1条回答
  • 2020-12-29 09:24

    I figured out that the hamming distance is just the count of different bits between the two hashes. First xor the two hashes then get the count of binary ones:

    SELECT product_id, BIT_COUNT(phash1 ^ phash2) as hd from A ORDER BY hd ASC;
    
    0 讨论(0)
提交回复
热议问题