简体   繁体   English

比较两个图像的最快方法

[英]Fastest way to compare two images

I need to compare two images as fast as possible. 我需要尽快比较两个图像。 I don't need to know the differences or anything else I just need to know if they are the same, yes/no, awesome. 我不需要知道差异或其他任何东西,我只需要知道它们是否相同,是/不是,太棒了。 What is the fastest way to do this? 最快的方法是什么?

Thanks, R. 谢谢,R。

If they are expected to be the same, byte-by-bye like @NullUserException mentioned, the easiest solution is to use a hash like Md5. 如果期望它们像提到的@NullUserException一样逐字节地相同,则最简单的解决方案是使用Md5之类的哈希。 If you'd like to get more advanced, you can get the RGB values of each pixel in the first image and calculate the euclidean distance from the pixels in the second image checking to see if it's below some threshold. 如果您想更高级,则可以获取第一幅图像中每个像素的RGB值,并计算与第二幅图像中的像素的欧式距离,以检查其是否低于某个阈值。 Everything is else is not fast :) 一切都不是很快:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM