Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8484385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:22:00+00:00 2026-06-10T20:22:00+00:00

I just recognized some faces with cv2.createEigenFaceRecognizer . But what I want is to

  • 0

I just recognized some faces with cv2.createEigenFaceRecognizer.
But what I want is to know how much the input face looks like the calculated eigenfaces.
The idea is that you can rerecognize persons that are not in the database.

EDIT:

for example: I have face A, B and C trained on my model, then I see face C and D. I want to be able to differentiate face C from D.

thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:22:02+00:00Added an answer on June 10, 2026 at 8:22 pm

    You can find a section on setting thresholds in the documentation on cv::FaceRecognizer at:

    • http://docs.opencv.org/trunk/modules/contrib/doc/facerec/facerec_api.html#setting-the-thresholds

    It works just the same for the OpenCV Python Wrapper, which you can easily see when calling help(cv2.createFaceRecognizer) in Python:

    Help on built-in function createEigenFaceRecognizer in module cv2:
    
    createEigenFaceRecognizer(...)
        createEigenFaceRecognizer([, num_components[, threshold]]) -> retval
    

    So in the code you would create the model with a threshold, I’ll set it to 100.0. Anything below this will yield -1 in the prediction, which means this face is unknown:

    # Create the Eigenfaces model. We are going to use the default
    # parameters for this simple example, please read the documentation
    # for thresholding:
    model = cv2.createEigenFaceRecognizer(threshold=100.0)
    

    As shown in the demo, you can get the prediction and associated confidence (which is the distance to the nearest neighbor in the your training dataset) with:

    [predicted_label, predicted_confidence] = model.predict(image)
    

    So if you train your model on the subjects A, B, C AND you are using a threshold, then a prediction for D should yield -1, while A, B or C should be recognized. Given the fact, that you are using a threshold.

    As for adding new faces iteratively without re-estimating the whole model. This is not possible for the Eigenfaces or Fisherfaces method. You always have to call FaceRecognizer::train for these two algorithms to learn the model. The Local Binary Patterns Histograms (LBPH) model, which you can create with cv2.createLBPHFaceRecognizer, supports updating a model without recalculating the other training samples. See the API Documentation on this:

    • http://docs.opencv.org/trunk/modules/contrib/doc/facerec/facerec_api.html#facerecognizer-update
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if maybe there are some good solutions to handling
Some icons are pretty much universally recognized by now. Examples that come to mind
I'd like to display some XML in the browser, but add some custom color
Just checking my JS and I have an error, but I cannot see where.
Just learning the world of jquery, and all my googling gives examples like this:
Just a knowledge question which I would like to ask: For example, I have
Given an input of 2D points, I would like to segment them in lines.
Just started a tutorial in SQL for beginners. I'm doing some exercises now and
I have asked this question before and used the soln but for some reason
I've got some Java Applet that I'd like to use to upload file/files to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.