From 5c6af43212d375b266812609c7d53198d0fc2289 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sat, 30 May 2015 10:11:06 -0400 Subject: [PATCH] Updated textline dependencies to provide crop size in function call. Fixes issue #126. --- src/openalpr/edges/edgefinder.cpp | 2 +- src/openalpr/licenseplatecandidate.cpp | 2 +- src/openalpr/textdetection/characteranalysis.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openalpr/edges/edgefinder.cpp b/src/openalpr/edges/edgefinder.cpp index 2295263..9f4c4df 100644 --- a/src/openalpr/edges/edgefinder.cpp +++ b/src/openalpr/edges/edgefinder.cpp @@ -117,7 +117,7 @@ namespace alpr textAreaRemapped = imgTransform.remapSmallPointstoCrop(textArea, transmtx); linePolygonRemapped = imgTransform.remapSmallPointstoCrop(linePolygon, transmtx); - newLines.push_back(TextLine(textAreaRemapped, linePolygonRemapped)); + newLines.push_back(TextLine(textAreaRemapped, linePolygonRemapped, newCrop.size())); } // Find the PlateLines for this crop diff --git a/src/openalpr/licenseplatecandidate.cpp b/src/openalpr/licenseplatecandidate.cpp index 22d6501..ded6ee9 100644 --- a/src/openalpr/licenseplatecandidate.cpp +++ b/src/openalpr/licenseplatecandidate.cpp @@ -101,7 +101,7 @@ namespace alpr textAreaRemapped = imgTransform.remapSmallPointstoCrop(textArea, transmtx); linePolygonRemapped = imgTransform.remapSmallPointstoCrop(linePolygon, transmtx); - newLines.push_back(TextLine(textAreaRemapped, linePolygonRemapped)); + newLines.push_back(TextLine(textAreaRemapped, linePolygonRemapped, pipeline_data->crop_gray.size())); } pipeline_data->textLines.clear(); diff --git a/src/openalpr/textdetection/characteranalysis.cpp b/src/openalpr/textdetection/characteranalysis.cpp index 1bbd913..c620806 100644 --- a/src/openalpr/textdetection/characteranalysis.cpp +++ b/src/openalpr/textdetection/characteranalysis.cpp @@ -151,7 +151,7 @@ namespace alpr vector textArea = getCharArea(topLine, bottomLine); - TextLine textLine(textArea, linePolygon); + TextLine textLine(textArea, linePolygon, pipeline_data->crop_gray.size()); tempTextLines.push_back(textLine); } @@ -168,7 +168,7 @@ namespace alpr vector linePolygon = tempTextLines[i].linePolygon; if (updatedTextArea.size() > 0 && linePolygon.size() > 0) { - pipeline_data->textLines.push_back(TextLine(updatedTextArea, linePolygon)); + pipeline_data->textLines.push_back(TextLine(updatedTextArea, linePolygon, pipeline_data->crop_gray.size())); } }