如何根据像素差异找到两幅图像之间的差异?基于像素比较的2幅图像之间的差异
回答
有很多方法,从几行代码到大项目。
你可以试试:
像素级别的差异,即
image matrix A - image matrix B
颜色直方图的区别。您还可以将图像分成几个小窗口,并在每个窗口中聚合直方图差异。
确切的功能,如Gist,筛选等这是最先进的/研究方法。
你可以很快在C#中使用AForge框架
您可以使用compare
工具,ImageMagick的一部分实现这样的一个Sobel Filter
可以实现过滤器。
compare -metric MSE image1.png image2.png difference.png
它会突出显示第三个文件的差异,并输出差异的数值估计。
如果您有兴趣找到更接近人类感知的图像之间的差异,请查找SSIM/DSSIM工具。
没有对像素比较任何特定的方法,但我会尽力帮助你....
笔记记录>http://php.net/manual/en/book.image.php包含针对图像处理所需的所有功能,我必须说,他们代表非常仔细地和美丽。
// Setup the true color and palette images
$im1 = imagecreatefrompng('orginal_image.png');
$im2 = imagecreate(imagesx($im1), imagesy($im1));
// Add some colors to $im2
$colors = Array();
$colors[] = imagecolorallocate($im2, 255, 36, 74);
$colors[] = imagecolorallocate($im2, 40, 0, 240);
$colors[] = imagecolorallocate($im2, 82, 100, 255);
$colors[] = imagecolorallocate($im2, 84, 63, 44);
// Match these colors with the true color image
imagecolormatch($im1, $im2);
// Free from memory
imagedestroy($im1);
imagedestroy($im2);
希望这段代码能帮助你..... – 2012-10-27 07:23:33
打开Visual Studio。 =>新建项目
选择Visual C#=>控制台应用程序
工具=> NuGet包管理器。 => Nuget解决方案包管理器
在浏览并安装下找到EmguCV。
下的Program.cs
using Emgu.CV;
using Emgu.CV.Structure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace diffOfImages
{
class Program
{
static void Main(string[] args)
{
Image<Bgr, byte> img1 = new Image<Bgr, byte>(@"d:\temp\temp1.jpg");
Image<Bgr, byte> img2 = new Image<Bgr, byte>(@"d:\temp\temp2.jpg");
var theDiff = img1.AbsDiff(img2);
theDiff.Save(@"d:\temp\theDiff.jpg");
}
}
}
按F5
或
看到https://www.raymond.cc/blog/how-to-compare-the-difference-between-two-identical-looking-images/
- 1. divs之间的2个像素差异
- 2. 两幅图像的图像比较
- 3. 2图像之间的百分比差异
- 4. 图像处理 - 2张图像之间的差异
- 5. Android java百分比位图两个图像之间的像素差异
- 6. 比较两幅图像
- 7. 我如何计算2幅图像之间的协方差?
- 8. Matlab的:比较2幅图像具有不同的尺寸和像素尺寸
- 9. 获取两幅图像之间差异的图像蒙版Emgu CV
- 10. 画布:像素值之间的差异
- 11. Matlab与Opencv之间的图像像素值差异
- 12. 使用OpenCV精确比较2个图像的差异
- 13. 比较图像以找出差异
- 14. 发现图像之间的差异
- 15. 计算图像之间的差异
- 16. 比较GIF图像像素
- 17. C#更快速地比较两个图像之间的像素并只写出差异
- 18. 图像差异:如何找出图像之间的细微差异?
- 19. 比较MATLAB中2个图像之间的交叉点
- 20. 图像之间的差距
- 21. 使用Python和PIL的两幅图像之间的均方根差异
- 22. 矩阵形式的像素OpenCV中的图像之间的差异
- 23. 比较差异POSIXct与单位,像difftime
- 24. 根据两幅图像(iPhone)之间的差异创建一个蒙版
- 25. 两幅图像之间的动画
- 26. 计算两幅图像之间的增益比率?
- 27. 2天之间的差异
- 28. 比较图像的呈现差异(忽略抗锯齿)
- 29. 使用相关系数在Python中的两幅图像之间的百分比差异
- 30. 快速比较两个位图对象每个像素的像素基数
东西,可以帮助人们帮助你:什么编程语言,我们谈论的,是如何图像代表,你只是想知道图像是不同的(结果是一个布尔值)或以某种方式计算比bool更微妙的东西是否表示图像有多像? – 2010-01-05 09:48:50
你想实现什么? – 2010-01-05 09:51:22
Bidimmentional Fourrier Transform可以帮助解决这种情况。 – alemjerus 2010-01-05 09:56:41