Mar*_*oma 62 diff image-processing
您可以diff
使用 meld轻松比较两个文本文件,使用 meld 效果更好:
如果你对图像使用 diff,你会得到一个这样的例子:
$ diff zivi-besch.tif zivildienst.tif
Binary files zivi-besch.tif and zivildienst.tif differ
Run Code Online (Sandbox Code Playgroud)
下面是一个例子:
原文来自http://commons.wikimedia.org/wiki/File:Tux.svg
编辑:
我为两个图像添加了白色背景,并应用了 GIMP 的“差异”过滤器来得到这个:
这是差异如何工作的一种非常简单的方法,但我可以想象出更好(也更复杂)的方法。
你知道一个像 meld 这样对文本有效的程序吗?
(如果存在可以给出百分比的程序(0% 相同的图像 - 100% 相同的图像)我也会对它感兴趣,但我正在寻找一个能给我视觉提示差异的程序。)
pho*_*bos 75
是的,存在这样的程序!
ImageMagick有这个compare
实用程序,它有几种比较图像的方法。
要安装它:
sudo apt-get install imagemagick imagemagick-doc
Run Code Online (Sandbox Code Playgroud)
视觉比较两个图像:
compare -compose src tux_orig.png tux_modified.png tux_difference.png
Run Code Online (Sandbox Code Playgroud)
tux_orig.png
& tux_modified.png
给出这个图像:
通过指标比较两个图像:
还有很多方法可以通过一些指标输出差异,例如:
# compare -verbose -metric PSNR tux_orig.png tux_modified.png tux_difference.png
tux_orig.png PNG 200x232 200x232+0+0 8-bit sRGB 20.6KB 0.000u 0:00.000
tux_modified.png PNG 200x232 200x232+0+0 8-bit sRGB 22.2KB 0.010u 0:00.000
Image: tux_orig.png
Channel distortion: PSNR
red: 19.5485
green: 19.5973
blue: 19.6507
alpha: 16.1568
all: 18.4517
tux_orig.png=>tux_difference.png PNG 200x232 200x232+0+0 8-bit sRGB 12.3KB 0.030u 0:00.020
Run Code Online (Sandbox Code Playgroud)
一些指标选项:
AE absolute error count, number of different pixels (-fuzz effected)
FUZZ mean color distance
MAE mean absolute error (normalized), average channel error distance
MEPP mean error per pixel (normalized mean error, normalized peak error)
MSE mean error squared, average of the channel error squared
NCC normalized cross correlation
PAE peak absolute (normalize peak absolute)
PSNR peak signal to noise ratio
RMSE root mean squared (normalized root mean squared)
Run Code Online (Sandbox Code Playgroud)
有很多方法可以比较图像,请参阅ImageMagicks 中关于比较的部分了解更多方法。
这个问题是在 2012 年问的,现在是 2017 年。我们现在有非开源程序Beyond Compare来比较图像,它集成到 Nautilus 中。我们也一直使用Geeqie来在整个目录结构中(递归地)查找相似的图像。
单击此链接下载 Beyond Compare .deb 包。
通过转到您下载软件包的目录来安装软件包,然后键入: sudo dpkg -i YourPackageName.deb,此时称为bcompare-4.2.2.22384_amd64.deb,因此您将键入:sudo dpkg -i bcompare- 4.2.2.22384_amd64.deb
要完成安装并使插件在 Nautilus 中工作,您需要注销,然后重新登录,因为即使您没有打开 Nautilus,它也在后台运行。
一旦安装并且插件正常工作,您: