diff --git a/dlib/image_processing/object_detector.h b/dlib/image_processing/object_detector.h index fdabeccf3..3bea05385 100644 --- a/dlib/image_processing/object_detector.h +++ b/dlib/image_processing/object_detector.h @@ -4,7 +4,6 @@ #define DLIB_OBJECT_DeTECTOR_H__ #include "object_detector_abstract.h" -#include "../matrix.h" #include "../geometry.h" #include #include "box_overlap_testing.h" @@ -21,6 +20,8 @@ namespace dlib class object_detector { public: + typedef typename image_scanner_type::feature_vector_type feature_vector_type; + object_detector ( ); @@ -31,11 +32,11 @@ namespace dlib object_detector ( const image_scanner_type& scanner_, const overlap_tester_type& overlap_tester_, - const matrix& w_ + const feature_vector_type& w_ ); - const matrix& get_w ( - ) const; + const feature_vector_type& get_w ( + ) const { return w; } const overlap_tester_type& get_overlap_tester ( ) const; @@ -104,7 +105,7 @@ namespace dlib } overlap_tester_type boxes_overlap; - matrix w; + feature_vector_type w; image_scanner_type scanner; }; @@ -178,7 +179,7 @@ namespace dlib object_detector ( const image_scanner_type& scanner_, const overlap_tester_type& overlap_tester, - const matrix& w_ + const feature_vector_type& w_ ) : boxes_overlap(overlap_tester), w(w_) @@ -288,19 +289,6 @@ namespace dlib } } -// ---------------------------------------------------------------------------------------- - - template < - typename image_scanner_type, - typename overlap_tester_type - > - const matrix& object_detector:: - get_w ( - ) const - { - return w; - } - // ---------------------------------------------------------------------------------------- template < diff --git a/dlib/image_processing/object_detector_abstract.h b/dlib/image_processing/object_detector_abstract.h index adabde2eb..3312b6b3e 100644 --- a/dlib/image_processing/object_detector_abstract.h +++ b/dlib/image_processing/object_detector_abstract.h @@ -3,7 +3,6 @@ #undef DLIB_OBJECT_DeTECTOR_ABSTRACT_H__ #ifdef DLIB_OBJECT_DeTECTOR_ABSTRACT_H__ -#include "../matrix.h" #include "../geometry.h" #include #include "box_overlap_testing_abstract.h" @@ -37,6 +36,8 @@ namespace dlib non-max suppression on the output of the scan_image_pyramid object. !*/ public: + typedef typename image_scanner_type::feature_vector_type feature_vector_type; + object_detector ( ); /*! @@ -59,7 +60,7 @@ namespace dlib object_detector ( const image_scanner_type& scanner, const overlap_tester_type& overlap_tester, - const matrix& w + const feature_vector_type& w ); /*! requires @@ -81,7 +82,7 @@ namespace dlib I.e. the copy is done using copy_configuration()) !*/ - const matrix& get_w ( + const feature_vector_type& get_w ( ) const; /*! ensures