Commit 6f90f6b8 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Raise ValueError if intersection is empty

parent 713dc00f
......@@ -178,6 +178,9 @@ def bb_intersect(bb: List[BoundingBox]) -> BoundingBox:
ymin = bb[0][1]
ymax = bb[0][3]
for b in bb[1:]:
if b[0] > xmax or b[2] < xmin or b[1] > ymax or b[3] < ymin:
raise ValueError('Bounding Box intersection is empty!')
xmin = max(xmin, b[0])
xmax = min(xmax, b[2])
ymin = max(ymin, b[1])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment