From 004f7a5bd897fc13c5d84020040d50961896e456 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Tue, 8 Apr 2014 13:21:15 -0500 Subject: [PATCH] Skipping OCR processing when num of possible characters is too small --- src/openalpr/ocr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openalpr/ocr.cpp b/src/openalpr/ocr.cpp index e665f96..dde363b 100644 --- a/src/openalpr/ocr.cpp +++ b/src/openalpr/ocr.cpp @@ -52,6 +52,10 @@ void OCR::performOCR(vector thresholds, vector charRegions) getTime(&startTime); postProcessor->clear(); + + // Don't waste time on OCR processing if it is impossible to get sufficient characters + if (charRegions.size() < config->postProcessMinCharacters) + return; for (int i = 0; i < thresholds.size(); i++) {