Excuse the hasty code dump. I'm working with OpenCV at the moment. I've been stuck with an error for 2h.
- (IBAction)faceRecognition:(id)sender {
// load images
vector<Mat> images;
vector<int> labels;
int numberOfSubjects = 4;
int numberPhotosPerSubject = 3;
for (int i=1; i<=numberOfSubjects; i++) {
for (int j=1; j<=numberPhotosPerSubject; j++) {
// create grayscale images
Mat src = [self CreateIplImageFromUIImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d_%d.jpg", i, j]]];
Mat dst;
cv::cvtColor(src, dst, CV_BGR2GRAY);
images.push_back(dst);
labels.push_back(i);
}
}
// get test instances
Mat testSample = images[images.size() - 1];
int testLabel = labels[labels.size() - 1];
// ... and delete last element
images.pop_back();
labels.pop_back();
// build the Fisherfaces model
Fisherfaces model(images, labels);
// test model
int predicted = model.predict(testSample);
cout << "predicted class = " << predicted << endl;
cout << "actual class = " << testLabel << endl;
}
I can't figure out how to fix this:
Variable type 'cv::Fisherfaces' is an abstract class
It appears under "//build the Fisherfaces model" in the bottom.
Any assistance greatly appreciated.