File size: 213 Bytes
c6abe34
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
"""Shared geometry utilities."""
import numpy as np


def get_center(bbox):
    """Return (cx, cy) center of a bounding box [x1, y1, x2, y2]."""
    x1, y1, x2, y2 = bbox
    return ((x1 + x2) / 2, (y1 + y2) / 2)