/** * @file LocalizationAnalysis.h * @brief Some methods for localization analysis * @author Erik Rodner * @date 09/01/2008 */ #ifndef LOCALIZATIONANALYSISINCLUDE #define LOCALIZATIONANALYSISINCLUDE #include #include #include "LocalizationResult.h" namespace OBJREC { /** Some methods for localization analysis */ class LocalizationAnalysis { protected: double trapezoidArea ( double x1, double y1, double x2, double y2 ); public: /** simple constructor */ LocalizationAnalysis(); /** simple destructor */ virtual ~LocalizationAnalysis(); void matchResults ( LocalizationResult *l, const LocalizationResult *l_gt, std::vector< std::pair > & results, double matchThreshold = 0.3, bool rejectMultipleDetections = true); void calcRecallPrecisionCurve ( const std::vector< std::pair > & results_unsorted, int count_positives, std::vector & thresholdsv, std::vector & recallv, std::vector & precisionv ); double calcAreaUnderROC ( const std::vector & fprate, const std::vector & tprate ); void calcROCCurve ( const std::vector< std::pair > & results_unsorted, int count_positives, int count_negatives, std::vector & thresholdsv, std::vector & fprates, std::vector & tprates ); /** calculates the 11-point estimate of the average precision given recall and precision values (used for PASCAL VOC) */ double calcAveragePrecision ( const std::vector & recall, const std::vector & precision ); /** calculates a precise estimate of the average precision, given recall and precision values */ double calcAveragePrecisionPrecise ( const std::vector & recall, const std::vector & precision ); }; } // namespace #endif