Merge pull request #193 from adi9090/master

Fixed best plate selection
This commit is contained in:
Matthew Hill
2015-09-02 08:16:45 -04:00

View File

@@ -218,12 +218,15 @@ namespace alpr
int bestPlateIndex = 0; int bestPlateIndex = 0;
cv::Mat charTransformMatrix = getCharacterTransformMatrix(&pipeline_data); cv::Mat charTransformMatrix = getCharacterTransformMatrix(&pipeline_data);
bool isBestPlateSelected = false;
for (unsigned int pp = 0; pp < ppResults.size(); pp++) for (unsigned int pp = 0; pp < ppResults.size(); pp++)
{ {
// Set our "best plate" match to either the first entry, or the first entry with a postprocessor template match // Set our "best plate" match to either the first entry, or the first entry with a postprocessor template match
if (bestPlateIndex == 0 && ppResults[pp].matchesTemplate) if (isBestPlateSelected == false && ppResults[pp].matchesTemplate){
bestPlateIndex = plateResult.topNPlates.size(); bestPlateIndex = plateResult.topNPlates.size();
isBestPlateSelected = true;
}
AlprPlate aplate; AlprPlate aplate;
aplate.characters = ppResults[pp].letters; aplate.characters = ppResults[pp].letters;