How to fix "At least two classes are required to complete the LDA"?

I am trying to run this sample with OpenCV, but I ran it:

./facerec_video haarcascade_frontalface_alt.xml csv_align -1 

gives me this error:

OpenCV error: invalid argument (at least two classes are required to run LDA. Reason: only one class is provided!) In the lda file, file / build / buildd / opencv -2.4.8 + dfsg1 / modules / contrib / src / lda.cpp line 1010 terminate call after calling the instance 'cv :: Exception' what (): / build / buildd / opencv-2.4.8 + dfsg1 / modules / contrib / src / lda.cpp: 1010: error: (-5) For LDA compliance requires at least two classes. Reason: Only one class was given! in lda function

How to fix it?

Ps .: xml is standard OpenCV , and csv is a two-image sample

+5
source share
1 answer

I had the same problem and decided to change the csv.ext file to this style:

C: \ Users \ FSB \ Desktop \ image1_20_20_70_70.jpg; 0 C: \ Users \ FSB \ Desktop \ face_20_20_70_70.jpg; 1

Check if your file matches this and try again.

0
source

Source: https://habr.com/ru/post/1200715/


All Articles