opencv - opencv 中的训练函数无法训练我的分类器

标签 opencv

我运行这些命令

opencv_traincascade -data data/cascade -vec samples1.vec -bg negative/infofile.txt -numPos 231 -numNeg 100 -w 25 -h 15

在 Centos 系统中训练我的分类器,它返回以下内容

PARAMETERS:
cascadeDirName: data/cascade
vecFileName: samples1.vec
bgFileName: negative/infofile.txt
numPos: 231
numNeg: 100
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: HAAR
sampleWidth: 25
sampleHeight: 15
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   231 : 231
Train dataset for temp stage can not be filled. Branch training terminated.
Cascade classifier can't be trained. Check the used training parameters.

谁能告诉我出了什么问题吗?:/

最佳答案

负样本数量太少。您应该通过在网络上搜索更多不包含检测到的对象的背景图像来将其增加得更大,例如 1000。

关于opencv - opencv 中的训练函数无法训练我的分类器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20153324/

相关文章:

python - Python-如何根据其值裁剪图像?

java - OpenCV Android 背景减法

opencv - 等效于FFTW_REDFT01的FFTW fftwf_plan_r2r_2d()

c++ - 如何从旋转角度计算 OpenCV 的透视变换?

c++ - OpenCV 中 cv::Mat 的自定义类型

Python 图像处理 - 如何删除某些轮廓并将值与周围像素混合?

python - 使用opencv标记静脉

c# - 魔兽世界图像处理

python - 如何在 opencv 中更改鼠标光标图像?

opencv - 是否有 OpenCV 函数可以将掩码下的所有像素复制到数组中?