Stephan Ahlf
Stephan Ahlf

Reputation: 3497

Why does opencv_traincascade fail with: "Train dataset for temp stage can not be filled"?

What I have tried so far...

opencv_createsamples -info positive/positive.txt -vec positive.vec -w 100 -h 100 -num 2
opencv_createsamples -info negative/negative.txt -vec negative.vec -w 100 -h 100 -num 2
opencv_traincascade -vec positive.vec -data . -bg negative/negative.txt -numPos 1 -numNeg 1 -numStages 1 -w 100 -h 100

# outputs
Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.

How to train a HAAR model with very few positives? The goal is to track 2d images in 2d images.

Upvotes: 4

Views: 693

Answers (2)

Vynce
Vynce

Reputation: 3236

Per http://docs.opencv.org/2.4/doc/user_guide/ug_traincascade.html#negative-samples negative samples can't be created by createsamples. Unfortunately, the documentation is not super clear about why you can't, and the question hasn't been clear about what you expect this to do.

Upvotes: 1

Vynce
Vynce

Reputation: 3236

One of your arguments is "numpos" but per http://docs.opencv.org/2.4/doc/user_guide/ug_traincascade.html, it should be "numPos" with a capital P.

Upvotes: 1

Related Questions