TrainCascade: Choise of parameters and positive image

asked 2017-03-28 01:28:59 -0500

Julius gravatar image

Hello, ​

I want to detect an pen and I used juliu5.com/full.jpg as the positive image. To generate a few hundred positives I used these github.com/handaga/tutorial-haartraining/tree/master/data/negatives and this command.

opencv_createsamples.exe -info C:\TrainingMarker\positives\positives.txt  -bg C:\NegativeImages\negatives\bg.txt -img C:\TrainingMarker\images\full.jpg -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -bgcolor 255 -bgthresh 8 -num 1000 -w 132 -h 30

For the -w and -h parameters I divided the with and height of my original positive image. Now I have 1000 positives and 2000 negatives so I am ready to train the classifier. (Linux Server)

opencv_traincascade -data TrainingMarker/cascade/ -vec TrainingMarker/objects.vec -bg NegativeImages/negatives/bg.txt -numStages 20 -numPos 1000 -numNeg 2000 -w 132 -h 30 -featureType LBP -minHitRate 0.995 -maxFalseAlarmRate 0.5

However in each Stage there are 3 lines (trained features?) max and my tracking results are really bad...

I am still confused by the -w and -h parameters although I read several explanations within the forum. Are my parameters alright? When I was using -featureType HOG I got about 8 lines of features in each Stage. However this Type is not supported in OpenCV > 3.0.

Is my test object just not detailed enough?

Thank you really much for your help!

edit retag flag offensive close merge delete

Comments

use tag TrainCascade and you will find answers

LBerger gravatar imageLBerger ( 2017-03-28 03:18:34 -0500 )edit