alternatively, you could use opencv's new dnn module with a pretrained FaceNet model for face recognition:
dnn::Net net = dnn::readNetFromTorch("openface.nn4.small2.v1.t7");
// https://raw.githubusercontent.com/pyannote/pyannote-data/master/openface.nn4.small2.v1.t7
Mat inputBlob = dnn::blobFromImage(image, 1./255, Size(96,96), Scalar(), true, false);
net.setInput(inputBlob);
Mat feature = net.forward().clone();
edit:
careful here, the output of net.forward() points to the last (internal) network blob, so we need a clone() to get distinctive results !
then, use those 128 float feature vectors, to simply compare images :
double distance = norm(feature1, feature2);
or, train your favourite ml or clustering algorithm using those.
BUT IF FaceRecognizer was removed from Opencv3.4.0 why when I used SharpOpenCv why still it was there? Confusing...
problem solved, I included the /modules/contrib(of opencv24.13.5) folder to /modules(of opencv3.4.0), and build a x86 dlls and libs :D then going to use it for my c++ builder experiments along with dll wrappers.
but I'm interested to see how DNN is accurately good for face recognition as @berak and @phillity suggestions,
thank you Masters, so grateful that you replied :D
oh men, contrib dll was not compiled, tsk..tsk..
error this is a compatibility header which should not be used inside the OpenCV library
lol