Face Recognition in Video using OpenCV gives unhandled exception

ⅰ亾dé卋堺 提交于 2019-12-05 04:46:25

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 and fix accordingly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!