Ask Your Question

Revision history [back]

Where should I use OpenCV LBPHFaceRecognizer parameters

I am putting together a face recognition system using LBPHFaceREcognizer. I trained the system using default parameters:

recognizer = cv2.face.LBPHFaceRecognizer_create()

However, when I attempt to run identification on a different set of images of the same faces, using:

recognizer = cv2.face.LBPHFaceRecognizer_create(radius=4,neighbors=4, grid_x=4, grid_y=4,threshold=1000)

and

recognizer = cv2.face.LBPHFaceRecognizer_create(radius=8, neighbors=8, grid_x=8, grid_y=8, threshold=1000)

I get exactly the same confidence results every time regardless of the parameters I input. for example I attained the following results with both set of parameters as detailed above:

Image = dali_lama/0204_01.jpg, Predicted Name = Iannucci_armando, Confidence = 59.129611139955756
Image = dali_lama/0033_01.jpg, Predicted Name = dali_lama, Confidence = 35.95033592186442
Image = dali_lama/0014_01.jpg, Predicted Name = dali_lama, Confidence = 46.484885999676436
Image = adhyayan_suman/0054_01.jpg, Predicted Name = adhyayan_suman, Confidence = 42.50891337386948
Image = adhyayan_suman/0232_02.jpg, Predicted Name = adhyayan_suman, Confidence = -6.288158556775386
Image = adhyayan_suman/0024_01.jpg, Predicted Name = adhyayan_suman, Confidence = -2.7751504927476702
Image = adhyayan_suman/0138_01.jpg, Predicted Name = adhyayan_suman, Confidence = 9.082155772773092

I was expecting the identification parameters to affect the outcome but they do not seem to have any effect whatsoever. However, the same parameters when used in training do have an effect. Can someone please enlighten me as what I should be expecting and / or where I'm going wrong.