segmentation fault on traincascade
Hello.
I'm getting this weird error. I have 437 positive images and 3019 negative images.
The positive images all taken of 35x35 pixels.
This is the command that I use:
opencv_traincascade -data data -vec lv.vec -bg bg.txt -numPos 437 -numNeg 3019 -numStages 10 -w 35 -h 35
if I use -featureType LBP
, it hangs on the 0-stage not calculating anything. If I remove it, this is what happens:
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 437 : 437
NEG count : acceptanceRatio 3019 : 1
Precalculation time: 3
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1| 0.988738|
+----+---------+---------+
| 4| 1| 0.998344|
+----+---------+---------+
| 5| 1| 0.998675|
+----+---------+---------+
Segmentation fault: 11
When I try to retry the process, I get:
PARAMETERS:
cascadeDirName: data
vecFileName: /Users/rafaelruizmunoz/Desktop/metal/lv.vec
bgFileName: bg.txt
numPos: 437
numNeg: 3019
numStages: 10
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: HAAR
sampleWidth: 35
sampleHeight: 35
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC
Stage 0 is loaded
===== TRAINING 1-stage =====
<BEGIN
POS OpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file.
) in get, file /Users/rafaelruizmunoz/Downloads/opencv/apps/traincascade/imagestorage.cpp, line 163
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/rafaelruizmunoz/Downloads/opencv/apps/traincascade/imagestorage.cpp:163: error: (-5) Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file.
in function get
Abort trap: 6
Does anyone know what is happening?
Thank you in advance.
Aren't there too few positives relative to the number of negatives?
Hi @thdrksdfthmn , in my experience I've just used cascades downloaded from Internet... would you reccomend me a ratio of pos/neg ??