mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 06:30:58 +08:00
Added negative width/height checking to expandedRegion
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user