Error Open.CV save file

0

Good morning, I have the following code:

var faceImage = new Image<Gray, byte>(new Bitmap(bm));
                imagensFace[i] = faceImage.Resize(100, 100, Inter.Cubic);
                faceLabels[i] = todasFaces[i].ID;
            }
            faceRecognizer.Train(imagensFace, faceLabels);
            faceRecognizer.Save("C:/Temp");

However when passing in the part that saves the faceRecognizer the following error is pointed out: Emv.CV.Util.CvException: 'OpenCV: File can not be opened for writing!'

Below is the declaration of faceRecognizer:

FaceRecognizer faceRecognizer = new EigenFaceRecognizer(80, double.PositiveInfinity);

If someone can help me, I appreciate it.

    
asked by anonymous 05.11.2017 / 14:08

1 answer

2

The library may be able to interpret / in the file path, but normal \ .

You can try:

faceRecognizer.Save("C:\Temp");

or

faceRecognizer.Save("C:\Users\User\Documents\Emgu\Teste.yml");
Another (most likely) situation is that because you are saving in C :, the operating system asks for elevation of privileges, you can solve this by changing the location where you will save the file by putting in documents, images, desktop. .. or elevate the execution of visual studio, the famous Executar como administrador

    
05.11.2017 / 14:12