calibrate.py
def generate_checkerboard_image(
        width: int=3,
        height: int=3,
        cell_width: int=100,
        cell_height: int=90,
        as_rgb: bool=True
    ) -> np.array:
    """Generate image of a checkerboard."""
    white = np.zeros((cell_height, cell_width))
    black = white + 1
    row_odd = np.hstack([white, black] * width)
    row_even = np.hstack([black, white] * width)
    channel = np.vstack([row_odd, row_even] * height).astype(np.uint8)
    if as_rgb:
        return np.transpose(np.stack([channel] * 3), (1, 2, 0)) * 255
    return channel
Generate image of a checkerboard.
Generate image of a checkerboard.
Generate image of a checkerboard .
def generate_checkerboard_image(
        width: int=3,
        height: int=3,
        cell_width: int=100,
        cell_height: int=90,
        as_rgb: bool=True
    ) -> np.array:
    white = np.zeros((cell_height, cell_width))
    black = white + 1
    row_odd = np.hstack([white, black] * width)
    row_even = np.hstack([black, white] * width)
    channel = np.vstack([row_odd, row_even] * height).astype(np.uint8)
    if as_rgb:
        return np.transpose(np.stack([channel] * 3), (1, 2, 0)) * 255
    return channel
def generate_checkerboard_image ( width : int = 3 , height : int = 3 , cell_width : int = 100 , cell_height : int = 90 , as_rgb : bool = True ) -> np . array : white = np . zeros ( ( cell_height , cell_width ) ) black = white + 1 row_odd = np . hstack ( [ white , black ] * width ) row_even = np . hstack ( [ black , white ] * width ) channel = np . vstack ( [ row_odd , row_even ] * height ) . astype ( np . uint8 ) if as_rgb : return np . transpose ( np . stack ( [ channel ] * 3 ) , ( 1 , 2 , 0 ) ) * 255 return channel
Generate image of a checkerboard.
Generate image of a checkerboard .
"""Generate image of a checkerboard."""
width
int
height
int
cell_width
int
cell_height
int
as_rgb
bool