FacemarkLBF Params model_filename error
Hi there OpenCv community!
I'm brand new to OpenCV and I've been trying to build a real time face tracking app using Landmark (from the OpenCV contrib)
And when I try to create my facemark ptr, I give it a FacemarkLBF::Params variable. The issue is that the model_filename variable in the Params struct has an error of "Error reading characters of string" when I create the params. Therefore if I try to access the model_filename the program crashes with a read access violation error.
Is this a known issue? I am using OpenCV 3.4.3 and the latest version of the OpenCV contrib from Github.
Here is the code:
//create instance of lbf facemark model
cv::face::FacemarkLBF::Params params{};
params.n_landmarks = 68; // number of landmark points
params.initShape_n = 10; // number of multiplier for make data augmentation
params.stages_n = 5; // amount of refinement stages
params.tree_n = 6; // number of tree in the model for each landmark point
params.tree_depth = 5; //he depth of decision tree
std::string name{ "lbfmodel.yaml" };
params.model_filename = name.c_str(); //path name to saved lbf facemark model
cv::Ptr<cv::face::Facemark> facemark = cv::face::FacemarkLBF::create(params);
facemark->loadModel("lbfmodel.yaml");
Done, replaced the image with text! :)
thanks for the edit !
did you really want to train a new model ? (else you don't need the "Params" at all)
Nope, the lbfmodel is trained I believe. So I'm just trying to use the trained model to create the landmarks on the face
As far as I understand I need the parameters to create the facemark variable?
no, you can use
createFacemarkLBF()
without params.