| 293 | |
| 294 | template <typename image_type> |
| 295 | point_transform_affine make_chip ( |
| 296 | const image_type& img, |
| 297 | drectangle p, |
| 298 | std::vector<matrix<std::complex<double> > >& chip |
| 299 | ) const |
| 300 | { |
| 301 | typedef typename image_traits<image_type>::pixel_type pixel_type; |
| 302 | array2d<pixel_type> temp; |
| 303 | const double padding = 1.4; |
| 304 | const chip_details details(p*padding, chip_dims(get_filter_size(), get_filter_size())); |
| 305 | extract_image_chip(img, details, temp); |
| 306 | |
| 307 | |
| 308 | chip.resize(32); |
| 309 | dlib::array<array2d<float> > hog; |
| 310 | extract_fhog_features(temp, hog, 1, 3,3 ); |
| 311 | for (unsigned long i = 0; i < hog.size(); ++i) |
| 312 | assign_image(chip[i], pointwise_multiply(matrix_cast<double>(mat(hog[i])), mask)); |
| 313 | |
| 314 | assign_image(chip[31], temp); |
| 315 | assign_image(chip[31], pointwise_multiply(mat(chip[31]), mask)/255.0); |
| 316 | |
| 317 | return inv(get_mapping_to_chip(details)); |
| 318 | } |
| 319 | |
| 320 | void make_target_location_image ( |
| 321 | const dlib::vector<double,2>& p, |
nothing calls this directly
no test coverage detected