From d48a41da492b32cbdeefec3663657376e6a382b2 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 20 Oct 2014 20:25:39 -0400 Subject: [PATCH] Do not add lines with no valid characters --- src/openalpr/textdetection/characteranalysis.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openalpr/textdetection/characteranalysis.cpp b/src/openalpr/textdetection/characteranalysis.cpp index c81c398..d959ff5 100644 --- a/src/openalpr/textdetection/characteranalysis.cpp +++ b/src/openalpr/textdetection/characteranalysis.cpp @@ -161,9 +161,10 @@ void CharacterAnalysis::analyze() { vector updatedTextArea = getCharArea(tempTextLines[i].topLine, tempTextLines[i].bottomLine); vector linePolygon = tempTextLines[i].linePolygon; - pipeline_data->textLines.push_back(TextLine(updatedTextArea, linePolygon)); - - Mat debugImage = pipeline_data->textLines[i].drawDebugImage(bestThreshold); + if (updatedTextArea.size() > 0 && linePolygon.size() > 0) + { + pipeline_data->textLines.push_back(TextLine(updatedTextArea, linePolygon)); + } }