Commit d6d1ab85 authored by Davis King's avatar Davis King

Added another overloaded operator() to the object_detector. This

one makes it easy to get just a list of full_object_detections
as output.
parent 8460f421
......@@ -74,6 +74,15 @@ namespace dlib
double adjust_threshold = 0
);
template <
typename image_type
>
void operator() (
const image_type& img,
std::vector<full_object_detection>& final_dets,
double adjust_threshold = 0
);
template <typename T, typename U>
friend void serialize (
const object_detector<T,U>& item,
......@@ -337,6 +346,35 @@ namespace dlib
}
}
// ----------------------------------------------------------------------------------------
template <
typename image_scanner_type,
typename overlap_tester_type
>
template <
typename image_type
>
void object_detector<image_scanner_type,overlap_tester_type>::
operator() (
const image_type& img,
std::vector<full_object_detection>& final_dets,
double adjust_threshold
)
{
std::vector<std::pair<double, rectangle> > temp_dets;
(*this)(img,temp_dets,adjust_threshold);
final_dets.clear();
final_dets.reserve(temp_dets.size());
// convert all the rectangle detections into full_object_detections.
for (unsigned long i = 0; i < temp_dets.size(); ++i)
{
final_dets.push_back(scanner.get_full_object_detection(temp_dets[i].second, w));
}
}
// ----------------------------------------------------------------------------------------
template <
......
......@@ -188,6 +188,23 @@ namespace dlib
into full_object_detections. Therefore, this version of operator() is
simply a convenience function for performing this set of operations.
!*/
template <
typename image_type
>
void operator() (
const image_type& img,
std::vector<full_object_detection>& final_dets,
double adjust_threshold = 0
);
/*!
requires
- img == an object which can be accepted by image_scanner_type::load()
ensures
- This function is identical to the above operator() routine, except that
it doesn't include a double valued score. That is, it just outputs the
full_object_detections.
!*/
};
// ----------------------------------------------------------------------------------------
......
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