今天用creates amples和traincascade来训练模型,结果stage0还没有跳过去就报错了……
OpenCV(3.4.1) Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file.
) in CvCascadeImageReader:osReader::get, file C:\application\opencv\opencv\sources\apps\traincascade\imagestorage.cpp, line 158
去网上看了,说是学习样本数量设置过高导致的问题,但是我还在stage0,还没开始训练就出现报错了,不知道是不是哪里设置除了问题,参数设置如下:
C:\my_xml>opencv_traincascade.exe -data xml -vec pos.vec -bg neg.txt -numPos 1800 -numNeg 1000 -numStages 20 -w 50 -h 50 -minHitRate 0.999 -precalcValBufSize 1024 -maxFalseAlarmRate 0.5 -mode ALL
PARAMETERS:
cascadeDirName: xml
vecFileName: pos.vec
bgFileName: neg.txt
numPos: 1800
numNeg: 1000
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: HAAR
sampleWidth: 50
sampleHeight: 50
boostType: GAB
minHitRate: 0.999
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL
Number of unique features given windowSize [50,50] : 5005351