biometrics/openbr — pull request #179 by dgcrouse (2014-05-20 17:11:47+00:00)
Title: Added training for cascade classifiers

CascadeTransform is now a MetaTransform instead of an UntrainableMetaTransform. Train() was implemented and calls OpenCV's training utility (http://docs.opencv.org/doc/user_guide/ug_traincascade.html). Input is XML, with required metadata "training-set" taking values "pos", "neg", or "pos-base" on files.

Files marked as positive must have 1 or more rects marked to identify locations of objects of interest. A file marked as pos-base will be used to build a set of positive images as outlined in the OpenCV training utility docs. Only the last pos-base will be used. Files marked as negative require no rects.

A file tagged as pos-base accepts as additional metadata a series of specifiers for how the data are to be processed (num, bgcolor, bgthresh, inv, randinv, maxidev, maxxangle, maxyangle, maxzangle). All other parameters accepted by the training utility, except for "data" and "vec", are now arguments to the classifier (only used during training).