def bbox(points):
    """
    [xmin xmax]
    [ymin ymax]
    """
a = zeros((2, 2))
a[:, (0)] = np.min(points, axis=0)
a[:, (1)] = np.max(points, axis=0)
return a
Calculating bounding box of numpy array