(lefttop, rightbottom)
return np.array((lefttop, rightbottom), dtype=lefttop.dtype)
create a rectangle structure from top left and bottom right point.
    :param leftop: np.array from pt()
    :param rightbottom: np.array from pt()
    :return 2x2 np.array matrix, first row is top left point, second row is bottom right point
create a rectangle structure from top left and bottom right point.
    :param leftop: np.array from pt()
    :param rightbottom: np.array from pt()
    :return 2x2 np.array matrix, first row is top left point, second row is bottom right point
create a rectangle structure from top left and bottom right point . : param leftop : np . array from pt () : param rightbottom : np . array from pt () : return 2x2 np . array matrix first row is top left point second row is bottom right point
def rect(lefttop, rightbottom):
    """
    create a rectangle structure from top left and bottom right point.
    :param leftop: np.array from pt()
    :param rightbottom: np.array from pt()
    :return 2x2 np.array matrix, first row is top left point, second row is bottom right point
    """
    if lefttop.dtype != rightbottom.dtype:
        raise ValueError('dtypes of lefttop and rightbottom must match')
    
    if lefttop[0] >= rightbottom[0]:
        raise ValueError('lefttop[0] must be smaller than rightbottom[0] to form a rectangle')
    
    if lefttop[1] >= rightbottom[1]:
        raise ValueError('lefttop[1] must be smaller than rightbottom[1] to form a rectangle')
    
    return np.array((lefttop, rightbottom), dtype=lefttop.dtype)
def rect ( lefttop , rightbottom ) : if lefttop . dtype != rightbottom . dtype : raise ValueError ( 'dtypes of lefttop and rightbottom must match' ) if lefttop [ 0 ] >= rightbottom [ 0 ] : raise ValueError ( 'lefttop[0] must be smaller than rightbottom[0] to form a rectangle' ) if lefttop [ 1 ] >= rightbottom [ 1 ] : raise ValueError ( 'lefttop[1] must be smaller than rightbottom[1] to form a rectangle' ) return np . array ( ( lefttop , rightbottom ) , dtype = lefttop . dtype )