這是我第一次使用opencv的haartraining。OpenCV Haartraining不會永遠完成
僅供練習,我使用了35張正面圖像和45張負面圖像。
但是當我嘗試從數據到訓練,它不會永遠完成,
即使參數都極爲調整。
(分命中率= 0.001,最大的誤報率= 0.999
我不認爲它會佔用大量的時間,因爲這種極端值)
什麼一定是錯誤的,我的實驗?
這裏是我的命令和參數。
$opencv_haartraining -data Training -vec samples.vec -bg negatives.dat -nstages 2 -nsplits 2 -minhitrate 0.001 -maxfalsealarm 0.999 -npos 30 -nneg 40 -w 20 -h 20 -nonsym -mem 512 -mode ALL -minpos 10
並且結果。
Data dir name: Training
Vec file name: samples.vec
BG file name: negatives.dat, is a vecfile: no
Num pos: 30
Num neg: 40
Num stages: 2
Num splits: 2 (tree as weak classifier)
Mem: 512 MB
Symmetric: FALSE
Min hit rate: 0.001000
Max false alarm rate: 0.999000
Weight trimming: 0.950000
Equal weights: FALSE
Mode: ALL
Width: 20
Height: 20
Applied boosting algorithm: GAB
Error (valid only for Discrete and Real AdaBoost): misclass
Max number of splits in tree cascade: 0
Min number of positive samples per cluster: 10
Required leaf false alarm rate: 0.998001
Stage 0 loaded
Stage 1 loaded
Stage 2 loaded
Stage 3 loaded
Stage 4 loaded
Tree Classifier
Stage
+---+---+---+---+---+
| 0| 1| 2| 3| 4|
+---+---+---+---+---+
0---1---2---3---4
Number of features used : 125199
Parent node: 4
*** 1 cluster ***
POS: 30 32 0.937500
確實需要很長時間。嘗試使用較低寬度(15)和高度(15)的大量正(1000)和負(900)樣本。 – Saikat