Public Member Functions | Static Public Attributes

DetectionEvaluator Class Reference
[Auxilliary Tools]

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>

List of all members.

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< EvaluationMetricsevaluateImagePerformance (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< EvaluationMetricsevaluatePerformance (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].

Detailed Description

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.

Author:
Nicholas Butko
Date:
2010
Version:
0.4

Constructor & Destructor Documentation

DetectionEvaluator::DetectionEvaluator ( ImageDataSet imageDataSet )

Constructor.

Parameters:
imageDataSetThe labeled images that we want to use to evaluate for object detector performance.
DetectionEvaluator::DetectionEvaluator ( const std::string &  fileListFile,
const std::string &  labelFile 
)

Constructor.

Parameters:
fileListFilePath 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.
labelFilePath 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.

Member Function Documentation

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.

Parameters:
imNumIndex of image in the dataset.
boxesOutput of an object detector, such as a GentleBoostCascadedClassifier, evaluated on the image whose path is getFileNames()[imNum].
Returns:
Performance on a single image for a range of thresholds, in terms of hits, misses, and false_alarms.
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.

Parameters:
imNumIndex of image in the dataset.
boxesOutput of an object detector, such as a GentleBoostCascadedClassifier, evaluated on the image whose path is getFileNames()[imNum].
thresholdDetection threshold. SearchResult data with value less than threshold are not considered.
Returns:
Performance on a single image for a given threshold, in terms of hits, misses, and false_alarms.
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.

Parameters:
imBoxesOutput of an object detector, such as a GentleBoostCascadedClassifier, evaluated on every image in the dataset.
Returns:
Performance on all images for a range of thresholds, in terms of hits, misses, and false_alarms.
vector< string > DetectionEvaluator::getFileNames (  )

Get the names of the images used for evaluation. In contrast to the ImageDataSet format, these names are unique.

Returns:
A list of file names containing images in the dataset, one entry per image.
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.

Returns:
A list of target location lists.
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.

Returns:
A string, suitable for writing to a file, that can be used to specify the data needed to train an OpenCV Haar Cascade.

Member Data Documentation

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.


The documentation for this class was generated from the following files: