April 2017
Beginner to intermediate
250 pages
6h 28m
English
An example program for training a shape model from the annotation data can be found in train_shape_model.cpp. With the command-line argument argv[1] containing the path to the annotation data, training begins by loading the data into memory and removing incomplete samples, as follows:
ft_data data = load_ft<ft_data>(argv[1]);
data.rm_incomplete_samples();
The annotations for each example, and optionally their mirrored counterparts, are then stored in a vector before passing them to the training function as follows:
vector<vector<Point2f>> points;
for(int i = 0; i < int(data.points.size()); i++) {
points.push_back(data.get_points(i,false));
if(mirror)points.push_back(data.get_points(i,true));
}
The shape model ...
Read now
Unlock full access