Ask Your Question

Revision history [back]

As we have already concluded by mail. This happens, because only one label is given in your CSV file:

C:\Training\extract0.jpg;0
C:\Training\extract1.jpg;0
C:\Training\extract2.jpg;0

The Fisherfaces method needs at least two classes to learn a model. This case should have been caught and OpenCV 2.4.2 throws the following exception on my system:

OpenCV Error: Bad argument (At least two classes are needed to perform a LDA. Reason: Only one class was given!) in lda, file /home/philipp/github/libfacerec/src/subspace.cpp, line 150
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/philipp/github/libfacerec/src/subspace.cpp:150: error: (-5) At least two classes are needed to perform a LDA. Reason: Only one class was given! in function lda

Which makes the error in the training data quite clear. I don't know, why this exception isn't thrown on your Windows 7 installation, but I'll set up a test system to reproduce as soon as possible.

As we have already concluded by mail. This happens, because only one label is given in your CSV file:

C:\Training\extract0.jpg;0
C:\Training\extract1.jpg;0
C:\Training\extract2.jpg;0

The Fisherfaces method needs at least two classes to learn a model. This case should have been caught and OpenCV 2.4.2 throws the following exception on my system:

OpenCV Error: Bad argument (At least two classes are needed to perform a LDA. Reason: Only one class was given!) in lda, file /home/philipp/github/libfacerec/src/subspace.cpp, line 150
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/philipp/github/libfacerec/src/subspace.cpp:150: error: (-5) At least two classes are needed to perform a LDA. Reason: Only one class was given! in function lda

Which makes the error in the training data quite clear. I don't know, why this exception isn't thrown on your Windows 7 installation, but I'll set up a test system to reproduce as soon as possible.possible and fix accordingly.

As we have already concluded by mail. This happens, because only one label is given in your CSV file:

C:\Training\extract0.jpg;0
C:\Training\extract1.jpg;0
C:\Training\extract2.jpg;0

The Fisherfaces method needs at least two classes to learn a model. This case should have been caught and OpenCV 2.4.2 throws the following exception on my system:

OpenCV Error: Bad argument (At least two classes are needed to perform a LDA. Reason: Only one class was given!) in lda, file /home/philipp/github/libfacerec/src/subspace.cpp, line 150
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/philipp/github/libfacerec/src/subspace.cpp:150: error: (-5) At least two classes are needed to perform a LDA. Reason: Only one class was given! in function lda

Which makes describes the error in reasons for not learning a Fisherfaces model and is probably the training data quite clear. I don't know, why this same exception isn't thrown on your Windows 7 installation, but I'll set up a test system to reproduce as soon as possible and fix accordingly.you encounter.