gpt4 book ai didi

c++ - 如何修复 "At least two classes are needed to perform a LDA"?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:50:59 26 4
gpt4 key购买 nike

我正在尝试运行 this使用 OpenCV 采样,但运行它:

./facerec_video haarcascade_frontalface_alt.xml csv_align -1  

给我这个错误:

OpenCV Error: Bad argument (At least two classes are needed to perform a LDA. Reason: Only one class was given!) in lda, file /build/buildd/opencv-2.4.8+dfsg1/modules/contrib/src/lda.cpp, line 1010 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.4.8+dfsg1/modules/contrib/src/lda.cpp:1010: error: (-5) At least two classes are needed to perform a LDA. Reason: Only one class was given! in function lda

我该如何解决?

Ps.: xml是标准的OpenCV,csv是2张图片的样本

最佳答案

我有同样的问题,我解决了将我的 csv.ext 文件更改为这种样式:

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

检查您的文件是否符合此要求,然后重试。

关于c++ - 如何修复 "At least two classes are needed to perform a LDA"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25395798/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com