def plot_color_checker_image(rgb, rgb2=None, size=(1920, 1080), block_size=(1 / 4.5), padding=0.01):
    "\n    ColorCheckerをプロットする\n\n    Parameters\n    ----------\n    rgb : array_like\n        RGB value of the ColorChecker.\n        RGB's shape must be (24, 3).\n    rgb2 : array_like\n        It's a optional parameter.\n        If You want to draw two different ColorCheckers,\n        set the RGB value to this variable.\n    size : tuple\n        canvas size.\n    block_size : float\n        A each block's size.\n        This value is ratio to height of the canvas.\n    padding : float\n        A padding to the block.\n\n    Returns\n    -------\n    array_like\n        A ColorChecker image.\n\n    "
    IMG_HEIGHT = size[1]
    IMG_WIDTH = size[0]
    COLOR_CHECKER_SIZE = block_size
    COLOR_CHECKER_H_NUM = 6
    COLOR_CHECKER_V_NUM = 4
    COLOR_CHECKER_PADDING = 0.01
    COLOR_CHECKER_H_NUM = 6
    COLOR_CHECKER_V_NUM = 4
    img_height = IMG_HEIGHT
    img_width = IMG_WIDTH
    patch_st_h = int(((IMG_WIDTH / 2.0) - ((((IMG_HEIGHT * COLOR_CHECKER_SIZE) * COLOR_CHECKER_H_NUM) / 2.0) + (((IMG_HEIGHT * COLOR_CHECKER_PADDING) * ((COLOR_CHECKER_H_NUM / 2.0) - 0.5)) / 2.0))))
    patch_st_v = int(((IMG_HEIGHT / 2.0) - ((((IMG_HEIGHT * COLOR_CHECKER_SIZE) * COLOR_CHECKER_V_NUM) / 2.0) + (((IMG_HEIGHT * COLOR_CHECKER_PADDING) * ((COLOR_CHECKER_V_NUM / 2.0) - 0.5)) / 2.0))))
    patch_width = int((img_height * COLOR_CHECKER_SIZE))
    patch_height = patch_width
    patch_space = int((img_height * COLOR_CHECKER_PADDING))
    img_all_patch = np.zeros((img_height, img_width, 3), dtype=np.uint8)
    for idx in range((COLOR_CHECKER_H_NUM * COLOR_CHECKER_V_NUM)):
        v_idx = (idx // COLOR_CHECKER_H_NUM)
        h_idx = (idx % COLOR_CHECKER_H_NUM)
        patch = np.ones((patch_height, patch_width, 3))
        patch[:, :] = rgb[idx]
        st_h = (patch_st_h + ((patch_width + patch_space) * h_idx))
        st_v = (patch_st_v + ((patch_height + patch_space) * v_idx))
        img_all_patch[st_v:(st_v + patch_height), st_h:(st_h + patch_width)] = patch
        pt2 = ((st_h + patch_width), st_v)
        pt3 = (st_h, (st_v + patch_height))
        pt4 = ((st_h + patch_width), (st_v + patch_height))
        pts = np.array((pt2, pt3, pt4))
        sub_color = (rgb[idx].tolist() if (rgb2 is None) else rgb2[idx].tolist())
        cv2.fillPoly(img_all_patch, [pts], sub_color)
    preview_image(img_all_patch)
    return img_all_patch
ColorCheckerをプロットする

Parameters
----------
rgb : array_like
    RGB value of the ColorChecker.
    RGB's shape must be (24, 3).
rgb2 : array_like
    It's a optional parameter.
    If You want to draw two different ColorCheckers,
    set the RGB value to this variable.
size : tuple
    canvas size.
block_size : float
    A each block's size.
    This value is ratio to height of the canvas.
padding : float
    A padding to the block.

Returns
-------
array_like
    A ColorChecker image.
def plot_color_checker_image(rgb, rgb2=None, size=(1920, 1080), block_size=(1 / 4.5), padding=0.01):
    "\n    ColorCheckerをプロットする\n\n    Parameters\n    ----------\n    rgb : array_like\n        RGB value of the ColorChecker.\n        RGB's shape must be (24, 3).\n    rgb2 : array_like\n        It's a optional parameter.\n        If You want to draw two different ColorCheckers,\n        set the RGB value to this variable.\n    size : tuple\n        canvas size.\n    block_size : float\n        A each block's size.\n        This value is ratio to height of the canvas.\n    padding : float\n        A padding to the block.\n\n    Returns\n    -------\n    array_like\n        A ColorChecker image.\n\n    "
    IMG_HEIGHT = size[1]
    IMG_WIDTH = size[0]
    COLOR_CHECKER_SIZE = block_size
    COLOR_CHECKER_H_NUM = 6
    COLOR_CHECKER_V_NUM = 4
    COLOR_CHECKER_PADDING = 0.01
    COLOR_CHECKER_H_NUM = 6
    COLOR_CHECKER_V_NUM = 4
    img_height = IMG_HEIGHT
    img_width = IMG_WIDTH
    patch_st_h = int(((IMG_WIDTH / 2.0) - ((((IMG_HEIGHT * COLOR_CHECKER_SIZE) * COLOR_CHECKER_H_NUM) / 2.0) + (((IMG_HEIGHT * COLOR_CHECKER_PADDING) * ((COLOR_CHECKER_H_NUM / 2.0) - 0.5)) / 2.0))))
    patch_st_v = int(((IMG_HEIGHT / 2.0) - ((((IMG_HEIGHT * COLOR_CHECKER_SIZE) * COLOR_CHECKER_V_NUM) / 2.0) + (((IMG_HEIGHT * COLOR_CHECKER_PADDING) * ((COLOR_CHECKER_V_NUM / 2.0) - 0.5)) / 2.0))))
    patch_width = int((img_height * COLOR_CHECKER_SIZE))
    patch_height = patch_width
    patch_space = int((img_height * COLOR_CHECKER_PADDING))
    img_all_patch = np.zeros((img_height, img_width, 3), dtype=np.uint8)
    for idx in range((COLOR_CHECKER_H_NUM * COLOR_CHECKER_V_NUM)):
        v_idx = (idx // COLOR_CHECKER_H_NUM)
        h_idx = (idx % COLOR_CHECKER_H_NUM)
        patch = np.ones((patch_height, patch_width, 3))
        patch[:, :] = rgb[idx]
        st_h = (patch_st_h + ((patch_width + patch_space) * h_idx))
        st_v = (patch_st_v + ((patch_height + patch_space) * v_idx))
        img_all_patch[st_v:(st_v + patch_height), st_h:(st_h + patch_width)] = patch
        pt2 = ((st_h + patch_width), st_v)
        pt3 = (st_h, (st_v + patch_height))
        pt4 = ((st_h + patch_width), (st_v + patch_height))
        pts = np.array((pt2, pt3, pt4))
        sub_color = (rgb[idx].tolist() if (rgb2 is None) else rgb2[idx].tolist())
        cv2.fillPoly(img_all_patch, [pts], sub_color)
    preview_image(img_all_patch)
    return img_all_patch