machinevisiontoolbox.Image.Vstack

classmethod Image.Vstack(images, sep=1, bgcolor=None, return_offsets=False)

Vertical concatenation of images

Parameters:
  • images (iterable of Image) – images to concatenate vertically

  • 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

  • return_offsets (bool, optional) – additionally return the vertical coordinates of each input image within the output image, defaults to False

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

  • ValueError – all images must have the same color order

Returns:

vertically stacked images

Return type:

Image

Create a new image by stacking the input images vertically, with a horizontal separator line of width sep and color bgcolor.

The vertical coordinate of the first row of each image, in the composite output image, can be optionally returned if return_offsets is True.

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('street.png')
>>> img
Image: 1280 x 851 (uint8) [.../images/street.png]
>>> Image.Vstack((img, img, img))
Image: 1280 x 2555 (uint8)
>>> Image.Vstack((img, img, img), return_offsets=True)
(Image: 1280 x 2555 (uint8), [0, 852, 1704])

(Source code, png, hires.png, pdf)

../_images/machinevisiontoolbox-Image-Vstack-1.png
Seealso:

Hstack Tile