From 7a5eb7d1479c814e46062f31fc5f4c82cdcc6c03 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 13 Mar 2016 15:50:14 -0400 Subject: [PATCH] Explicitly double-adding the first OCR character --- src/openalpr/ocr.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openalpr/ocr.cpp b/src/openalpr/ocr.cpp index e9450ec..ec33789 100644 --- a/src/openalpr/ocr.cpp +++ b/src/openalpr/ocr.cpp @@ -117,7 +117,13 @@ namespace alpr //1/17/2016 adt adding check to avoid double adding same character if ci is same as symbol. Otherwise first choice from ResultsIterator will get added twice when choiceIterator run. if (string(symbol) != string(choice)) postProcessor.addLetter(string(choice), line_idx, absolute_charpos, ci.Confidence()); - + else + { + // Explictly double-adding the first character. This leads to higher accuracy right now, likely because other sections of code + // have expected it and compensated. + // TODO: Figure out how to remove this double-counting of the first letter without impacting accuracy + postProcessor.addLetter(string(choice), line_idx, absolute_charpos, ci.Confidence()); + } if (this->config->debugOcr) { if (indent) printf("\t\t ");