Using multiple image algorithms to obtain image hashes and voting to determine if they are similar
Note that the code part in this project is generated by AI
This is a personal tool.
The method of obtaining image Hash is basically the same as
std::bitset<64> HashFunction(cv::mat inputImage);This is very simple. As for judging whether the image is similar, you can get its Hamming distance (not easy to use). My personal suggestion is to use cosine similarity, with a threshold of 0.7 being the most appropriate.
As for why I don’t recommend using Hamming distance, it’s because I found that even if two very similar pictures (from the front and back frames of the same video), the calculated Hamming distance can exceed 20+. Maybe there is a bug in my code. I am very happy to receive code submissions from everyone to help me improve it.
Supported methods are aHash,dHash,pHash,wHash,cmHash(Color Moment Hash),mHash(Marr-Hildreth),rHash(Radon Hash)
translate ZH_CN -> EN_US by Google Translator