FaceRecognizer interface - changes to 3.0.0
Downloaded the stable 3.0.0 release
// Get the eigen data that is available
Mat eigenvalues = face_model->getMat("eigenvalues");
Mat W = face_model->getMat("eigenvectors");
Mat mean = face_model->getMat("mean");
// Display the Eigenfaces:
for (int i = 0; i < min(10, W.cols); i++) {
Mat ev = W.col(i).clone();
Mat grayscale = norm_0_255(ev.reshape(1, test_faces[0].rows));
Mat cgrayscale;
applyColorMap(grayscale, cgrayscale, COLORMAP_JET);
imshow(format("eigenface_%d", i), cgrayscale);
}
This code worked before, as stated in the tutorial : http://docs.opencv.org/3.0-last-rst/m...
But now it seems that the getMat function is gone and replaced getLabelInfoByString. However that one returns a vector of values instead of a Mat element. Anybody has gotten the visualisation to work again?
just saying, the (rst generated)docs page you refer to was generated in december 2014, the cv::Algorithm based getMat(string) interface was removed in the meantime
please try the more up-to-date example here
(sidenote:) if you've kept a
Ptr<FaceRecognizer> fr = ...
or such but your thing is actually a Fisher one, you'll have to use :Ptr<FisherFaceRecognizer> pf = pr.dynamicCast<FisherFaceRecognizer>()
or similarWell yes and I tracked it down to it being replaced by getLabelInfoByString, but the tutorial instructions are not updated yet. I am trying to find a way of generating the same pictures as in that guide.
Since the latest one still got the errors --> http://docs.opencv.org/master/da/d60/...
@berak Aha thank you! Someone should change the guidelines also :D
Oh damn, working on the 3.0.0 release and there those functions do not exist yet -_- I will dig in tomorrow to see what I can do.
"Someone should change the guidelines also" - let's keep it in mind, and pester maxsim again, once he finishes transferring the whole wiki things to github ;)
well, about your link there - well, you know, what to do ..