You need to sign in or sign up before continuing.
Commit 2e98a785 authored by Davis King's avatar Davis King
Browse files

Removed constness from the operator() member functions of the object_detector

since they logically modify the state of the object detector now that
we are exposing the state of the underlying image scanner.
parent bf0ed361
...@@ -52,7 +52,7 @@ namespace dlib ...@@ -52,7 +52,7 @@ namespace dlib
> >
std::vector<rectangle> operator() ( std::vector<rectangle> operator() (
const image_type& img const image_type& img
) const; );
template < template <
typename image_type typename image_type
...@@ -60,7 +60,7 @@ namespace dlib ...@@ -60,7 +60,7 @@ namespace dlib
void operator() ( void operator() (
const image_type& img, const image_type& img,
std::vector<std::pair<double, rectangle> >& final_dets std::vector<std::pair<double, rectangle> >& final_dets
) const; );
template <typename T, typename U> template <typename T, typename U>
friend void serialize ( friend void serialize (
...@@ -104,7 +104,7 @@ namespace dlib ...@@ -104,7 +104,7 @@ namespace dlib
overlap_tester_type boxes_overlap; overlap_tester_type boxes_overlap;
matrix<double,0,1> w; matrix<double,0,1> w;
mutable image_scanner_type scanner; image_scanner_type scanner;
}; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
...@@ -228,7 +228,7 @@ namespace dlib ...@@ -228,7 +228,7 @@ namespace dlib
std::vector<rectangle> object_detector<image_scanner_type,overlap_tester_type>:: std::vector<rectangle> object_detector<image_scanner_type,overlap_tester_type>::
operator() ( operator() (
const image_type& img const image_type& img
) const )
{ {
std::vector<rectangle> final_dets; std::vector<rectangle> final_dets;
if (w.size() != 0) if (w.size() != 0)
...@@ -264,7 +264,7 @@ namespace dlib ...@@ -264,7 +264,7 @@ namespace dlib
operator() ( operator() (
const image_type& img, const image_type& img,
std::vector<std::pair<double, rectangle> >& final_dets std::vector<std::pair<double, rectangle> >& final_dets
) const )
{ {
final_dets.clear(); final_dets.clear();
if (w.size() != 0) if (w.size() != 0)
......
...@@ -111,7 +111,7 @@ namespace dlib ...@@ -111,7 +111,7 @@ namespace dlib
> >
std::vector<rectangle> operator() ( std::vector<rectangle> operator() (
const image_type& img const image_type& img
) const; );
/*! /*!
requires requires
- img == an object which can be accepted by image_scanner_type::load() - img == an object which can be accepted by image_scanner_type::load()
...@@ -132,7 +132,7 @@ namespace dlib ...@@ -132,7 +132,7 @@ namespace dlib
void operator() ( void operator() (
const image_type& img, const image_type& img,
std::vector<std::pair<double, rectangle> >& dets std::vector<std::pair<double, rectangle> >& dets
) const; );
/*! /*!
requires requires
- img == an object which can be accepted by image_scanner_type::load() - img == an object which can be accepted by image_scanner_type::load()
......
...@@ -73,7 +73,7 @@ namespace dlib ...@@ -73,7 +73,7 @@ namespace dlib
typename image_array_type typename image_array_type
> >
const matrix<double,1,2> test_object_detection_function ( const matrix<double,1,2> test_object_detection_function (
const object_detector_type& detector, object_detector_type& detector,
const image_array_type& images, const image_array_type& images,
const std::vector<std::vector<rectangle> >& truth_rects, const std::vector<std::vector<rectangle> >& truth_rects,
const double overlap_eps = 0.5 const double overlap_eps = 0.5
......
...@@ -17,7 +17,7 @@ namespace dlib ...@@ -17,7 +17,7 @@ namespace dlib
typename image_array_type typename image_array_type
> >
const matrix<double,1,2> test_object_detection_function ( const matrix<double,1,2> test_object_detection_function (
const object_detector_type& detector, object_detector_type& detector,
const image_array_type& images, const image_array_type& images,
const std::vector<std::vector<rectangle> >& truth_rects, const std::vector<std::vector<rectangle> >& truth_rects,
const double overlap_eps = 0.5 const double overlap_eps = 0.5
......
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