Added multiline context for postprocessing

Pattern matching can now apply line by line patterns for greater accuracy
This commit is contained in:
Matt Hill
2015-09-25 20:38:47 -04:00
parent af6dcdb587
commit 9ce8cf7d3c
7 changed files with 104 additions and 62 deletions

View File

@@ -337,7 +337,11 @@ bool detectandshow( Alpr* alpr, cv::Mat frame, std::string region, bool writeJso
for (int k = 0; k < results.plates[i].topNPlates.size(); k++)
{
std::cout << " - " << results.plates[i].topNPlates[k].characters << "\t confidence: " << results.plates[i].topNPlates[k].overall_confidence;
// Replace the multiline newline character with a dash
std::string no_newline = results.plates[i].topNPlates[k].characters;
std::replace(no_newline.begin(), no_newline.end(), '\n','-');
std::cout << " - " << no_newline << "\t confidence: " << results.plates[i].topNPlates[k].overall_confidence;
if (templatePattern.size() > 0 || results.plates[i].regionConfidence > 0)
std::cout << "\t pattern_match: " << results.plates[i].topNPlates[k].matches_template;