gpt4 book ai didi

c# - 如何比较两个指纹?

转载 作者:太空宇宙 更新时间:2023-11-03 12:15:32 24 4
gpt4 key购买 nike

我正在开发生物识别考勤系统。我在比较两个指纹的像素时遇到问题。

bmp1 = new Bitmap(pictureBox1.Image);
bmp2 = new Bitmap(pictureBox2.Image);

int wid = Math.Min(bmp1.Width, bmp2.Width);
int hgt = Math.Min(bmp1.Height, bmp2.Height);
Bitmap bmp3 = new Bitmap(wid, hgt);
//create the differences images
bool are_identical = true;
Color eq_color = Color.White;
Color ne_color = Color.Red;

for (int x = 0; x < wid; x++)
{
for (int y = 0; y < hgt; y++)
{
if (bmp1.GetPixel(x, y).Equals(bmp2.GetPixel(x, y)))
bmp3.SetPixel(x, y, eq_color);
else
{
bmp3.SetPixel(x, y, ne_color);
are_identical = false;
}
}
}

// Display the result.
pictureBox3.Image = bmp3;

this.Cursor = Cursors.Default;
if ((bmp1.Width != bmp2.Width) || (bmp1.Height != bmp2.Height)) are_identical = false;
if (are_identical)
MessageBox.Show("The images are identical");
else
MessageBox.Show("The images are different");

最佳答案

指纹识别不是这样工作的。通常,这些系统会评估指纹的独特特征,而不仅仅是比较图像像素。如果您以正确的方式进行操作,则必须使用指纹识别 SDK。

但是,如果您需要比较两个图像,您可以使用图像处理库(例如 emgucv)来完成。

同样,有无数种方法可以进行图像比较。一种简单的方法是使用直方图比较。 emgucv 提出了cvCompareHist 方法,可用于直方图比较。

关于c# - 如何比较两个指纹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49957933/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com