How to pass and get the model from function parameter? Copy constructor doesn’t work for me and show a compiler error: |Error|C2665|'std::shared_ptr<T>::shared_ptr': no overloaded function could convert all the argument types
with a bit of backlog from your previous questions, i think, it’s safe to assume, that you want to perform something like this:
so we need evecs & mean, and you try to get them from a Ptr<FaceRecognizer> , while it would need Ptr<EigenFaceRecognizer> or similar.
you cannot simply assign pointers of different type (see your error msg above !)
this is an ‘downcast’ and requires a dynamic_cast , or in the case of shared_ptr you even need a dynamic_pointer_cast (see ex. at the end !)
but IF you ever need this, you have a flawed design here – you created an EigenFaceRecognizer, now you need an EigenFaceRecognizer but you don’t have one. why and where did you lose the specific type ?
probably the best solution is, to get evecs & mean, while you have the correct class instance
then, there is no special LDA reconstruction, you can only reproject from eigenspace, means: you don’t even need seperate EigenFace / FisherFace class pointers. use this derived class instead: