Search code examples
c++opencvsegmentation-faulthaar-classifier

Segmentation Fault in TrainCascade on OpenCV


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:

enter image description here

When I try to retry the process, I get:

enter image description here

What I've tried:

  • Make the numNeg lower.
  • Trying to put the numPos near to samples / numStages.
  • According to the previous thing, re-low the numNeg to 300.

But the same Segmentation fault: 11 appears.

I haven't got this error before.

Do you know what am I doing bad?

Thank you in advance.


Solution

  • Reinstalling the whole OpenCV and binaries solved the problem.