Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

uUbuntu 14 opencv3.0.0 Training your own detector | packtpub.com error ...

As a title, for first time in my life I try to use a cascade classifier ... first step: from mpg4 grab from camera, obtain 150 png image of my targhet ... well cropped, with my targhet oriented in different ways and with different type of light intensity .... In the same manner obtain 800 image of background ... then I try make all step of the tutorial for obtain my detector... but nothing: when use opencv_traincascade app I obtain only these error ->

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

So After some experiment, as suggest from here packpub tutorial I downloaded from here UIUCI DataCar the data folder, then:

  1. copy all pos image from download/CarData/TrainImages to /home/b/Scrivania/pos ..
  2. copy all neg image from download/CarData/TrainImages to /home/b/Scrivania/neg ..
  3. use "find" command to make /home/b/Scrivania/positives.txt file
  4. use "find" command to make /home/b/Scrivania/bg.txt file
  5. copy/paste/rename /home/b/Scrivania/positives.txt into /home/b/Scrivania/car.info & add " 1 0 0 100 40" after ".pgm"
  6. opencv_createsamples -info /home/b/Scrivania/cars.info -num 550 -w 48 -h 24 -vec /home/b/Scrivania/cars.vec
  7. verify the .vec file ... seems all ok ..
  8. opencv_traincascade -data /home/b/Scrivania/data -vec /home/b/Scrivania/cars.vec -bg /home/Scrivania/b/Scrivania/bg.txt -numStages 10 -nsplits 2 -minhitrate 0.999 -maxfalsealarm 0.5 -numPos 500 -numNeg 500 -w 48 -h 24
  9. obtain the error exactly as my image, folder and file ... the error :
  10. Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.

At this point I hope that everything depends on the fact that the tutorial refers to opencv2.4 and I use opencv3.0.0 ... so what are the points I'm wrong??

regards gfx

uUbuntu [Solved] Ubuntu 14 opencv3.0.0 Training your own detector | packtpub.com error ...

As a title, for first time in my life I try to use a cascade classifier ... first step: from mpg4 grab from camera, obtain 150 png image of my targhet ... well cropped, with my targhet oriented in different ways and with different type of light intensity .... In the same manner obtain 800 image of background ... then I try make all step of the tutorial for obtain my detector... but nothing: when use opencv_traincascade app I obtain only these error ->

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

So After some experiment, as suggest from here packpub tutorial I downloaded from here UIUCI DataCar the data folder, then:

  1. copy all pos image from download/CarData/TrainImages to /home/b/Scrivania/pos ..
  2. copy all neg image from download/CarData/TrainImages to /home/b/Scrivania/neg ..
  3. use "find" command to make /home/b/Scrivania/positives.txt file
  4. use "find" command to make /home/b/Scrivania/bg.txt file
  5. copy/paste/rename /home/b/Scrivania/positives.txt into /home/b/Scrivania/car.info & add " 1 0 0 100 40" after ".pgm"
  6. opencv_createsamples -info /home/b/Scrivania/cars.info -num 550 -w 48 -h 24 -vec /home/b/Scrivania/cars.vec
  7. verify the .vec file ... seems all ok ..
  8. opencv_traincascade -data /home/b/Scrivania/data -vec /home/b/Scrivania/cars.vec -bg /home/Scrivania/b/Scrivania/bg.txt -numStages 10 -nsplits 2 -minhitrate 0.999 -maxfalsealarm 0.5 -numPos 500 -numNeg 500 -w 48 -h 24
  9. obtain the error exactly as my image, folder and file ... the error :
  10. Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.

At this point I hope that everything depends on the fact that the tutorial refers to opencv2.4 and I use opencv3.0.0 ... so what are the points I'm wrong??

regards gfx