开发者

OpenCV: Traincascade fails "Assertion failed _img.cols == winSize.width"

Anybody has an idea what OpenCV Error: Assertion failed _img.cols == winSize.width means? I'm not familar with the new implemenation of the haar training (=traincascade) nor could I find any 开发者_如何学JAVAdocumentation in the wiki. Thanks, Josef


May be this helps: http://lab.cntl.kyutech.ac.jp/~kobalab/nishida/opencv/OpenCV_ObjectDetection_HowTo.pdf


I think I have found some answers:

  • It may be because of the too big database (there are too many images positives and negatives).
  • It may be because the positives samples differ too much, there cannot be extracted some features to define the object;
  • It also may be because of the negatives sets, which can contain scenes (bigger images from which OpenCV is generating many negative samples), are containing samples that are very similar to the positive samples.

But I would go for the first one, because if I reduce the number of samples it is not getting stuck anymore.


Having too big database is not problem, it doesn't make sense . That was my issue for days. I guess you used thread in your program and your threads reach to the svm (or some thing else that you use for train) before get to detector (for detect the keypoints). If you look at the path which give you in assertion error, you got it that these things are relevant. I advice you to use mutex (or semaphores) to manage your threads correctly or if you don't use threads make sure that do detecting before training.

good luck

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜