opr.pipelines.registration package

Registration pipelines.

opr.pipelines.registration.pointcloud

Pointcloud registration pipeline.

class opr.pipelines.registration.pointcloud.PointcloudRegistrationPipeline(model: Module, model_weights_path: str | PathLike | None = None, device: str | int | device = 'cuda', voxel_downsample_size: float | None = 0.3, num_points_downsample: int | None = None)[source]

Bases: object

Pointcloud registration pipeline.

infer(query_pc: Tensor, db_pc: Tensor | None = None, db_pc_feats: dict[str, Tensor] | None = None) ndarray[source]

Infer the transformation between the query and the database pointclouds.

Parameters:
  • query_pc (Tensor) – Query pointcloud. Coordinates array of shape (N, 3).

  • db_pc (Tensor, optional) – Database pointcloud. Coordinates array of shape (M, 3). If None, db_pc_feats must be provided. Defaults to None.

  • db_pc_feats (dict[str, Tensor], optional) – Database pointcloud features. If None, db_pc must be provided. Defaults to None.

Returns:

Transformation matrix.

Return type:

np.ndarray

Raises:

ValueError – If both db_pc and db_pc_feats are provided or if none of them are provided.

class opr.pipelines.registration.pointcloud.RansacGlobalRegistrationPipeline(voxel_downsample_size: float = 0.5)[source]

Bases: object

Pointcloud registration pipeline using RANSAC.

infer(query_pc: Tensor, db_pc: Tensor) ndarray[source]

Infer the transformation between the query and the database pointclouds.

Parameters:
  • query_pc (Tensor) – Query pointcloud. Coordinates array of shape (N, 3).

  • db_pc (Tensor) – Database pointcloud. Coordinates array of shape (M, 3).

Returns:

Transformation matrix.

Return type:

np.ndarray

class opr.pipelines.registration.pointcloud.SequencePointcloudRegistrationPipeline(model: Module, model_weights_path: str | PathLike | None = None, device: str | int | device = 'cuda', voxel_downsample_size: float | None = 0.3, num_points_downsample: int | None = None)[source]

Bases: PointcloudRegistrationPipeline

Pointcloud registration pipeline that supports sequences.

infer(query_pc_list: list[Tensor], db_pc: Tensor | None = None, db_pc_feats: dict[str, Tensor] | None = None) ndarray[source]

Infer the transformation between the query and the database pointclouds.

Parameters:
  • query_pc_list (list[Tensor]) – List of query pointclouds. Each pointcloud is a coordinates array of shape (N, 3).

  • db_pc (Tensor, optional) – Database pointcloud. Coordinates array of shape (M, 3). If None, db_pc_feats must be provided. Defaults to None.

  • db_pc_feats (dict[str, Tensor], optional) – Database pointcloud features. If None, db_pc must be provided. Defaults to None.

Returns:

Transformation matrix.

Return type:

np.ndarray