Created new end-to-end benchmark that validates detection quality

This commit is contained in:
Matt Hill
2014-06-20 22:27:54 -04:00
parent 7407e1ad8a
commit c5b577b48e
3 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
#ifndef OPENALPR_ENDTOENDTEST_H
#define OPENALPR_ENDTOENDTEST_H
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "alpr_impl.h"
#include "benchmark_utils.h"
class EndToEndTest
{
public:
EndToEndTest(std::string inputDir, std::string outputDir);
void runTest(std::string country, std::vector<std::string> files);
private:
bool rectMatches(cv::Rect actualPlate, PlateRegion candidate);
int totalRectCount(PlateRegion rootCandidate);
std::string inputDir;
std::string outputDir;
};
class EndToEndBenchmarkResult {
public:
EndToEndBenchmarkResult()
{
this->imageName = "";
this->detectedPlate = false;
this->topResultCorrect = false;
this->top10ResultCorrect = false;
this->detectionFalsePositives = 0;
this->resultsFalsePositives = 0;
}
std::string imageName;
bool detectedPlate;
bool topResultCorrect;
bool top10ResultCorrect;
int detectionFalsePositives;
int resultsFalsePositives;
};
#endif //OPENALPR_ENDTOENDTEST_H

View File

@@ -101,3 +101,9 @@ bool stringCompare( const std::string &left, const std::string &right )
return true; return true;
return false; return false;
} }
std::string filenameWithoutExtension(std::string filename)
{
int lastindex = filename.find_last_of(".");
return filename.substr(0, lastindex);
}