OpenCV 3.0.0 - traincascade.exe : Traindata set for temp stage cannot be filled
Hi,
So, I have 20 positive samples and 500 negative samples. I created the .vec file using createsample utility.Now, when i try to train the classifier using the traincascade.exe utility, I run into the following error:
I have looked into many solutions given to people who have faced similar issues, but none of them worked.
Things I tried: 1. Increasing the negative sample size 2. Checking the path of the negative(or background images) stored in the Negative.txt file 3. Varying different parameters.
Here is some information regarding the path: My working directory has the following files: 1. Traincascade.exe 2. Positive image folder 3. NegativeImageFolder 4. vec file 5. Negative.txt (file that has path to images in the negative image folder)
My Negative.txt file has the absolute file path for the images in the negative image folder. I also tried changing the file path to the following format:
NegativeImageFolder\Image1.pgm
but didn't work! I tried both front and backslash too!
I have run out of ways to change the file path or make any modification to make this work!
Any help on this would be highly appreciated! I am unable to proceed any further with my project.
Thanks in advance
-numStages 1
will never work o_O the principle of a cascade classifier is that you combine multiple weak classifiers into a strong one. Try putting it at least on like 5 stages. If you want a single stage of trees, then you will need the rtree software of OpenCV.Also, please remove CAPS, its like shouting and won't encourage us to help you faster then others...
Thanks Steven!
I initially started with 10 stages. That didn't work. I just landed up trying different values for -numStages to see if it would make any difference since I couldn't figure out what exactly was causing the error. I tried agan with 5 stages, I get the same error.
Also, sorry about the CAPS. I guess I was just too desperate for some help on this one. I have been stuck with this for almost 3 whole days now. Anyway, will remove the caps right away :)
Please do let me know if any other suggestions comes across your mind.
@StevenPuttemans To be precise, in your first comment, is it not "the principle of a cascade classifiers is to combine multiple" strong classifiers into a cascade of classifiers (also called the attentional cascade in the paper) instead of weak ?
@Eduardo, nope it is not. You combine multiple classifiers that are good at seperating the positives but only better than random guessing on the negatives, hence weak classifiers, until the overall performance of the cascade reaches a high accuracy on the negative sample rejection while maintaining the positive sample acceptance. That is called combining a cascade of weak classifiers into a strong classifier.
But it might depend on how you see a weak classifier :D
What I have understood is that a weak classifier classifies an input window using only a single feature and the corresponding threshold, that's why I think the confusion when I read your comment.
@Eduardo well that depends on the configuration. The rule for a weal classifier by default is that you do better then random guessing on the negatives. By default OpenCV uses tree stumps, which are single depth, single feature decision trees. However a single feature might not be able to get a FArate below 0.5, so that is where you add a second stump, and so on, untill you reach the FA value. Basically each stump is already a very weak classifier, but both paper of viola and jones as implementation in OpenCV speak of weak classifiers when a stage agreement due to parameters are reached.
@StevenPuttemans Thanks for your explanation.