Ask Your Question

Revision history [back]

TranCascade invalid background description file

Hello everyone.

I've got a problem training the cascade classifier.

First, I create samples using opencv_createsamples:

./opencv_createsamples -vec test.vec -img ./positive/speed_50.jpeg -bg /home/boris/src/cascade/neg.txt -num 50 -w 150 -h 150

It works nice, and the output is following:

Info file name: (NULL)
Img file name: ./positive/speed_50.jpeg
Vec file name: test.vec
BG  file name: /home/boris/src/cascade/neg.txt
Num: 50
BG color: 0
BG threshold: 80
Invert: FALSE
Max intensity deviation: 40
Max x angle: 1.1
Max y angle: 1.1
Max z angle: 0.5
Show samples: FALSE
Width: 150
Height: 150
Create training samples from single image applying distortions...
Done

Then the cascade trainer:

./opencv_traincascade -data /home/boris/src/cascade -vec ./test.vec -bg ./neg.txt -numPos 50 -numNeg 2 -w 150 -h 150

And I get the following error:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Emergency stop (core dumped)

neg.txt file:

img/img1.jpeg  
img/img2.jpeg

both files exist in the img directory.

OpenCV version is 2.4.2, OS is Ubuntu 12.04.

Thanks for any help.

TranCascade invalid background description fileerror (bad_alloc)

Hello everyone.

I've got a problem training the cascade classifier.

First, I create samples using opencv_createsamples:

./opencv_createsamples -vec test.vec -img ./positive/speed_50.jpeg -bg /home/boris/src/cascade/neg.txt -num 50 -w 150 -h 150

It works nice, and the output is following:

Info file name: (NULL)
Img file name: ./positive/speed_50.jpeg
Vec file name: test.vec
BG  file name: /home/boris/src/cascade/neg.txt
Num: 50
BG color: 0
BG threshold: 80
Invert: FALSE
Max intensity deviation: 40
Max x angle: 1.1
Max y angle: 1.1
Max z angle: 0.5
Show samples: FALSE
Width: 150
Height: 150
Create training samples from single image applying distortions...
Done

Then the cascade trainer:

./opencv_traincascade -data /home/boris/src/cascade -vec ./test.vec -bg ./neg.txt -numPos 50 -numNeg 2 -w 150 -h 150

And I get the following error:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Emergency stop (core dumped)

neg.txt file:

img/img1.jpeg  
img/img2.jpeg

both files exist in the img directory.

OpenCV version is 2.4.2, OS is Ubuntu 12.04.

Thanks for any help.

TranCascade error (bad_alloc)

Hello everyone.

I've got a problem training the cascade classifier.

First, I create samples using opencv_createsamples:

 ./opencv_createsamples -vec test.vec -img ./positive/speed_50.jpeg  -bg /home/boris/src/cascade/neg.txt -num 50 -w 150 -h 150

It works nice, and the output is following:

Info file name: (NULL)
Img file name: ./positive/speed_50.jpeg
Vec file name: test.vec
BG  file name: /home/boris/src/cascade/neg.txt
Num: 50
BG color: 0
BG threshold: 80
Invert: FALSE
Max intensity deviation: 40
Max x angle: 1.1
Max y angle: 1.1
Max z angle: 0.5
Show samples: FALSE
Width: 150
Height: 150
Create training samples from single image applying distortions...
Done

Then the cascade trainer:

 ./opencv_traincascade -data /home/boris/src/cascade -vec ./test.vec  -bg ./neg.txt -numPos 50 -numNeg 2 -w 150 -h 150

And I get the following error:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Emergency stop (core dumped)

neg.txt file:

img/img1.jpeg  
img/img2.jpeg

both files exist in the img directory.

OpenCV version is 2.4.2, OS is Ubuntu 12.04.

Thanks for any help.