| 61 | typename image_array_type |
| 62 | > |
| 63 | void scan_image_i ( |
| 64 | std::vector<std::pair<double, point> >& dets, |
| 65 | const image_array_type& images, |
| 66 | const std::vector<std::pair<unsigned int, rectangle> >& rects, |
| 67 | const double thresh, |
| 68 | const unsigned long max_dets |
| 69 | ) |
| 70 | { |
| 71 | typedef typename image_array_type::type::type pixel_type; |
| 72 | typedef typename promote<pixel_type>::type ptype; |
| 73 | array<integral_image_generic<ptype> > iimg; |
| 74 | iimg.set_max_size(images.size()); |
| 75 | iimg.set_size(images.size()); |
| 76 | |
| 77 | for (unsigned long i = 0; i < iimg.size(); ++i) |
| 78 | iimg[i].load(images[i]); |
| 79 | |
| 80 | |
| 81 | dets.clear(); |
| 82 | |
| 83 | |
| 84 | for (long r = 0; r < images[0].nr(); ++r) |
| 85 | { |
| 86 | for (long c = 0; c < images[0].nc(); ++c) |
| 87 | { |
| 88 | ptype temp = 0; |
| 89 | for (unsigned long i = 0; i < rects.size(); ++i) |
| 90 | { |
| 91 | rectangle rtemp = translate_rect(rects[i].second,point(c,r)).intersect(get_rect(images[0])); |
| 92 | if (rtemp.is_empty() == false) |
| 93 | temp += iimg[rects[i].first].get_sum_of_area(rtemp); |
| 94 | } |
| 95 | if (temp > thresh) |
| 96 | { |
| 97 | dets.push_back(std::make_pair(temp, point(c,r))); |
| 98 | |
| 99 | if (dets.size() >= max_dets) |
| 100 | return; |
| 101 | |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // ---------------------------------------------------------------------------------------- |
| 108 |
no test coverage detected