Added negative width/height checking to expandedRegion

This commit is contained in:
Matt Hill
2015-05-15 05:37:38 -04:00
parent f66a1dfd56
commit b810ee3d0a

View File

@@ -46,6 +46,10 @@ namespace alpr
expandedRegion.width = maxX - expandedRegion.x; expandedRegion.width = maxX - expandedRegion.x;
if (expandedRegion.y + expandedRegion.height > maxY) if (expandedRegion.y + expandedRegion.height > maxY)
expandedRegion.height = maxY - expandedRegion.y; expandedRegion.height = maxY - expandedRegion.y;
if (expandedRegion.width < 0)
expandedRegion.width = 0;
if (expandedRegion.height < 0)
expandedRegion.height = 0;
return expandedRegion; return expandedRegion;
} }