Resolves issue #150 Automatically apply pattern matching for countries with only one pattern

This commit is contained in:
Matt Hill
2015-09-24 00:22:23 -04:00
parent 0c088fb2e8
commit c4d35e4e8d
3 changed files with 17 additions and 1 deletions

View File

@@ -277,7 +277,13 @@ namespace alpr
if (!pipeline_data.disqualified)
{
AlprPlateResult plateResult;
plateResult.region = defaultRegion;
// 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];
else
plateResult.region = defaultRegion;
plateResult.regionConfidence = 0;
plateResult.plate_index = platecount++;