Resolves issue #58 - Remove template match from output when template not provided

This commit is contained in:
Matt Hill
2014-10-21 18:20:29 -04:00
parent e9280cc2c4
commit 32793c5991

View File

@@ -43,6 +43,7 @@ std::string getJson(Alpr* alpr, std::vector<AlprResult> results);
bool detectandshow(Alpr* alpr, cv::Mat frame, std::string region, bool writeJson); bool detectandshow(Alpr* alpr, cv::Mat frame, std::string region, bool writeJson);
bool measureProcessingTime = false; bool measureProcessingTime = false;
std::string templateRegion;
// This boolean is set to false when the user hits terminates (e.g., CTRL+C ) // 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. // 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; bool outputJson = false;
int seektoms = 0; int seektoms = 0;
bool detectRegion = false; bool detectRegion = false;
std::string templateRegion;
std::string country; std::string country;
int topn; 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++) 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;
} }
} }
} }