Added country to API results

This commit is contained in:
Matt Hill
2015-11-05 19:29:56 -05:00
parent 17c6ce9dea
commit 0c9ecd82a3
2 changed files with 5 additions and 0 deletions

View File

@@ -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;

View File

@@ -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];