Auxilliary Tool:
A tool for evaluating the performance of a whole-image-object-detector, such as a GentleBoostCascadedClassifier, for performance on an ImageDataSet.
More...
#include <DetectionEvaluator.h>
Public Member Functions | |
DetectionEvaluator (ImageDataSet *imageDataSet) | |
Constructor. | |
DetectionEvaluator (const std::string &fileListFile, const std::string &labelFile) | |
Constructor. | |
~DetectionEvaluator () | |
Destructor. | |
std::vector< std::string > | getFileNames () |
Get the names of the images used for evaluation. In contrast to the ImageDataSet format, these names are unique. | |
std::vector< std::vector < cv::Rect > > | getTargetLocations () |
Get the location of the images used for evaluation. There can be several in each image; there is one vector per file name, and possibly several elements per vector. | |
EvaluationMetrics | evaluateImagePerformanceWithThreshold (int imNum, std::vector< SearchResult > boxes, double threshold) |
Evaluate the number of hits, misses, and false alarms on a given image with a given threshold. The object detector output must be supplied in the form of a vector of SearchResults. | |
std::vector< EvaluationMetrics > | evaluateImagePerformance (int imNum, const std::vector< SearchResult > &boxes) |
Evaluate the number of hits, misses, and false alarms on a given image across a range of thresholds. The object detector output must be supplied in the form of a vector of SearchResults. | |
std::vector< EvaluationMetrics > | evaluatePerformance (const std::vector< std::vector< SearchResult > > &imBoxes) |
Evaluate the number of hits, misses, and false alarms on all dataset images across a range of thresholds. The object detector output must be supplied in the form of a vector of SearchResults vectors, one per image. | |
std::string | outputOpenCVDescriptionFormatForHaarTraining () |
Get the "Description Format" used by OpenCV for Haar Training. | |
Static Public Attributes | |
static double | acceptArea = .5 |
Match parameter: defines the overlap requirement between detected objects and known dataset objects. Should be (0-1]. |
Auxilliary Tool:
A tool for evaluating the performance of a whole-image-object-detector, such as a GentleBoostCascadedClassifier, for performance on an ImageDataSet.
Specifically, the evaluation method is fashioned after the "miss-rate as a function of false positives per image" introduced by Dollar et al. in P. Dollar, C. Wojek, B. Schiele, and P. Perona. Pedestrian detection: A benchmark. In CVPR, June 2009.
DetectionEvaluator::DetectionEvaluator | ( | ImageDataSet * | imageDataSet ) |
Constructor.
imageDataSet | The labeled images that we want to use to evaluate for object detector performance. |
DetectionEvaluator::DetectionEvaluator | ( | const std::string & | fileListFile, |
const std::string & | labelFile | ||
) |
Constructor.
fileListFile | Path to a file containing file names of images in the dataset. One file name corresponds to the location of one object, so the same filename may be listed multiple times. |
labelFile | Path to a file containing object locations in the images listed in fileListFile. Each line is a triple containing object center x, object center y, and object width/height. This is the same format used by ImageDataSet. |
std::vector<EvaluationMetrics> DetectionEvaluator::evaluateImagePerformance | ( | int | imNum, |
const std::vector< SearchResult > & | boxes | ||
) |
Evaluate the number of hits, misses, and false alarms on a given image across a range of thresholds. The object detector output must be supplied in the form of a vector of SearchResults.
imNum | Index of image in the dataset. |
boxes | Output of an object detector, such as a GentleBoostCascadedClassifier, evaluated on the image whose path is getFileNames()[imNum]. |
EvaluationMetrics DetectionEvaluator::evaluateImagePerformanceWithThreshold | ( | int | imNum, |
std::vector< SearchResult > | boxes, | ||
double | threshold | ||
) |
Evaluate the number of hits, misses, and false alarms on a given image with a given threshold. The object detector output must be supplied in the form of a vector of SearchResults.
imNum | Index of image in the dataset. |
boxes | Output of an object detector, such as a GentleBoostCascadedClassifier, evaluated on the image whose path is getFileNames()[imNum]. |
threshold | Detection threshold. SearchResult data with value less than threshold are not considered. |
std::vector<EvaluationMetrics> DetectionEvaluator::evaluatePerformance | ( | const std::vector< std::vector< SearchResult > > & | imBoxes ) |
Evaluate the number of hits, misses, and false alarms on all dataset images across a range of thresholds. The object detector output must be supplied in the form of a vector of SearchResults vectors, one per image.
imBoxes | Output of an object detector, such as a GentleBoostCascadedClassifier, evaluated on every image in the dataset. |
vector< string > DetectionEvaluator::getFileNames | ( | ) |
Get the names of the images used for evaluation. In contrast to the ImageDataSet format, these names are unique.
vector< vector< Rect > > DetectionEvaluator::getTargetLocations | ( | ) |
Get the location of the images used for evaluation. There can be several in each image; there is one vector per file name, and possibly several elements per vector.
string DetectionEvaluator::outputOpenCVDescriptionFormatForHaarTraining | ( | ) |
Get the "Description Format" used by OpenCV for Haar Training.
This is useful for converting between an ImageDataset and OpenCV's format which is more closely mirrored by DetectionEvaluator's internal data structures.
double DetectionEvaluator::acceptArea = .5 [static] |
Match parameter: defines the overlap requirement between detected objects and known dataset objects. Should be (0-1].
Specifically, a "hit" is recorded if the area union of a reported bounding box and a dataset object bounding box is acceptArea * intersection. 1 means the overlap must be perfect. The default value, .5, means the union must be at least half of the intersection.