From 32793c5991ba1cdd9c72d0c6c42608fba10f3a11 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Tue, 21 Oct 2014 18:20:29 -0400 Subject: [PATCH] Resolves issue #58 - Remove template match from output when template not provided --- src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 556398e..64b52c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,6 +43,7 @@ std::string getJson(Alpr* alpr, std::vector results); bool detectandshow(Alpr* alpr, cv::Mat frame, std::string region, bool writeJson); bool measureProcessingTime = false; +std::string templateRegion; // This boolean is set to false when the user hits terminates (e.g., CTRL+C ) // so we can end infinite loops for things like video processing. @@ -55,7 +56,6 @@ int main( int argc, const char** argv ) bool outputJson = false; int seektoms = 0; bool detectRegion = false; - std::string templateRegion; std::string country; int topn; @@ -303,7 +303,11 @@ bool detectandshow( Alpr* alpr, cv::Mat frame, std::string region, bool writeJso for (int k = 0; k < results[i].topNPlates.size(); k++) { - std::cout << " - " << results[i].topNPlates[k].characters << "\t confidence: " << results[i].topNPlates[k].overall_confidence << "\t template_match: " << results[i].topNPlates[k].matches_template << std::endl; + std::cout << " - " << results[i].topNPlates[k].characters << "\t confidence: " << results[i].topNPlates[k].overall_confidence; + if (templateRegion.size() > 0) + std::cout << "\t template_match: " << results[i].topNPlates[k].matches_template; + + std::cout << std::endl; } } }