def bbox_overlap(abox, bbox):
    x11 = abox[0]
    y11 = abox[1]
    x12 = ((abox[0] + abox[2]) - 1)
    y12 = ((abox[1] + abox[3]) - 1)
    x21 = bbox[0]
    y21 = bbox[1]
    x22 = ((bbox[0] + bbox[2]) - 1)
    y22 = ((bbox[1] + bbox[3]) - 1)
    overlap_box_x2 = min(x12, x22)
    overlap_box_x1 = max(x11, x21)
    overlap_box_y2 = min(y12, y22)
    overlap_box_y1 = max(y11, y21)
    overlap_box = list(bbox)
    overlap_box[0] = overlap_box_x1
    overlap_box[1] = overlap_box_y1
    overlap_box[2] = ((overlap_box_x2 - overlap_box_x1) + 1)
    overlap_box[3] = ((overlap_box_y2 - overlap_box_y1) + 1)
    xoverlap = max(0, (overlap_box_x2 - overlap_box_x1))
    yoverlap = max(0, (overlap_box_y2 - overlap_box_y1))
    overlap_pix = (xoverlap * yoverlap)
    return (overlap_pix, overlap_box)
def bbox_overlap(abox, bbox):
    x11 = abox[0]
    y11 = abox[1]
    x12 = ((abox[0] + abox[2]) - 1)
    y12 = ((abox[1] + abox[3]) - 1)
    x21 = bbox[0]
    y21 = bbox[1]
    x22 = ((bbox[0] + bbox[2]) - 1)
    y22 = ((bbox[1] + bbox[3]) - 1)
    overlap_box_x2 = min(x12, x22)
    overlap_box_x1 = max(x11, x21)
    overlap_box_y2 = min(y12, y22)
    overlap_box_y1 = max(y11, y21)
    overlap_box = list(bbox)
    overlap_box[0] = overlap_box_x1
    overlap_box[1] = overlap_box_y1
    overlap_box[2] = ((overlap_box_x2 - overlap_box_x1) + 1)
    overlap_box[3] = ((overlap_box_y2 - overlap_box_y1) + 1)
    xoverlap = max(0, (overlap_box_x2 - overlap_box_x1))
    yoverlap = max(0, (overlap_box_y2 - overlap_box_y1))
    overlap_pix = (xoverlap * yoverlap)
    return (overlap_pix, overlap_box)