Skip to content

filtering

BoxFilter

BoxFilter(params: FilterParams, tf_buffer: TransformBuffer)

A class composes multiple filtering functions.

Construct a new object.

Parameters:

FilterByLabel

FilterByLabel(labels: Sequence[str | SemanticLabel] | None = None)

Filter a box by checking if the label of the box is included in specified labels.

Note that, if labels is None all boxes pass through this filter.

Construct a new object.

Parameters:

  • labels (Sequence[str | SemanticLabel] | None, default: None ) –

    Sequence of target labels. If None, this filter always returns True.

FilterByUUID

FilterByUUID(uuids: Sequence[str] | None = None)

Filter a box by checking if the uuid of the box is included in specified uuids.

Note that, if uuids is None all boxes pass through this filter.

Construct a new object.

Parameters:

  • uuids (Sequence[str] | None, default: None ) –

    Sequence of target uuids. If None, this filter always returns True.

FilterByDistance

FilterByDistance(min_distance: float, max_distance: float)

Filter a box by checking if the box is within the specified distance.

Note that, the type box is Box2D and its position is None, these boxes pass through this filter.

Construct a new object.

Parameters:

  • min_distance (float) –

    Minimum distance from the ego [m].

  • max_distance (float) –

    Maximum distance from the ego [m].

FilterByPosition

FilterByPosition(min_xy: tuple[float, float], max_xy: tuple[float, float])

Filter a box by checking if the box xy position is within the specified xy position.

Note that, the type box is Box2D and its position is None, these boxes pass through this filter.

Construct a new object.

Parameters:

  • min_xy (tuple[float, float]) –

    Minimum xy position [m].

  • max_xy (tuple[float, float]) –

    Maximum xy position [m].

FilterBySpeed

FilterBySpeed(min_speed: float, max_speed: float)

Filter a 3D box by checking if the box speed is within the specified one.

Note that, the type box is Box2D, or Box3D and its velocity is None, these boxes pass through this filter.

Construct a new object.

Parameters:

  • min_speed (float) –

    Minimum speed [m/s].

  • max_speed (float) –

    Maximum speed [m/s].

FilterByNumPoints

FilterByNumPoints(min_num_points: int = 0)

Filter a 3D box by checking if the box includes points greater than the specified one.

Note that, the type box is Box2D, or Box3D and its num_points is None, these boxes pass through this filter.

Construct a new object.

Parameters:

  • min_num_points (int, default: 0 ) –

    The minimum number of points that a box should include.

FilterParams

A dataclass to represent filtering parameters.

Attributes:

  • labels (Sequence[str | SemanticLabel] | None) –

    Sequence of target labels.

  • uuids (Sequence[str] | None) –

    Sequence of target uuids.

  • min_distance (float) –

    Minimum distance from the ego [m].

  • max_distance (float) –

    Maximum distance from the ego [m].

  • min_xy (tuple[float, float]) –

    Minimum xy position from the ego [m].

  • min_xy (tuple[float, float]) –

    Maximum xy position from the ego [m].

  • min_speed (float) –

    Minimum speed [m/s].

  • max_speed (float) –

    Maximum speed [m/s].

  • min_num_points (int) –

    The minimum number of points which the 3D box should include.