如何根據像素差異找到兩幅圖像之間的差異?基於像素比較的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