| 337 | |
| 338 | template <typename image_type> |
| 339 | full_object_detection operator()( |
| 340 | const image_type& img, |
| 341 | const rectangle& rect |
| 342 | ) const |
| 343 | { |
| 344 | using namespace impl; |
| 345 | matrix<float,0,1> current_shape = initial_shape; |
| 346 | std::vector<float> feature_pixel_values; |
| 347 | for (unsigned long iter = 0; iter < forests.size(); ++iter) |
| 348 | { |
| 349 | extract_feature_pixel_values(img, rect, current_shape, initial_shape, |
| 350 | anchor_idx[iter], deltas[iter], feature_pixel_values); |
| 351 | unsigned long leaf_idx; |
| 352 | // evaluate all the trees at this level of the cascade. |
| 353 | for (unsigned long i = 0; i < forests[iter].size(); ++i) |
| 354 | current_shape += forests[iter][i](feature_pixel_values, leaf_idx); |
| 355 | } |
| 356 | |
| 357 | // convert the current_shape into a full_object_detection |
| 358 | const point_transform_affine tform_to_img = unnormalizing_tform(rect); |
| 359 | std::vector<point> parts(current_shape.size()/2); |
| 360 | for (unsigned long i = 0; i < parts.size(); ++i) |
| 361 | parts[i] = tform_to_img(location(current_shape, i)); |
| 362 | return full_object_detection(rect, parts); |
| 363 | } |
| 364 | |
| 365 | template <typename image_type, typename T, typename U> |
| 366 | full_object_detection operator()( |
nothing calls this directly
no test coverage detected