Error generating samples for cascade classifier training
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (1)
Zhenglin Wang
el 8 de Jun. de 2017
0 votos
Might be because training images are smaller than 32x32. Try to specify such as " 'ObjectTrainingSize', [28 28]"
1 comentario
Hossam Alzomor
el 30 de Jul. de 2019
Editada: Hossam Alzomor
el 30 de Jul. de 2019
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%
Categorías
Más información sobre Object Detection en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!