mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-05 23:36:54 +08:00
Return 0 size crop if either width or height is 0
This commit is contained in:
@@ -129,6 +129,10 @@ namespace alpr
|
||||
|
||||
float w = distanceBetweenPoints(leftEdge.midpoint(), rightEdge.midpoint());
|
||||
float h = distanceBetweenPoints(bottomEdge.midpoint(), topEdge.midpoint());
|
||||
|
||||
if (w <= 0 || h <= 0)
|
||||
return Size(0,0);
|
||||
|
||||
float aspect = w/h;
|
||||
int width = targetSize.width;
|
||||
int height = round(((float) width) / aspect);
|
||||
|
Reference in New Issue
Block a user