Commit 651df561 authored by Davis King's avatar Davis King

filled in the spec

parent d607a8e5
...@@ -19,8 +19,22 @@ namespace dlib ...@@ -19,8 +19,22 @@ namespace dlib
class object_detector class object_detector
{ {
/*! /*!
WHAT THIS OBJECT REPRESENTS REQUIREMENTS ON overlap_tester_type
overlap_tester_type must be a type with an interface compatible
with test_box_overlap.
REQUIREMENTS ON image_scanner_type
image_scanner_type must be an instance of the scan_image_pyramid
templated defined in dlib/image_processing/scan_image_pyramid_abstract.h
or an object with a compatible interface.
WHAT THIS OBJECT REPRESENTS
This object is a tool for detecting the positions of objects in
an image. In particular, it is a simple container to aggregate
an instance of the scan_image_pyramid class, the weight vector
needed by scan_image_pyramid, and finally an instance of
test_box_overlap. The test_box_overlap object is used to perform
non-max suppression on the output of the scan_image_pyramid object.
!*/ !*/
public: public:
object_detector ( object_detector (
...@@ -40,21 +54,23 @@ namespace dlib ...@@ -40,21 +54,23 @@ namespace dlib
!*/ !*/
object_detector ( object_detector (
const image_scanner_type& scanner_, const image_scanner_type& scanner,
const overlap_tester_type& overlap_tester_, const overlap_tester_type& overlap_tester,
const matrix<double,0,1>& w_ const matrix<double,0,1>& w
); );
/*! /*!
requires requires
- w_.size() == scanner_.get_num_dimensions() + 1 - w.size() == scanner.get_num_dimensions() + 1
- scanner_.num_detection_templates() > 0 - scanner.num_detection_templates() > 0
ensures ensures
- Initializes this detector... TODO describe - When the operator() member function is called it will
invoke scanner.detect(w,dets,w(w.size()-1)), suppress
overlapping detections, and then report the results.
- when #*this is used to detect objects, the set of - when #*this is used to detect objects, the set of
output detections will never contain any overlaps output detections will never contain any overlaps
with respect to overlap_tester_. That is, for all with respect to overlap_tester. That is, for all
pairs of returned detections A and B, we will always pairs of returned detections A and B, we will always
have: overlap_tester_(A,B) == false have: overlap_tester(A,B) == false
!*/ !*/
object_detector& operator= ( object_detector& operator= (
...@@ -74,8 +90,7 @@ namespace dlib ...@@ -74,8 +90,7 @@ namespace dlib
) const; ) const;
/*! /*!
requires requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h - img == an object which can be accepted by image_scanner_type::load()
- pixel_traits<typename image_type::type>::has_alpha == false
ensures ensures
- performs object detection on the given image and returns a - performs object detection on the given image and returns a
vector which indicates the locations of all detected objects. vector which indicates the locations of all detected objects.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment