Detecting if two images are visually identical

前端 未结 8 574
粉色の甜心
粉色の甜心 2020-12-02 09:12

Sometimes two image files may be different on a file level, but a human would consider them perceptively identical. Given that, now suppose you have a huge database of image

相关标签:
8条回答
  • 2020-12-02 09:41

    findimagedupes is pretty good. You can run "findimagedupes -v fingerprint images" to let it print "perceptive hash", for example.

    0 讨论(0)
  • 2020-12-02 09:43

    If you have lots of images, a color histogram could be used to get rough closeness of images before doing a full image comparison of each image against each other one (i.e. O(n^2)).

    0 讨论(0)
  • 2020-12-02 09:45

    Cross-correlation or phase correlation will tell you if the images are the same, even with noise, degradation, and horizontal or vertical offsets. Using the FFT-based methods will make it much faster than the algorithm described in the question.

    The usual algorithm doesn't work for images that are not the same scale or rotation, though. You could pre-rotate or pre-scale them, but that's really processor intensive. Apparently you can also do the correlation in a log-polar space and it will be invariant to rotation, translation, and scale, but I don't know the details well enough to explain that.

    MATLAB example: Registering an Image Using Normalized Cross-Correlation

    Wikipedia calls this "phase correlation" and also describes making it scale- and rotation-invariant:

    The method can be extended to determine rotation and scaling differences between two images by first converting the images to log-polar coordinates. Due to properties of the Fourier transform, the rotation and scaling parameters can be determined in a manner invariant to translation.

    0 讨论(0)
  • 2020-12-02 09:45

    You could use diff to see if they are REALLY different.. I guess it will remove lots of useless comparison. Then, for the algorithm, I would use a probabilistic approach.. what are the chances that they look the same.. I'd based that on the amount of rgb in each pixel. You could also find some other metrics such as luminosity and stuff like that.

    0 讨论(0)
  • 2020-12-02 09:49

    resize the image to a 1x1 pixle... if they are exact, there is a small probability they are the same picture... now resize it to a 2x2 pixle image, if all 4 pixles are exact, there is a larger probability they are exact... then 3x3, if all 9 pixles are exact... good chance etc. then 4x4, if all 16 pixles are exact,... better chance.

    etc...

    doing it this way, you can make efficiency improvments... if the 1x1 pixel grid is off by a lot, why bother checking 2x2 grid? etc.

    0 讨论(0)
  • 2020-12-02 09:52

    I don't know the algorithm behind it, but Microsoft Live Image Search just added this capability. Picasa also has the ability to identify faces in images, and groups faces that look similar. Most of the time, it's the same person.

    Some machine learning technology like a support vector machine, neural network, naive Bayes classifier or Bayesian network would be best at this type of problem. I've written one each of the first three to classify handwritten digits, which is essentially image pattern recognition.

    0 讨论(0)
提交回复
热议问题