OpenCV Haartraining 不会永远完成

标签 opencv machine-learning computer-vision adaboost training-data

这是我第一次使用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

最佳答案

我认为您正在使用 OpenCV_Haartraining 是否正确?

如果是这样,这是一个已弃用的应用程序,您应该使用 opencv_traincascades。

这将

- A. Speed up the time taken to classify 
 - B. Have better support

请参阅这些链接以进一步阅读 Training Vs TrainCascadeTrainCascade Wiki .

编辑:

另外,更改您的最小命中率和最大误报率。

我建议使用 0.4 和 0.95 之类的东西来开始。

原因是它需要永远达到 0.999 和 0.0001(如果有的话)。

关于OpenCV Haartraining 不会永远完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16053378/

相关文章:

python - 模型的特征数量必须与输入匹配。模型 n_features 为 20,输入 n_features 为 4

opencv - 如何在二值骨架化图像中追踪线段?

computer-vision - 使用霍夫变换检测三次曲线

c++ - OpenCV : Object detection and tracking based on feature detection

opencv - 如何修复错误: (-215:Assertion failed) npoints > 0 in function 'drawContours'

python - Keras 顺序密集输入层 - 和 MNIST : why do images need to be reshaped?

machine-learning - 根据我的网站产品上的用户信息实现定向广告有哪些必要的工具?

computer-vision - Google Inceptionism : obtain images by class

c++ - 如何访问 OpenCV 匹配器上的点位置?

opencv - 在ubuntu 11.10中编译opencv2.3.1