Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
829 views
in Technique[技术] by (71.8m points)

c# - Using EigenObjectRecognizer

I am trying to do some facial recognition using EmguCV. I was wondering if I can use EigenObjectRecognizer for this task? Can someone can explain me how to use it? Because if there is a no no-match photo, it also returns a value. Here is an example:

    Image<Gray, Byte>[] trainingImages = new Image<Gray,Byte>[5];  
        trainingImages[0] = new Image<Gray, byte>("brad.jpg");
        trainingImages[1] = new Image<Gray, byte>("david.jpg");
        trainingImages[2] = new Image<Gray, byte>("foof.jpg");
        trainingImages[3] = new Image<Gray, byte>("irfan.jpg");
        trainingImages[4] = new Image<Gray, byte>("joel.jpg");
 String[] labels = new String[] { "Brad", "David", "Foof", "Irfan" , "Joel"}
  MCvTermCriteria termCrit = new MCvTermCriteria(16, 0.001); 

    EigenObjectRecognizer recognizer = new EigenObjectRecognizer(
       trainingImages,
       labels,
       5000,
       ref termCrit);
        Image<Gray,Byte> testImage = new Image<Gray,Byte>("brad_test.jpg");

     String label = recognizer.Recognize(testImage);
     Console.Write(label);

It returns "brad" .But if I change photo in testimage it also returns some name or even Brad.Is it good for face recognition to use this method? Or is there any better method?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I made some practice and found that when it does not found it returns empty string. Changing value 5000 to 1000 it gives more close value but ?f you are us?ng web cam your photo for testing and in database must be almost same .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...