def getBoundsOverlap(bb1, bb2):
    """Returns the intersection of two bounding boxes"""

    minX = max(bb1[0], bb2[0])
    minY = max(bb1[1], bb2[1])
    maxX = min(bb1[2], bb2[2])
    maxY = min(bb1[3], bb2[3])

    return (minX, minY, maxX, maxY)