From f2426231b9059c5bcfcc7708ccda8f935bb75d83 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sun, 31 Mar 2013 15:18:24 -0400 Subject: [PATCH] Changed the object_detector interface slightly. In particular, it now handles the adjust_threshold argument slightly differently in that it does not add it to the output detection score anymore. --- dlib/image_processing/object_detector.h | 4 ++-- dlib/image_processing/object_detector_abstract.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlib/image_processing/object_detector.h b/dlib/image_processing/object_detector.h index 32f9687de..add2fb5b1 100644 --- a/dlib/image_processing/object_detector.h +++ b/dlib/image_processing/object_detector.h @@ -293,10 +293,10 @@ namespace dlib if (w.size() != 0) { std::vector > dets; - const double thresh = w(scanner.get_num_dimensions()) + adjust_threshold; + const double thresh = w(scanner.get_num_dimensions()); scanner.load(img); - scanner.detect(w, dets, thresh); + scanner.detect(w, dets, thresh + adjust_threshold); for (unsigned long i = 0; i < dets.size(); ++i) { diff --git a/dlib/image_processing/object_detector_abstract.h b/dlib/image_processing/object_detector_abstract.h index 9a4de2a70..4c151630a 100644 --- a/dlib/image_processing/object_detector_abstract.h +++ b/dlib/image_processing/object_detector_abstract.h @@ -153,15 +153,19 @@ namespace dlib - #dets.size() == the number of detected objects. - #dets[i].first gives the "detection confidence", of the i-th detection. This is the detection value output by the scanner - minus the threshold, therefore this is a value > 0. + minus the threshold. - #dets[i].second == the bounding box for the i-th detection. - #get_scanner() will have been loaded with img. Therefore, you can call #get_scanner().get_feature_vector() to obtain the feature vectors or #get_scanner().get_full_object_detection() to get the full_object_detections for the resulting object detection boxes. - - The detection threshold is adjusted by having adjust_threshold added - to it. Therefore, an adjust_threshold value > 0 makes detecting - objects harder while a negative one makes it easier. + - The detection threshold is adjusted by having adjust_threshold added to + it. Therefore, an adjust_threshold value > 0 makes detecting objects + harder while a negative one makes it easier. Moreover, the following + will be true for all valid i: + - #dets[i].first >= adjust_threshold + This means that, for example, you can obtain all possible detections as + outputs by setting adjust_threshold equal to negative infinity. !*/ template <