2008-09-30 80 views
51

我希望能够将从网络摄像头拍摄的图像与存储在我的电脑上的图像进行比较。.NET是否有任何好的图像识别库?

这个库不需要百分百的准确,因为它不会被用在任何关键任务(例如警方调查)中,我只想要一些我可以使用的东西。

我试过Image Recognition from CodeProject的示范项目,它只适用于小图像/根本不工作,当我比较完全相同的图像120x90像素(这不是分类为OK:P)。

以前有没有成功的图像识别?

如果是这样,你能提供一个链接到我可以在C#或VB.NET中使用的库吗?

+0

它肯定有比这更大的影像作品,必须有一些其他的问题,可能的格式。 – 2010-01-25 15:59:41

回答

68

你可以试试这个:http://code.google.com/p/aforge/

它包括一个比较分析,会给你一个分数。还包括所有类型的许多其他伟大的成像功能。

// The class also can be used to get similarity level between two image of the same size, which can be useful to get information about how different/similar are images: 
// Create template matching algorithm's instance 

// Use zero similarity to make sure algorithm will provide anything 
ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0); 

// Compare two images 
TemplateMatch[] matchings = tm.ProcessImage(image1, image2); 

// Check similarity level 
if (matchings[0].Similarity > 0.95) 
{ 
    // Do something with quite similar images 
} 
+0

听起来不错!让我们希望它按预期工作......如果有答案,我会将您的答案标记为已接受。 :) – RodgerB 2008-09-30 07:27:22

+7

它绝对精彩! 比较自己的图像有100%的相似性,对我坐在椅子上直立,我倾斜到左侧91%。 这是我所希望的一切,谢谢十亿:) – RodgerB 2008-09-30 08:43:07

3

我做到了。只需下载EyeOpen库here。 然后在你的C#类使用它,这样写:

use eyeopen.imaging.processing 

ComparableImage cc; 

ComparableImage pc; 

int sim; 

void compare(object sender, EventArgs e){ 

    pc = new ComparableImage(new FileInfo(files)); 

    cc = new ComparableImage(new FileInfo(file)); 

    pc.CalculateSimilarity(cc); 

    sim = pc.CalculateSimilarity(cc); 

    int sim2 = sim*100 

    Messagebox.show(sim2 + "% similar"); 
}