EigenFaceRecognizer with threshold returns Core Dumped!

asked 2013-01-29 04:47:16 -0500

ian57 gravatar image

updated 2013-01-30 07:26:05 -0500

Hello,

I'm using facerec class under linux with gtk. I'm using the 2.4.9 git release.

The EigenFaceRecognizer model is created like that :

Ptr<FaceRecognizer> m_model;
int num_components = 0;
double threshold = 1000.0;
m_model = createEigenFaceRecognizer(num_components,threshold);

when using it with

int predictionclass = -1;
double confidence = 0.0;
m_model->predict(face_resized, predictionclass, confidence);

it returns a core dumped. Tracing it, shows that the predict fonction is not filling correctly the confidence value (n1.7976931348623157e+308 which makes me think of DBL_MAX Value)

Using the predict fonction whithout threshold work well, using this init : m_model = createEigenFaceRecognizer();

AN idea?

Edit : I found my error, my value of threshold was too tiny and this code was never executed

if((dist < minDist) && (dist < _threshold)) {
    minDist = dist;
    minClass = _labels.at<int>((int)sampleIdx);

after my computing of %tage recongnition run into trouble with the print text function

string box_text = format("Who= %s-%d-%.2lf%%", m_names[predictionclass].c_str(), predictionclass,  100.0*(1.0 -confidence/(m_ROIWidth*m_ROIHeight)));
edit retag flag offensive close merge delete