tonic.functional.drop_by_area_numpy#
- tonic.functional.drop_by_area_numpy(events: ndarray, sensor_size: Tuple, area_ratio: Union[float, Tuple[float]] = 0.2)[source]#
Drops events located in a randomly chosen box area. The size of the box area is defined by a specified ratio of the sensor size.
- Parameters:
events (np.ndarray) – ndarray of shape [num_events, num_event_channels]
sensor_size (Tuple) – size of the sensor that was used [W,H,P]
area_ratio (Union[float, Tuple[float]], optional) – Ratio of the sensor resolution that determines the size of the box area where events are dropped. - if a float, the value is used to calculate the size of the box area - if a tuple of 2 floats, the ratio is randomly chosen in [min, max) Defaults to 0.2.
- Returns:
augmented events that were not dropped (i.e., the events that are not located in the box area).
- Return type:
np.ndarray