Public Member Functions | Static Public Attributes

DetectionEvaluator2 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 <DetectionEvaluator2.h>

List of all members.

Public Member Functions

 DetectionEvaluator2 ()
 Default Constructor.
 DetectionEvaluator2 (const DetectionEvaluator2 &copy)
 Copy Constructor.
DetectionEvaluator2operator= (const DetectionEvaluator2 &rhs)
 Assignment operator.
 DetectionEvaluator2 (const ImageDataSet2 &imageDataSet)
 Constructor.
 DetectionEvaluator2 (const std::string &fileListFile, const std::string &labelFile)
 Constructor.
 ~DetectionEvaluator2 ()
 Destructor.
void setDataSet (const ImageDataSet2 &imageDataSet)
 Set data source.
void setDataSet (const std::string &fileListFile, const std::string &labelFile)
 Set data source.
std::vector< std::string > getFileNames () const
 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 () const
 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) const
 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) const
 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) const
 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 () const
 Get the "Description Format" used by OpenCV for Haar Training.
size_t dataSetSize () const
int empty () const

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

DetectionEvaluator2::DetectionEvaluator2 ( const ImageDataSet2 imageDataSet )

Constructor.

Parameters:
imageDataSetThe labeled images that we want to use to evaluate for object detector performance.
DetectionEvaluator2::DetectionEvaluator2 ( 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

size_t DetectionEvaluator2::dataSetSize (  ) const

Get the number of images in the dataset.

int DetectionEvaluator2::empty (  ) const

Check whether a valid dataset has been loaded.

std::vector<EvaluationMetrics> DetectionEvaluator2::evaluateImagePerformance ( int  imNum,
const std::vector< SearchResult > &  boxes 
) const

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 DetectionEvaluator2::evaluateImagePerformanceWithThreshold ( int  imNum,
std::vector< SearchResult boxes,
double  threshold 
) const

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> DetectionEvaluator2::evaluatePerformance ( const std::vector< std::vector< SearchResult > > &  imBoxes ) const

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 > DetectionEvaluator2::getFileNames (  ) const

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 > > DetectionEvaluator2::getTargetLocations (  ) const

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 DetectionEvaluator2::outputOpenCVDescriptionFormatForHaarTraining (  ) const

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.
void DetectionEvaluator2::setDataSet ( const ImageDataSet2 imageDataSet )

Set data source.

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

Set data source.

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 Data Documentation

double DetectionEvaluator2::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: