MCPcopy Create free account
hub / github.com/davisking/dlib / operator()

Method operator()

dlib/image_processing/shape_predictor.h:339–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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()(

Callers

nothing calls this directly

Calls 8

unnormalizing_tformFunction · 0.85
locationFunction · 0.85
num_leavesMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected