MCPcopy Create free account
hub / github.com/davisking/dlib / scan_image_i

Function scan_image_i

dlib/test/scan_image.cpp:63–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

run_test1Function · 0.85
run_test2Function · 0.85
run_test3Function · 0.85

Calls 14

get_rectFunction · 0.85
set_max_sizeMethod · 0.80
get_sum_of_areaMethod · 0.80
translate_rectFunction · 0.50
pointClass · 0.50
sizeMethod · 0.45
set_sizeMethod · 0.45
loadMethod · 0.45
clearMethod · 0.45
nrMethod · 0.45
ncMethod · 0.45
intersectMethod · 0.45

Tested by

no test coverage detected