C# .NET 有没有好的图像识别库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/152028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Are there any OK image recognition libraries for .NET?
提问by RodgerB
I want to be able to compare an image taken from a webcam to an image stored on my computer.
我希望能够将从网络摄像头拍摄的图像与存储在我的计算机上的图像进行比较。
The library doesn't need to be one hundred percent accurate as it won't be used in anything mission critical (e.g. police investigation), I just want something OK I can work with.
图书馆不需要百分百准确,因为它不会用于任何关键任务(例如警察调查),我只想要一些我可以使用的东西。
I have tried a demonstration project for Image Recognition from CodeProject, and it only works with small images / doesn't work at all when I compare an exact same image 120x90 pixels (this is not classified as OK :P ).
我已经尝试了CodeProject 的图像识别演示项目,它只适用于小图像/当我比较完全相同的 120x90 像素图像时它根本不起作用(这不被归类为 OK :P )。
Has there been any success with image recognition before?
之前有没有在图像识别方面取得成功?
If so, would you be able to provide a link to a library I could use in either C# or VB.NET?
如果是这样,您能否提供一个指向我可以在 C# 或 VB.NET 中使用的库的链接?
采纳答案by mattlant
You could try this: http://code.google.com/p/aforge/
你可以试试这个:http: //code.google.com/p/aforge/
It includes a comparison analysis that will give you a score. There are many other great imaging features of all types included as well.
它包括一个比较分析,会给你一个分数。还包括所有类型的许多其他出色的成像功能。
// 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
}
回答by Hydarnes
I did it simply. Just download the EyeOpen library here. Then use it in your C# class and write this:
我做的很简单。只需在此处下载 EyeOpen 库。然后在您的 C# 类中使用它并编写:
use eyeopen.imaging.processing
Write
写
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");
}