使用opencv_traincascade训练Haar、HOG、LBP Adaboost分类器
opencv_traincascade.exe默認表格
訓練正樣本2400,負樣本3300
1.opencv_traincascade.exe ?-data traincascade -vec pos.vec -bg neg.txt -numPos 2000 -numNeg 3300 -numStages 20 -precalcValBufSize 200 -precalcIdxBufSize 1000
?-featureType LBP -w 18 -h 24 -bt GAB -minHitRate 0.95 -maxFalseAlarmRate 0.5 -weightTrimRate 0.95 -maxDepth 1 -maxWeakCount 100
如果出現?Parameters can not be written, because file traincascade/params.xml can not be opened 錯誤
則自己需要手動創建一個文件夾 traincascade
2.如果出現如下問題.
Traincascade Error:Bad argument(Can not get new positive sample.The most possible reason is insufficient count of samples in given vec-file.
記得一定要numPos小于vec_file文件里面的數 一般numPos為0.9*num_in_vec或者為0.8*num_in_vec
具體講解可以參考?http://answers.opencv.org/question/4368/traincascade-error-bad-argument-can-not-get-new/
總結
以上是生活随笔為你收集整理的使用opencv_traincascade训练Haar、HOG、LBP Adaboost分类器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Vector容器与Iterator迭加器
- 下一篇: C++运行程序出现的一些问题