Return a `Bbox` that contains all of the given *bboxes*.
(bboxes)
| 664 | |
| 665 | @staticmethod |
| 666 | def union(bboxes): |
| 667 | """Return a `Bbox` that contains all of the given *bboxes*.""" |
| 668 | if not len(bboxes): |
| 669 | raise ValueError("'bboxes' cannot be empty") |
| 670 | x0 = np.min([bbox.xmin for bbox in bboxes]) |
| 671 | x1 = np.max([bbox.xmax for bbox in bboxes]) |
| 672 | y0 = np.min([bbox.ymin for bbox in bboxes]) |
| 673 | y1 = np.max([bbox.ymax for bbox in bboxes]) |
| 674 | return Bbox([[x0, y0], [x1, y1]]) |
| 675 | |
| 676 | @staticmethod |
| 677 | def intersection(bbox1, bbox2): |