cut_tile

Contents

cut_tile#

rapidtools.processing.street_tiles.cut_tile(image: ndarray, tile: tuple[int, int, int], top: int = 0) → ndarray[source]#

Cut one tile out of a frame, across the seam of a panorama if need be.

Parameters:
  • image – The frame, or the rows of it from top down, as an array with rows first.

  • tile – (left, top, side) in pixels of the whole frame.

  • top – Row of the frame that image starts at.

Returns:

numpy.ndarray – The tile.

Example

>>> import numpy as np
>>> frame = np.arange(40).reshape(4, 10)
>>> cut_tile(frame, (8, 1, 3))[0].tolist()
[18, 19, 10]