ouster.sdk.core.frame_ops module

filter_uv(frame, coord_2d, lower, upper, invalid=0, filtered_fields=None)[source]

Filters the frame based on the specified image axis (‘u’ or ‘v’). Pixel values that fall within the specified index range [lower, upper) are replaced by the supplied invalid value (default is zero).

Parameters: - frame: LidarFrame - coord_2d: str; image axis to filter (‘u’ rows, ‘v’ columns) - lower: Union[int, float]; lower bound if float it is assumed a percentage - upper: Union[int, float]; upper bound if float it is assumed a percentage - invalid: int; the invalid value to use default is 0 - filtered_fields: Optional[List[str]]; an optional list of fields to filter :rtype: None

Parameters:
  • frame (LidarFrame)

  • coord_2d (str)

  • lower (int | float)

  • upper (int | float)

  • invalid (int)

  • filtered_fields (List[str] | None)

Return type:

None

filter_xyz(frame, xyzlut, axis_idx, lower=-inf, upper=inf, invalid=0, filtered_fields=None, dewarp_points=False)[source]

Filters the frame based on spatial coordinates (X, Y, or Z). Points with coordinates inside the specified range [lower, upper] are replaced with the invalid value (default is zero).

Only PIXEL_FIELD types (spatial/image-like data such as RANGE, SIGNAL, REFLECTIVITY) are filtered. Non-spatial fields (IMU, GNSS position, etc.) are preserved.

Parameters: - frame: LidarFrame - xyzlut: Callable[[Union[LidarFrame, np.ndarray]], np.ndarray] - axis_idx: int; spatial axis to filter (0=X, 1=Y, 2=Z) - lower: float; lower bound - upper: float; upper bound - invalid: int; the invalid value to use (default is 0) - filtered_fields: Optional[List[str]]; specific fields to filter (if None, filters all PIXEL_FIELD types) - dewarp_points: bool; if True, dewarp XYZ points using frame.body_to_world :rtype: None

Parameters:
  • frame (LidarFrame)

  • xyzlut (Callable[[LidarFrame | ndarray], ndarray])

  • axis_idx (int)

  • lower (float)

  • upper (float)

  • invalid (int)

  • filtered_fields (List[str] | None)

  • dewarp_points (bool)

Return type:

None

mask(frame, fields, mask)[source]

Applies a boolean mask to frame pixel fields.

mask should have shape (frame.h, frame.w). Pixels where mask == 0 are set to 0. :rtype: None

Parameters:
  • frame (LidarFrame)

  • fields (List[str])

  • mask (ndarray)

Return type:

None

select_by_index_metadata(metadata, indices)[source]

Generate a SensorInfo matching an arbitrary subset of beam indices. :rtype: SensorInfo

Parameters:
Return type:

SensorInfo

select_by_index(frame, indices, update_metadata=False)[source]

Select specific beam rows from the LidarFrame by the supplied indices. Indices must be within the range of the LidarFrame height. :rtype: LidarFrame

Parameters:
  • frame (LidarFrame)

  • indices (List[int])

  • update_metadata (bool)

Return type:

LidarFrame

reduce_by_factor_metadata(metadata, factor)[source]
Return type:

SensorInfo

Parameters:
reduce_by_factor(frame, factor, update_metadata=False)[source]

Vertically downsample the LidarFrame by the supplied factor factor must by a divisor of the LidarFrame height :rtype: LidarFrame

Parameters:
  • frame (LidarFrame)

  • factor (int)

  • update_metadata (bool)

Return type:

LidarFrame