Opencv Haar trainig Error
Hi, I'm new of Opencv and i make a road signal detection and i wanna trainig the algorithm for detect this. I have follow this guide on youtube https://www.youtube.com/watch?v=KFC6j... but in the end they give me an error. this is the file traning.bat
opencv_traincascade.exe -data classifier -vec samples.vec -bg negativeNew.txt -numStages 10 -minHitRate 0.999 -maxFalseAllarmRate 0.5 -numPos 12 -numNeg 1 -w 20 -h 20 -mode ALL -precalcvalBuffSize 256 -precalcdxBufSize 256
And this is the error:
Image reader can not be created from -vec samples.vec and -bg negativeNew.txt.
What I know it would take many more pictures but this is a begin, just for try. Can someone help me with this error? Thanks.
most probably you got the path wrong, it can't find either samples.vec or negativeNew.txt
(your ex. expects both files in the same folder, where you start your program
I control the file negativeNew.txt and the path it's correct, even files in the same folder.
I'd use full paths of both files just in case
Me too, the path in the file negativeNew (for ex C:\OpenCV\image\negative\nameOfImage.bmp) and the vec file contains only numbers. Can the image create problem? I take only a image with signal, (like this: http://www.smalteriaemiliana.it/wp-co... convert in bmp).
Nope, I was saying using full paths in the command line (i.e. ... -vec fullpath/samples.vec -bg fullpath/negative.txt). I've never used full paths inside the negative text file, and I think it will cause an error too. By the way, with so few positives and negatives, I hardly believe you will success in finishing the training (you will probably consume all your samples at same stage)
ah sorry, i add the path and it's the same:
Image reader can not be created from -vec C:\OpenCV\samples.vec and -bg C:\OpenCV\negative.txt.
You are right, it's only for understand how work and if it's work, i have try to decrease the num of stages to 10 by 1. The next step it's increase the num of positive and negative image!