draw path

This commit is contained in:
2024-07-01 21:18:33 +02:00
parent dcb4215334
commit f4d8c80ede
2 changed files with 22 additions and 3 deletions
+7
View File
@@ -28,6 +28,13 @@ def bbox_round(src):
return x, y, w, h
def bbox_center(bbox):
x = round(bbox[0] + bbox[2]/2)
y = round(bbox[1] + bbox[3]/2)
return x, y
def bbox_extend(bbox: cv2.typing.Rect, factor: float = 0):
we2 = bbox[2]*factor/2
he2 = bbox[3]*factor/2