Closed Toquet closed 6 years ago
These things (the dlib stuff and openCV tools) have nothing to do with each other. You just have a bug in your code somewhere and it's corrupting the outputs. Maybe you have some kind of memory error. The code you posted has a bunch of raw pointers so that's not helping you. C++ isn't C. You shouldn't have raw pointers or be doing manual memory management.
I thought it was a memory leak also. However I found an interesting thing: when I run your example program dnn_face_recognition_ex.cpp, everything works fine, the outputs are always the same for the same inputs. However, when I include opencv and I declare a cv::VideoCapture in it, the outputs become random:
cv::VideoCapture video(0);
video.release();
I really believe that there is something strange between the two librairies but I can't find what.
Maybe there is a bug in opencv or you compiled it in some bad way. I don't know. There are no interactions between dlib and opencv though.
Ok thank you for the answers !
Just to let you know the end of the story: The issue was caused by the fact that my python libraries were interacting with the c++ ones. I just uninstalled them and reinstalled only the c++ lib and it solved the issue. So you were right! Thank you.
Hello, I am currently working on a project (in c++) that aims at doing face recognition on images coming from a webcam. In order to do so, I use the opencv library which seems to cause issues during the dlib face encoding part:
Expected Behavior
The algorithm is as follow:
As mentioned I need to store the arrays of the known persons before doing the recognition with the webcam. This is where strange things happen:
Current Behavior
It may not be really clear with text so I hope the following code will be more explicit:
Steps to Reproduce
Main, Create a recognizer class that I defined and then call the function that should save the arrays of the known faces:
Then as soon as I add the following line, the result of the encoding seems to be random:
cv::VideoCapture video(0);
training_function (Loop on images present in a folder):