3

I have about 15000 cropped images with the object of interest (positive samples) and 7000 negative images (non object of interest). The cropped images have a resolution of 48x96 and are placed in a folder. The .txt file containing the positive samples looks something like this : picture1.pgm 1 0 0 48 96 meaning that there is 1 positive sample in picture 1 from (0,0) to (48, 96). Likewise I have a .txt file for negative images.

The command for training is the following: c:\libraries\OpenCV2.4.1\opencv\built\bin\Debug>opencv_haartrainingd.exe -data d ata/cascade -vec data/positives.vec -bg c:/users/gheorghi/desktop/daimler/pedest rian_stereo_extracted/nonpedestrian/nonpedestrian/c0/negatives.txt -npos 15660 - nneg 7129 -nstage 14 -mem 1000 -mode ALL -w 18 -h 36 -nonsym

But at some point I always get this error :

    Parent node: 0

*** 1 cluster ***
OpenCV Error: Assertion failed (elements_read == 1) in unknown function, file C:
\libraries\OpenCV2.4.1\opencv\apps\haartraining\cvhaartraining.cpp, line 1858

How can I overcome this ??? Any help is appreciated. Many many thanks

Levon
  • 138,105
  • 33
  • 200
  • 191
valentin
  • 1,103
  • 2
  • 16
  • 36
  • I have the same problem. *** 1 cluster *** OpenCV Error: Assertion failed (elements_read == 1) in unknown function, file C: \Program Files\opencv2.4.1\apps\haartraining\cvhaartraining.cpp, line 1858 I'm training with 24x24 in 1000 positive samples and 3000 negative samples –  Jul 23 '12 at 13:19

2 Answers2

1

I found that the problem can be solved in 2 ways. you can either decrease the amount of positives or increase the amount of negatives. either way it turns out that having a small positive to negative ratio helps.

valentin
  • 1,103
  • 2
  • 16
  • 36
0

I answered the question here. It may be of some help.

The same issue was posted by many others, i used the advice given here.

Community
  • 1
  • 1
mayank
  • 186
  • 3
  • 12