Image<Gray, Byte>[] trainingImages = new Image<Gray,Byte>[5];
trainingImages[0] = new Image<Gray, byte>("MyPic.jpg");
String[] labels = new String[] { "mine"}
MCvTermCriteria termCrit = new MCvTermCriteria(1, 0.001);
EigenObjectRecognizer recognizer = new EigenObjectRecognizer(
trainingImages,
labels,
1000,
ref termCrit);
Image<Gray,Byte> testImage = new Image<Gray,Byte>("sample_photo.jpg");
var result= recognizer.Recognize(testImage);
result.label总是为它检测到的每个面返回字符串“mine”(训练图像的标签)。 result.label必须是在两个图像中检测到的面相同时返回的,而是为每个面返回相同的标签。
我的代码有什么问题。