Insufficient count of samples in given vec-file. during harcascade training

when training the custom harcascade using cascade trainer GUI tool , I am using the positive image of 500 nos and negative image of 1000nos , All the pre processing done like cropping and sizing. When i trained the harcascade model throwing below error : OpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file. Even increased the No of image in positive as well as in negative also still throwing the same error.

  • what exactly are you trying to detect later ? (haarcascades are often the wrong tool, and you would not be the 1st person with wrong assumptions here)
  • do you really have 500 pos images ? “synthesizing” many from a few positives only never works in real life
  • you need a few more positives in the vec file, than you pass to the traincascade app (some bad ones will be moved to the negatives)

I am also having the same problem i have 1200+ negative images and 200 positive images anytime I add the positive images above 200 I will get that error

please answer the questions above