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

Function scan_image

dlib/image_processing/scan_image.h:381–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379 typename image_array_type
380 >
381 void scan_image (
382 std::vector<std::pair<double, point> >& dets,
383 const image_array_type& images,
384 const std::vector<std::pair<unsigned int, rectangle> >& rects,
385 const double thresh,
386 const unsigned long max_dets
387 )
388 {
389 DLIB_ASSERT(images.size() > 0 && rects.size() > 0 && all_images_same_size(images),
390 "\t void scan_image()"
391 << "\n\t Invalid arguments given to this function."
392 << "\n\t images.size(): " << images.size()
393 << "\n\t rects.size(): " << rects.size()
394 << "\n\t all_images_same_size(images): " << all_images_same_size(images)
395 );
396#ifdef ENABLE_ASSERTS
397 for (unsigned long i = 0; i < rects.size(); ++i)
398 {
399 DLIB_ASSERT(rects[i].first < images.size(),
400 "\t void scan_image()"
401 << "\n\t rects["<<i<<"].first must refer to a valid image."
402 << "\n\t rects["<<i<<"].first: " << rects[i].first
403 << "\n\t images.size(): " << images.size()
404 );
405 }
406#endif
407
408
409
410
411 typedef typename image_traits<typename image_array_type::type>::pixel_type pixel_type;
412 typedef typename promote<pixel_type>::type ptype;
413
414 array2d<ptype> accum(images[0].nr(), images[0].nc());
415 assign_all_pixels(accum, 0);
416
417 for (unsigned long i = 0; i < rects.size(); ++i)
418 sum_filter(images[rects[i].first], accum, rects[i].second);
419
420 find_points_above_thresh(dets, accum, thresh, max_dets);
421 }
422
423// ----------------------------------------------------------------------------------------
424

Callers 3

run_test1Function · 0.85
run_test2Function · 0.85
run_test3Function · 0.85

Calls 7

all_images_same_sizeFunction · 0.85
assign_all_pixelsFunction · 0.85
sum_filterFunction · 0.85
find_points_above_threshFunction · 0.85
sizeMethod · 0.45
nrMethod · 0.45
ncMethod · 0.45

Tested by 3

run_test1Function · 0.68
run_test2Function · 0.68
run_test3Function · 0.68