[filters/VoxelGrid] Provide a way to override CentroidPoint or add my own Accumulators

オープン
#6,340 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp

調査の方向性

まず、issue で説明されている VoxelGrid と CentroidPoint の実装を読み、定義済みの Accumulators がどのように選択され、適用されるかに注目してください。要求されている override と custom-Accumulator のアプローチを比較し、そのうえで、ユーザー定義のビット単位 OR accumulator のサポートによって完成が実証される、焦点を絞った拡張設計を定義してください。

索引モデルが issue の本文から書いたものです。

説明

kind: request module: filters

Context

I have defined my own points, with x, y, z and color, and an extra field that is essentially a bit mask.
I have been using this for years, and it works fine everywhere, with the exception of VoxelGrid.

VoxelGrid uses CentroidPoint to combine points, and it uses a set of predefined Accumulators to combine the fields within points according to the correct semantics for those fields.

This works fine for coordinates, normals, colours and a few other attribute types that pcl support, but there does not appear to be a way to extend the field types supported by supplying my own Accumulator type for my bit mask fields (which would is essence do a bitwise or on the fields in the incoming points).

With the current code structure it is impossible to override any of the implementations without copying everything up to VoxelGrid into my own code, which seems a bit gross.

Expected behavior

I would like to have full control over the way attributes of my points are treated, especially attributes that pcl doesn't know about as distributed because they are specific to my usage, but I can also see use cases for enabling use of different combination strategies for "standard" attributed like position or color.

Current Behavior

Currently I keep the leaf layout and then make an extra pass over the source points, call getCentroidIndex() and then manually modify the field.

Describe the solution you'd like

If I could override CentroidPoint when instantiating VoxelGrid I would only need to subclass CentroidPoint to do what I want. And I think it would allow all sorts of potentially useful other uses as well (for example create a CentroidPoint that uses a completely different way of combining points. I can think of random selection, for example, or modifying some attributes based on the values of some other attributes.

Describe alternatives you've considered

An alternative that would work for my use case is if I could add my own Accumulator implementation to the Accumulator.types list, but I'm not sure that there is a construct in C++ that would allow that.

Additional context

Add any other context or screenshots about the feature request here.

主要言語
C++
スター
11.2k
フォーク
4.7k
平均マージ
6日 13時間
マージ済み PR(30日)
10

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PointCloudLibrary/pcl のほかの issue

PointCloudLibrary/pcl の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。