RobotecAI / RobotecAI/rai

3D detection pipeline filtering

Open
#680 1 comment 0 reactions 1 assignee View on GitHub

@maciejmajek is already working on this.

Since Sep 2, 2025.

enhancement
Dominant language
Python
Stars
589
Forks
76
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Is your feature request related to a problem? Please describe.
3D detection pipeline need filtering

Image

Describe the solution you'd like

Image

Filtering algo, example below

        def _filter_outliers_statistical(points_array: np.ndarray, k: int = 20, std_ratio: float = 2.0) -> np.ndarray:
            if points_array.shape[0] == 0:
                return points_array
            k_eff = min(max(2, k), points_array.shape[0])
            nn = NearestNeighbors(n_neighbors=k_eff, algorithm="auto")
            nn.fit(points_array)
            distances, _ = nn.kneighbors(points_array)
            # exclude the zero-distance to self by dropping the first column when possible
            if distances.shape[1] > 1:
                mean_neighbor_distance = distances[:, 1:].mean(axis=1)
            else:
                mean_neighbor_distance = distances.mean(axis=1)
            threshold = mean_neighbor_distance.mean() + std_ratio * mean_neighbor_distance.std()
            inlier_mask = mean_neighbor_distance <= threshold
            return points_array[inlier_mask]

Describe alternatives you've considered
None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.