Legacy and tensor remove_radius_outlier(s) count nb_points differently (> vs >=)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Read the two implementations named in the issue: cpp/open3d/geometry/PointCloud.cpp around line 606 and cpp/open3d/t/geometry/PointCloud.cpp around line 673, then run the two-line repro to see the divergence. The existing tensor test RemoveRadiusOutliers in cpp/tests/t/geometry/PointCloud.cpp is the natural place to add a case. Done means both APIs agree on nb_points and the header (PointCloud.h:284) and pybind docstring (pybind/geometry/pointcloud.cpp:139) state whether the point itself counts — but the > vs >= choice is a maintainer decision, so ask before changing behavior.
索引モデルが issue の本文から書いたものです。
説明
Checklist
- I have searched for similar issues.
- For Python issues, I have tested with the latest development wheel. (Tested with the 0.20.0 release wheel; the two comparisons below are unchanged on
mainat 2ce4f7e.) - I have checked the release documentation and the latest documentation (for
mainbranch).
Describe the issue
geometry.PointCloud.remove_radius_outlier and t.geometry.PointCloud.remove_radius_outliers give different results for the same nb_points and radius. In both, the neighbor count includes the point itself, but the comparisons differ:
- legacy,
cpp/open3d/geometry/PointCloud.cpp:606:mask[i] = (nb_neighbors > nb_points);(keeps a point with at leastnb_pointsother points; this is also PCL'sRadiusOutlierRemovalrule, where k includes the query point and points withk <= min_ptsare removed) - tensor,
cpp/open3d/t/geometry/PointCloud.cpp:673:num_neighbors.Ge(static_cast<int64_t>(nb_points))(keeps a point with at leastnb_points - 1other points)
The documentation can be read either way:
- C++ header (
PointCloud.h:284): "Function to remove points that have less than \p nb_points in a sphere of a given radius." - Python docstring (
pybind/geometry/pointcloud.cpp:139): "Removes points that have neighbors less than nb_points in a sphere of a given radius" - Tutorial (
pointcloud_outlier_removal.ipynb): "nb_points, which lets you pick the minimum amount of points that the sphere should contain."
nb_points < 1 is rejected by input validation. With >=, nb_points=1 would keep every point; with >, it removes isolated points (as used in #2830).
Which counting is intended?
Steps to reproduce the bug
import numpy as np, open3d as o3d, open3d.core as o3c
def both(P, n, r):
P = np.asarray(P, dtype=np.float64)
legacy = o3d.geometry.PointCloud(o3d.utility.Vector3dVector(P)).remove_radius_outlier(n, r)[1]
mask = o3d.t.geometry.PointCloud(o3c.Tensor(P.astype(np.float32))).remove_radius_outliers(n, r)[1].numpy()
return [int(i) for i in legacy], [int(i) for i in np.nonzero(mask)[0]]
print(both([[0, 0, 0], [0.1, 0, 0], [0, 0.1, 0], [9, 9, 9]], 3, 0.5)) # ([], [0, 1, 2])
print(both([[0, 0, 0], [9, 9, 9]], 1, 0.5)) # ([], [0, 1])
Error message
No error. The kept indices differ (shown in the comments above).
Expected behavior
The two APIs keep the same points for the same nb_points and radius, and the docstrings say whether the point itself is counted.
Open3D, Python and System information
- Operating system: macOS 26.6.2 (arm64)
- Python version: 3.12.11
- Open3D version: 0.20.0 (pip wheel)
- System architecture: arm64
- Is this a remote workstation?: no
- How did you install Open3D?: pip
Additional information
The same difference shows on the data of the tensor unit test RemoveRadiusOutliers in cpp/tests/t/geometry/PointCloud.cpp (nb_points=3, radius 0.5): the tensor path keeps 4 points, the legacy path keeps 2.
Either direction is a one-line change: legacy > to >=, or tensor Ge to Gt. I can open a PR for the one you prefer, with a test, a docstring note on whether the point itself is counted, and a CHANGELOG line.
The analysis and repro were prepared with AI assistance.
- 主要言語
- C++
- スター
- 14.3k
- フォーク
- 2.7k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
isl-org/Open3D のほかの issue
-
Add explicit list of supported format in io documentation対応中かも @SKSavale が 60 日前に担当しました。 オープンfeature request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
feature request
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
-
Getting Started page gives incorrect link to development wheels対応中かも @SatvikMishra08 が 59 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Window(title, width, height, flags) ignores the flags argument対応中かも @Wahaj18 が 56 日前に担当しました。 オープンbug
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
compute_fpfh_feature stub incorrectly requires the optional indices argument対応中かも @huxiaoyi-ovo が 60 日前に担当しました。 オープンbug
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
jaff-chemistry/jaff#231 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
ColumnDecimal::Append(Int128) stores a value outside the Decimal(P, S) range with no error: cut to 32/64 bits, or with too many digits対応中かも @RUSHIT305 が今日担当しました。 オープンbug data-types
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ClickHouse/clickhouse-cpp#645 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation enhancement help wanted P0
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
メンテナーはふだん 1 日以内に返信
-
DXF import: INSERT ignores the BLOCK base point対応中かも @Kevinzhou03 が今日担当しました。 オープンType: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openscad/openscad#7360 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信