machinevisiontoolbox.Image.Tile

classmethod Image.Tile(tiles, columns=4, sep=2, bgcolor=None)

Tile images into a grid

Parameters:
  • tiles (iterable of Image) – images to tile

  • columns (int, optional) – number of columns in the grid, defaults to 4

  • sep (int, optional) – separation between images, defaults to 1

  • bgcolor (scalar, string, array_like, optional) – color of background, seen in the separation between images, defaults to black

Raises:
  • ValueError – all images must have the same size

  • ValueError – all images must have the same dtype

Returns:

grid of images

Return type:

Image instance

Construct a new image by tiling the input images into a grid.

Example:

ValueError: (array([[[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0],
        ...,
        [0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]],

       [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0],
        ...,
        [0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]],

       [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0],
        ...,
        [0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]],

       ...,

       [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0],
        ...,
        [0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]],

       [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0],
        ...,
        [0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]],

       [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0],
        ...,
        [0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]]], dtype=uint8), 'Image must be greyscale')

(Source code)

Seealso:

Hstack Vstack