Haar Cascade OpenCV Python [closed]
I am trying to detect a "taffic light" which will be always the same shape. I started with the red light, but I am kind of stuck. I tried to do it with the Haar Cascade. This is my positive image:
Now I did 13 images witch my camera from different angles and greyscaled it. Here is a example:
These are the commands i've run to create the cascade:
opencv_createsamples -img redlight01.png -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 13
opencv_createsamples -info info/info.lst -num 13 -w 50 -h 50 -vec positives.vec
opencv_traincascade -data data -vec positives.vec -bg bg.txt -numPos 13 -numNeg 13 -numStages 5 -w 50 -h 50
My first problem is, that i get this result:
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 13 : 13
NEG count : acceptanceRatio 10 : 1
Precalculation time: 1
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 0|
+----+---------+---------+
END>
Training until now has taken 0 days 0 hours 0 minutes 4 seconds.
===== TRAINING 1-stage =====
<BEGIN
POS count : consumed 13 : 13
NEG count : acceptanceRatio 0 : 0
Required leaf false alarm rate achieved. Branch training terminated.
And when I try to do the method watch_cascade and try to mark it with a rectangle he always just create a rectangle in the center of the image.
you need more images (x100)
This is it? I just need more images? What should I do, create a photo from 100 angles?