# Training cascade for detecting arrow signs

I'm working on a simple navigation problem, for which I need to detect arrow signs and follow the arrow right or left. I can define the arrow shape, and am using this black arrow on white background.

Using a cascade with detectMultiscale seems to be the most promising:

• I need to something that works at a range of scales (to detect arrows close and further away).
• It doesn't need to be very fast: the speed of detectMultiscale is not a problem.

I've trained a cascade that does detect some arrows, but there are lots of false positives and I miss many arrows. I am also trying to train cascades to recognize just left or just right arrows, and have not achieved a reliable result. It seems like this should be a relatively easy object recognition problem, so I'm puzzled by my poor results.

For the details, I am using the LableMe dataset (from http://www.ais.uni-bonn.de/download/d...) for negative samples. I'm creating positive samples from this dataset with the command below and a 26x20 pixel version of the arrow.

opencv_createsamples -img arrow_26x20R.jpg -bg bg_0-20.txt -num 20000 -info ./pos_5R/annotations.lst -pngoutput ./pos_5R -bgcolor 1 -bgthresh 0 -maxxangle 0.2 -maxyangle 0.5 -maxzangle 0.2 -w 26 -h 20


Then, to create the vector file:

opencv_createsamples -num 20000 -info ./pos_5L/annotations.lst -vec pos_5L.vec -w 26 -h 20


opencv_traincascade -data cascade_arrow_5L -vec pos_5L.vec -bg bg_5R_0-20.txt -numPos 17000 -numNeg 40000 -numStages 10 -w 26 -h 20