2008-09-30 81 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"); 
}