RandomCrop#

class tonic.transforms.RandomCrop(sensor_size: Tuple[int, int, int], target_size: Tuple[int, int])[source]#

Crops the sensor size to a smaller size in a random location.

x’ = x - new_sensor_start_x

y’ = y - new_sensor_start_y

Parameters:
  • sensor_size (Tuple[int, int, int]) – a 3-tuple of x,y,p for sensor_size

  • target_size (Tuple[int, int]) – a tuple of x,y target sensor size

Example

>>> transform = tonic.transforms.RandomCrop(sensor_size=(340, 240, 2), target_size=(50, 50))