Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/face/include/opencv2/face.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class CV_EXPORTS_W FaceRecognizer : public Algorithm
@param src The training images, that means the faces you want to learn. The data has to be
given as a vector\<Mat\>.
@param labels The labels corresponding to the images have to be given either as a vector\<int\>
or a
or a Mat of type CV_32SC1.

The following source code snippet shows you how to learn a Fisherfaces model on a given set of
images. The images are read with imread and pushed into a std::vector\<Mat\>. The labels of each
Expand All @@ -175,6 +175,8 @@ class CV_EXPORTS_W FaceRecognizer : public Algorithm
// holds images and labels
vector<Mat> images;
vector<int> labels;
// using Mat of type CV_32SC1
// Mat labels(number_of_samples, 1, CV_32SC1);
// images for first person
images.push_back(imread("person0/0.jpg", CV_LOAD_IMAGE_GRAYSCALE)); labels.push_back(0);
images.push_back(imread("person0/1.jpg", CV_LOAD_IMAGE_GRAYSCALE)); labels.push_back(0);
Expand Down Expand Up @@ -211,7 +213,7 @@ class CV_EXPORTS_W FaceRecognizer : public Algorithm
@param src The training images, that means the faces you want to learn. The data has to be given
as a vector\<Mat\>.
@param labels The labels corresponding to the images have to be given either as a vector\<int\> or
a
a Mat of type CV_32SC1.

This method updates a (probably trained) FaceRecognizer, but only if the algorithm supports it. The
Local Binary Patterns Histograms (LBPH) recognizer (see createLBPHFaceRecognizer) can be updated.
Expand Down