0
A
回答
1
Computer Vision/Computer Graphics Collaboration Techniques
代碼在C#中比較兩個圖像
public bool doImagesMatch(ref Bitmap bmp1, ref Bitmap bmp2)
{
try
{
//create instance or System.Drawing.ImageConverter to convert
//each image to a byte array
ImageConverter converter = new ImageConverter();
//create 2 byte arrays, one for each image
byte[] imgBytes1 = new byte[1];
byte[] imgBytes2 = new byte[1];
//convert images to byte array
imgBytes1 = (byte[])converter.ConvertTo(bmp1, imgBytes2.GetType());
imgBytes2 = (byte[])converter.ConvertTo(bmp2, imgBytes1.GetType());
//now compute a hash for each image from the byte arrays
SHA256Managed sha = new SHA256Managed();
byte[] imgHash1 = sha.ComputeHash(imgBytes1);
byte[] imgHash2 = sha.ComputeHash(imgBytes2);
//now let's compare the hashes
for (int i = 0; i < imgHash1.Length && i < imgHash2.Length; i++)
{
//loops, found a non-match, exit the loop
//with a false value
if (!(imgHash1[i] == imgHash2[i]))
return false;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return false;
}
//we made it this far so the images must match
return true;
}
+0
我們如何突出顯示不同於原始圖像的不同部分。我想比較兩個X射線圖像。 – Priya 2011-05-04 11:29:10
相關問題
- 1. 算法比較兩個圖像與模式 - Python
- 2. 算法的圖像比較
- 3. 比較圖像的算法
- 4. 圖像比較算法
- 5. 將兩個圖像與ImageMagick比較
- 6. 使用不安全的方法比較兩個圖像數據
- 7. 用於比較圖算法的Java
- 8. OSX:比較兩個圖像
- 9. 比較兩個圖像android
- 10. 比較兩個類對象與方法
- 11. 比較兩個使用已知算法
- 12. 兩種算法的比較
- 13. 在Python中比較兩個圖像的簡單方法
- 14. 最快的方法來比較兩個圖像
- 15. 用於比較兩個列表的算法
- 16. 使用OpenCV比較兩個圖像
- 17. 使用直方圖比較兩個圖像
- 18. 如何比較兩種圖像縮放算法的「質量」?
- 19. 用於比較兩個圖像中重疊的工作流程?
- 20. 比較兩個圖像圖標?
- 21. 比較兩個矢量方向MATLAB
- 22. 比較Android中的兩個圖像
- 23. 比較圖像的兩個座標值
- 24. 比較低質量的兩個圖像
- 25. 比較IOS中的兩個圖像8
- 26. 兩幅圖像的圖像比較
- 27. 用於運行時比較兩個程序對象的方法
- 28. 如何比較圖像的兩個直方圖?
- 29. Android-Stuck與兩個視圖的比較
- 30. 比較兩幅圖像
4位方向或角度?帶有角度的 – oliholz 2011-05-04 10:48:26
。它應該比較兩張X射線圖像 – Priya 2011-05-04 10:51:22