node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

FaceRecognizer predictSync to return array of closest matching faces

Open enijar opened this issue 8 years ago • 5 comments

This is a "Help wanted" issue.

Is there a method on the FaceRecognizer.{algorithm} object to return an array of objects where I can then order them by confidence (lowest to highest).

I'm using predictSync to get the closest matching image in the trained data set; this is working great.

// Run image over trained data.
var faceRecognition = cv.FaceRecognizer.createEigenFaceRecognizer();
faceRecognition.loadSync(path.join(__dirname, 'data/ORL'));

// Get the best prediction.
var whoIsIt = faceRecognition.predictSync(image);
console.log('Identified image', whoIsIt);

enijar avatar Oct 31 '16 19:10 enijar

You need this https://www.npmjs.com/package/array-sort

0vulns avatar Nov 17 '16 19:11 0vulns

@xc0d3rz I don't need to sort an array. The predictSync method only returns one item, not an array.

enijar avatar Nov 18 '16 18:11 enijar

OpenCV Error: Unspecified error (This Eigenfaces model is not computed yet. Did you call Eigenfaces::train?) in cv::Eigenfaces::predict, file C:\builds\2_4_PackSlave-win64-vc12-shared\opencv\modules\contrib\src\facerec.cpp, line 485 what is going on with "var faceRecognition = cv.FaceRecognizer.createEigenFaceRecognizer(); var whoIsIt = faceRecognition.predictSync(im);" cv.FaceRecognizer or cv.FaceRecognizer.createEagen...... is not working in opencv 2.4.13???? or i am facing another issue??? mean to say liberary configuration???

kpkpt avatar Jan 09 '17 13:01 kpkpt

@kpkpt I already did the training. I didn't include the training code in the issue since it wasn't relevant. data/ORL is the training file.

Everything works perfectly, I just need the returned data to me an array of all images with their matching percentages next to each. Hope this makes sense.

enijar avatar Feb 03 '17 19:02 enijar

Any news on getting this to return a confidence rating for all images?

enijar avatar May 28 '17 14:05 enijar