not round too early
This commit is contained in:
@@ -20,17 +20,16 @@ def bbox_add_position(bbox, bbox_add):
|
||||
|
||||
|
||||
def bbox_round(src):
|
||||
x = int(round(src[0]))
|
||||
y = int(round(src[1]))
|
||||
w = int(round(src[2]))
|
||||
h = int(round(src[3]))
|
||||
res = ()
|
||||
for s in src:
|
||||
res += (int(round(s)),)
|
||||
|
||||
return x, y, w, h
|
||||
return res
|
||||
|
||||
|
||||
def bbox_center(bbox):
|
||||
x = round(bbox[0] + bbox[2]/2)
|
||||
y = round(bbox[1] + bbox[3]/2)
|
||||
x = bbox[0] + bbox[2]/2
|
||||
y = bbox[1] + bbox[3]/2
|
||||
|
||||
return x, y
|
||||
|
||||
|
||||
Reference in New Issue
Block a user