diff --git a/src/misc_utilities/benchmark.cpp b/src/misc_utilities/benchmark/benchmark.cpp similarity index 100% rename from src/misc_utilities/benchmark.cpp rename to src/misc_utilities/benchmark/benchmark.cpp diff --git a/src/misc_utilities/benchmark/endtoendtest.h b/src/misc_utilities/benchmark/endtoendtest.h new file mode 100644 index 0000000..d0d2469 --- /dev/null +++ b/src/misc_utilities/benchmark/endtoendtest.h @@ -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 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 \ No newline at end of file diff --git a/src/openalpr/support/filesystem.cpp b/src/openalpr/support/filesystem.cpp index 7e8d66e..d547423 100644 --- a/src/openalpr/support/filesystem.cpp +++ b/src/openalpr/support/filesystem.cpp @@ -101,3 +101,9 @@ bool stringCompare( const std::string &left, const std::string &right ) return true; return false; } + +std::string filenameWithoutExtension(std::string filename) +{ + int lastindex = filename.find_last_of("."); + return filename.substr(0, lastindex); +} \ No newline at end of file