I solved it, it seems that if you use Ptr<BasicFaceRecognizer> face_model = createEigenFaceRecognizer(); that it works, but if you use Ptr<FaceRecognizer> face_model = createEigenFaceRecognizer(); that it doesnt. You just have to get to find it :D