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!