(boxes,
                          qboxes,
                          rinc,
                          criterion=-1,
                          z_axis=1,
                          z_center=1.0)
z_axis: the z (height) axis.
        z_center: unified z (height) center of box.
z_axis: the z (height) axis.
        z_center: unified z (height) center of box.
z_axis : the z ( height ) axis . z_center : unified z ( height ) center of box .
def box3d_overlap_kernel(boxes,
                          qboxes,
                          rinc,
                          criterion=-1,
                          z_axis=1,
                          z_center=1.0):
    """
        z_axis: the z (height) axis.
        z_center: unified z (height) center of box.
    """
    N, K = boxes.shape[0], qboxes.shape[0]
    for i in range(N):
        for j in range(K):
            if rinc[i, j] > 0:
                min_z = min(
                    boxes[i, z_axis] + boxes[i, z_axis + 3] * (1 - z_center),
                    qboxes[j, z_axis] + qboxes[j, z_axis + 3] * (1 - z_center))
                max_z = max(
                    boxes[i, z_axis] - boxes[i, z_axis + 3] * z_center,
                    qboxes[j, z_axis] - qboxes[j, z_axis + 3] * z_center)
                iw = min_z - max_z
                if iw > 0:
                    area1 = boxes[i, 3] * boxes[i, 4] * boxes[i, 5]
                    area2 = qboxes[j, 3] * qboxes[j, 4] * qboxes[j, 5]
                    inc = iw * rinc[i, j]
                    if criterion == -1:
                        ua = (area1 + area2 - inc)
                    elif criterion == 0:
                        ua = area1
                    elif criterion == 1:
                        ua = area2
                    else:
                        ua = 1.0
                    rinc[i, j] = inc / ua
                else:
                    rinc[i, j] = 0.0
def box3d_overlap_kernel ( boxes , qboxes , rinc , criterion = - 1 , z_axis = 1 , z_center = 1.0 ) : N , K = boxes . shape [ 0 ] , qboxes . shape [ 0 ] for i in range ( N ) : for j in range ( K ) : if rinc [ i , j ] > 0 : min_z = min ( boxes [ i , z_axis ] + boxes [ i , z_axis + 3 ] * ( 1 - z_center ) , qboxes [ j , z_axis ] + qboxes [ j , z_axis + 3 ] * ( 1 - z_center ) ) max_z = max ( boxes [ i , z_axis ] - boxes [ i , z_axis + 3 ] * z_center , qboxes [ j , z_axis ] - qboxes [ j , z_axis + 3 ] * z_center ) iw = min_z - max_z if iw > 0 : area1 = boxes [ i , 3 ] * boxes [ i , 4 ] * boxes [ i , 5 ] area2 = qboxes [ j , 3 ] * qboxes [ j , 4 ] * qboxes [ j , 5 ] inc = iw * rinc [ i , j ] if criterion == - 1 : ua = ( area1 + area2 - inc ) elif criterion == 0 : ua = area1 elif criterion == 1 : ua = area2 else : ua = 1.0 rinc [ i , j ] = inc / ua else : rinc [ i , j ] = 0.0