title: OpenCV - TranCascade error (bad_alloc)
body: <p>I've got a problem training the cascade classifier.</p>
  
  <p>First, I create samples using opencv_createsamples:</p>
  
  <pre><code>./opencv_createsamples -vec test.vec -img ./positive/speed_50.jpeg -bg /home/boris/src/cascade/neg.txt -num 50 -w 150 -h 150
  </code></pre>
  
  <p>It works nice, and the output is following:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Then the cascade trainer:</p>
  
  <pre><code>./opencv_traincascade -data /home/boris/src/cascade -vec ./test.vec -bg ./neg.txt -numPos 50 -numNeg 2 -w 150 -h 150
  </code></pre>
  
  <p>And I get the following error:</p>
  
  <pre><code>terminate called after throwing an instance of 'std::bad_alloc'
    what():  std::bad_alloc
  Emergency stop (core dumped)
  </code></pre>
  
  <p>neg.txt file:</p>
  
  <pre><code>img/img1.jpeg  
  img/img2.jpeg
  </code></pre>
  
  <p>both files exist in the img directory.</p>
  
  <p>OpenCV version is 2.4.2, OS is Ubuntu 12.04.</p>
  
  <p>Thanks for any help.</p>