Utilizing The Extended Angle Parameter

In my last blog I explained how I thought the differing angles of the smiling models in the video I've been using to test my smile detection program, were making it impossible to capture a lot of smiles; i.e., the smiles were being made with the model's head at some strange angle. I used the maxangle parameter of opencv_traincascade to capture a wider range of angles. In the current video I used the following command to create the smiles xml file:

opencv_traincascade -data cascades -vec vector/facevector.vec -bg bg.txt -numstages 15 -minHitRate .99 -maxFalseAlarmRate 0.5 -numPos 2963 -numNeg 741 -w 25 -h 25 -bt GAB -mode ALL -precalcValBufSize 2048 precalcIdxBufSize 2048 -maxxangle 1.6 -maxyangle 1.6 -maxzangle 1.6

If you read my last blog, you'll notice I've allocated more memory to the training process (I got Serval running again, with its 16 GBytes of DDR3 memory). I used VLC to capture all of the frames used in the original production of the smiles video, bringing up the total number of images used in the production of facevector.vec (the positive samples file) to 3704. The numPos value is 80% of the total number of images, or 2963. I've already used captured images taken from the test video, but this time I used the extended angle feature, not just with opencv_traincascade, but with opencv_createsamples (for creating the facevector.vec file):

opencv_createsamples -info pos.txt -vec vector/facevector.vec -num 2963 -w 25 -h 25 maxxangle 1.6 -maxyangle 1.6 -maxzangle 1.6

pos.txt contains the information about the 3704 images used to create facevector.vec   e.g., Positives/img0.jpg 1 0 0 125 125

Not a huge improvement, but by setting maxFalseAlarms to 0.5, I was able to capture Lana Lang's smiles (some of them). I was hoping to get more smiles by using the extended angle parameter for both opencv_createsamples and opencv_traincascade; hence the video background music, "Happy Together". I got my best results while using 749 images (maybe it was 849; this is from memory). I should go back to my earlier attempts and find out where I went wrong.

Return To My Blog Page       Haarcascade Smiles File       Return To My Programming Page