Error generating samples for cascade classifier training
이전 댓글 표시
While trying to run trainCascadeObjectDetector with MATLAB R2013a on Windows, I keep getting an error that won't allow me to get past the very first stage.
I have been following MATLAB's tutorial on how to "Train a Cascade Object Detector", as well as this blog post .
I am using 4,372 .pgm positive images and 14,440 .pgm negative images.
The positive images are given to the function as a structure variable which contains path+filename and object bounding box of the images. Both positive and negative images are located in their respective subfolders.
Calling of the function:
negativeFolder = ('./negativeFolder');
trainCascadeObjectDetector('trainedCrater1.xml',positiveData,negativeFolder);
The following is printed when the training starts:
Automatically setting ObjectTrainingSize to [ 32, 32 ]
Using at most 3992 of 4372 positive samples per stage
Using at most 7984 negative samples per stage
Training stage 1 of 20
The error that I am getting is this:
Training stage 1 of 20
[....................................................Error using ocvTrainCascade
Error in generating samples for training. No samples could be generated for training the first cascade stage.
Error in trainCascadeObjectDetector (line 265)
ocvTrainCascade(filenameParams, trainerParams, cascadeParams, boostParams, ...
Error in training (line 24)
trainCascadeObjectDetector('trainedCrater1.xml',positiveData,negativeFolder);
Does anyone have any kind of suggestion on how to fix this issue? Thank you very much!
채택된 답변
추가 답변 (1개)
Zhenglin Wang
2017년 6월 8일
0 개 추천
Might be because training images are smaller than 32x32. Try to specify such as " 'ObjectTrainingSize', [28 28]"
댓글 수: 1
Hossam Alzomor
2019년 7월 30일
편집: Hossam Alzomor
2019년 7월 30일
what is the problem with small images?
I am facing the same problem, my images are 32*32
I have 106 ROI images and 96 NROI images
but the false -ve detection is 90%
카테고리
도움말 센터 및 File Exchange에서 Object Detection에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!