Ask Your Question

Face Recognition using webcam and picture on passport

asked 2017-12-11 07:35:01 -0500

I try to recognize person's image on passport and compare it with images captured from webcam.

I first collect 20-30 images from webcam to train face recognizer. I then call predict method of face recognizer. However I get very inaccurate results. I tried LBPFaceRecognizer and EigenFaceRecognizer but the result is almost same. How can I improve my results' accuracy?


edit retag flag offensive close merge delete


what are you trying to achieve ?

opencv's face recognition classes are for identification (closest from a database). if you wanted authentification (is that me?) from a few images, or verification (are the persons in 2 images the same ?) -- it's entirely the wrong tool.

berak gravatar imageberak ( 2017-12-11 07:52:46 -0500 )edit

also, passports often have holograms superimposed, a coated surface (specular reflections), and whatnot.

berak gravatar imageberak ( 2017-12-11 08:30:41 -0500 )edit

@berak.The passports photo often isn't holograms superimposed. Mostly @ airports are using OpenCV.

supra56 gravatar imagesupra56 ( 2017-12-11 10:30:55 -0500 )edit

@berak I want to achieve verification. I want user to scan his/her passport on a small scanner and look at webcam in order to verify that the person in webcam is the same person on passport. I think holograms are not a big problem, because in the scanned image holograms are weak and have less effect (?) Are OpenCV FaceRecognizer classes right tool? If yes, how?

kahlenberg gravatar imagekahlenberg ( 2017-12-11 11:41:13 -0500 )edit

in that case - forget opencv's face recognition classes, theywere not meant to do that.

have a look here . and you won't find anything (for free) ready made for this purpose, i guess.

really, that's still bleeding edge research stuff. expect a lot of work, and quite some frustration.

berak gravatar imageberak ( 2017-12-11 11:43:38 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-12-11 08:13:49 -0500

supra56 gravatar image

updated 2017-12-11 08:14:47 -0500

For OpenCV 3.3.1

recognizer = cv2.createLBPHFaceRecognizer()
test = cv2.face.createEigenFaceRecognizer()
edit flag offensive delete link more


I think the OP already knows how to do this. Your response is telling them how to instantiate (create) the respective face recognizer and the OP is asking how to improve the results attained from the recognizers.

eshirima gravatar imageeshirima ( 2017-12-11 08:43:19 -0500 )edit

@eshirima. I had this LBPFaceRecognizer before OpenCV 3.0.0 (2014) . And it was working fine. But, when OpenCV released 3.1.0., it wasn't working. So I had to figured out to work around. But now I had to search on google that was solved my problem. But I am not telling them to used createLBPFaceRecognizer or LBPFaceRecognizer. It is up to user(s) to desired which one to get it working.

supra56 gravatar imagesupra56 ( 2017-12-11 10:18:08 -0500 )edit

@eshirima. I have been helping programmers around the world to get code working. I have been successfully helped them.

supra56 gravatar imagesupra56 ( 2017-12-11 10:24:49 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2017-12-11 07:34:17 -0500

Seen: 441 times

Last updated: Dec 11 '17