From 0c9ecd82a3eedb7fde512c2af1ad7361af3f2e49 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 5 Nov 2015 19:29:56 -0500 Subject: [PATCH] Added country to API results --- src/openalpr/alpr.h | 3 +++ src/openalpr/alpr_impl.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/openalpr/alpr.h b/src/openalpr/alpr.h index 2e88961..5f249a1 100644 --- a/src/openalpr/alpr.h +++ b/src/openalpr/alpr.h @@ -84,6 +84,9 @@ namespace alpr // The number requested is always >= the topNPlates count int requested_topn; + // The country (training data code) that was used to recognize the plate + std::string country; + // the best plate is the topNPlate with the highest confidence AlprPlate bestPlate; diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index 5690b2f..02ae42b 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -276,6 +276,8 @@ namespace alpr { AlprPlateResult plateResult; + plateResult.country = config->country; + // If there's only one pattern for a country, use it. Otherwise use the default if (country_recognizers.ocr->postProcessor.getPatterns().size() == 1) plateResult.region = country_recognizers.ocr->postProcessor.getPatterns()[0];