def bb_centroid_calc(data, return_type = 'int'):
    """
    data assumed to be 1x4 numpy array with x1, y1, x2, y2
    returns centroid as x,y (note this is reverse of many image coordinates)
    
    Note returns as int for images
    """
    if return_type == 'int':
        x_cent = (data[0]+data[2])//2
        y_cent = (data[1]+data[3])//2
    else:
        x_cent = (data[0]+data[2])/2
        y_cent = (data[1]+data[3])/2
    return (x_cent, y_cent)