How to check if FaceRecognizer model is trained
When I call LBPHFaceRecognizer::predict method I get the following error: OpenCV Error: Bad argument (This LBPH model is not computed yet. Did you call the train method?)
Is it possible to check if model of LBPHFaceRecognizer is trained or not?
Simply said, did you actually use a piece of code that says
recognizer.train()
orrecognizer->train()
?no such function built in.
but yes, rather than testing, you'd want to make sure, that you either train it before, or load a serialized model. more a programming logic problem, imho.
I don't think so. Trained is internal state of FaceRecognizer's model, but not the state of my app.
And look at this http://docs.opencv.org/master/db/d7d/...
Here isTrained is presented, but unfortunately it is not related to models of FaceRecognizers
^^ well, right, StatModel's have it and this thing not.
so you want to make Trained an internal state of your own app, by checking the return value from
load()
or such and keeping that around