From 022e191fb93522cd5eff672df1b3d500d0df4af8 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Fri, 25 Sep 2015 20:31:43 -0400 Subject: [PATCH] Fixed a crash on multiline plates when no line is found --- src/openalpr/textdetection/linefinder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openalpr/textdetection/linefinder.cpp b/src/openalpr/textdetection/linefinder.cpp index 441c830..619ba0e 100644 --- a/src/openalpr/textdetection/linefinder.cpp +++ b/src/openalpr/textdetection/linefinder.cpp @@ -62,7 +62,7 @@ namespace alpr if (bestLine.size() > 0) linesFound.push_back(bestLine); - if (pipeline_data->isMultiline) + if (pipeline_data->isMultiline && bestCharArea.size() > 0) { vector next_best_line = findNextBestLine(Size(contours.width, contours.height), bestCharArea); @@ -119,7 +119,7 @@ namespace alpr // Pull out a crop of the plate around the line we know about, // then do a horizontal histogram on all the thresholds. Find the other line based on that histogram - + vector histogramArea = calculateCroppedRegionForHistogram(imageSize, bestLine); Size cropped_quad_size(distanceBetweenPoints(histogramArea[0], histogramArea[1]), distanceBetweenPoints(histogramArea[0], histogramArea[3]));