如果检测两个图像视觉上相 [英] Detecting if two images are visually identical

查看:159
本文介绍了如果检测两个图像视觉上相的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候两个图像文件可能是在文件级别不同,但人会认为他们敏锐相同。鉴于这种情况,现在假设你有一个庞大的图像数据库,你想知道,如果一个人会想一些图像X是present数据库与否。如果所有的图像有敏锐的哈希/指纹,那么可以散列图像X和这将是一个简单的事情,看它是否是在数据库或没有。

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 images, and you wish to know if a human would think some image X is present in the database or not. If all images had a perceptive hash / fingerprint, then one could hash image X and it would be a simple matter to see if it is in the database or not.

我知道有解决这个问题的研究,有的算法存在,但没有任何工具,就像一个UNIX命令行工具或图书馆,我可以用它来计算这样的散列没有实现某种算法从头开始?

I know there is research around this issue, and some algorithms exist, but is there any tool, like a UNIX command line tool or a library I could use to compute such a hash without implementing some algorithm from scratch?

编辑:从findimagedupes相关code,使用ImageMagick

edit: relevant code from findimagedupes, using ImageMagick

try $image->Sample("160x160!");
try $image->Modulate(saturation=>-100);
try $image->Blur(radius=>3,sigma=>99);
try $image->Normalize();
try $image->Equalize();
try $image->Sample("16x16");
try $image->Threshold();
try $image->Set(magick=>'mono');
($blob) = $image->ImageToBlob();

编辑:警告的ImageMagick $图像对象似乎包含有关所读取的图像文件的创建时间信息,这意味着你的斑点会有所不同,即使是相同的图像如果它被检索在不同的时间。为了确保指纹保持不变,使用$图像 - > getImageSignature()作为最后一步。

edit: Warning! ImageMagick $image object seems to contain information about the creation time of an image file that was read in. This means that the blob you get will be different even for the same image, if it was retrieved at a different time. To make sure the fingerprint stays the same, use $image->getImageSignature() as the last step.

推荐答案

findimagedupes 是pretty的好。您可以运行findimagedupes -v指纹图像,让它打印出感知哈希,例如。

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

这篇关于如果检测两个图像视觉上相的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆