简体   繁体   English

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

[英]training function in opencv can not train my classifier

I run these command我运行这些命令

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

in Centos system to train my classifier and it returns the follow在 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.

Can anyone tell me what is the problem?:/谁能告诉我有什么问题?:/

The number of negative samples is too small.负样本数量太少。 You should increase it much larger such as 1000 by searching more background images on the web in which does not contain your detected object.您应该通过在网络上搜索更多不包含您检测到的对象的背景图像来增加它,例如 1000。

Train cascade doesn't pick your negative testdata.火车级联不会选择您的负面测试数据。 Please check the path specified in the negative/infofile.txt.请检查负/infofile.txt 中指定的路径。 One way to avoid this problem is using relative path in infofile.txt.避免此问题的一种方法是在 infofile.txt 中使用相对路径。 Detailed information available here 此处提供详细信息

One problem I encountered was the following: opencv_createsamples accepted relative paths, but opencv_traincascade did not accept relative paths.我遇到的一个问题是:opencv_createsamples 接受相对路径,但 opencv_traincascade 不接受相对路径。

To fix it, I created two different files for referencing the background images: bg_create.txt and bg_train.txt为了修复它,我创建了两个不同的文件来引用背景图像:bg_create.txt 和 bg_train.txt

The former having relative paths to the background images and the latter having absolute paths to the background images.前者具有到背景图像的相对路径,后者具有到背景图像的绝对路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OpenCV:训练级联分类器 - OpenCV: training a cascade classifier OpenCV 人脸识别灰度转换错误,同时训练我的分类器 - OpenCV Face Recognition grayscale conversion error while training my classifier opencv火车分类器永不连续3阶段 - opencv train classifier never contiueus 3 stage 如何在图像上训练OpenCV SVM分类器 - How to train OpenCV SVM classifier on images 用于检测火车(铁路运输)的 OpenCV 分类器 - OpenCV classifier to detect train (railway transport) OpenCV:良好的训练输出但是级联分类器很差 - OpenCV: Good Training Output but Cascade Classifier is Poor OpenCV错误“无法填充临时阶段的训练数据集。 进入第三阶段培训后,分支培训终止。” - OpenCV error “Train dataset for temp stage can not be filled. Branch training terminated.” after starting training stage-3 如何使用具有面部特征的openCV训练支持向量机(svm)分类器? - How to train a Support Vector Machine(svm) classifier with openCV with facial features? 训练分类器以仅检测睫毛/鼻子功能dlib和opencv? - train classifier to detect only eyelashes/nose features dlib and opencv? OpenCV haar分类器训练,带有多个正面图像 - OpenCV haar classifier training with more than one positive image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM