Constructor
obj = cv.BasicFaceRecognizer(ftype)
obj = cv.BasicFaceRecognizer(ftype, 'OptionName',optionValue, ...)
Input
- ftype Face recognizer type. One of:
- Eigenfaces Face Recognizer based on Eigenfaces.
- Fisherfaces Face Recognizer based on Fisherfaces.
Options
- NumComponents The number of components, default 0.
- Eigenfaces The number of components kept for this
Principal Component Analysis. As a hint: There's no rule how
many components (read: Eigenfaces) should be kept for good
reconstruction capabilities. It is based on your input data,
so experiment with the number. Keeping 80 components should
almost always be sufficient.
- Fisherfaces The number of components kept for this
Linear Discriminant Analysis with the Fisherfaces criterion.
It's useful to keep all components, that means the number of
your classes
c
(read: subjects, persons you want to
recognize). If you leave this at the default (0) or set it
to a value less-equal 0 or greater (c-1
), it will be set
to the correct number (c-1
) automatically.
- Threshold The threshold applied in the prediction. If the
distance to the nearest neighbor is larger than the threshold,
the prediction returns -1. default
realmax
Notes
- Training and prediction must be done on grayscale images, use
cv.cvtColor to convert between the color spaces.
- THE EIGENFACES/FISHERFACES METHOD MAKES THE ASSUMPTION, THAT
THE TRAINING AND TEST IMAGES ARE OF EQUAL SIZE. (caps-lock,
because I got so many mails asking for this). You have to make
sure your input data has the correct shape, else a meaningful
exception is thrown. Use cv.resize to resize the images.
- This model does not support updating.