私はポイントクラウドライブラリ(PCL)というライブラリを使用しています。特に私は点の特徴ヒストグラムを計算しようとしています。ポイントフィーチャPCLライブラリ出力ヒストグラム
#include <pcl/point_types.h>
#include <pcl/features/pfh.h>
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>());
... read, pass in or create a point cloud with normals ...
... (note: you can create a single PointCloud<PointNormal> if you want) ...
// Create the PFH estimation class, and pass the input dataset+normals to it
pcl::PFHEstimation<pcl::PointXYZ, pcl::Normal, pcl::PFHSignature125> pfh;
pfh.setInputCloud (cloud);
pfh.setInputNormals (normals);
// alternatively, if cloud is of tpe PointNormal, do pfh.setInputNormals (cloud);
// Create an empty kdtree representation, and pass it to the PFH estimation object.
// Its content will be filled inside the object, based on the given input dataset (as no other search surface is given).
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>());
//pcl::KdTreeFLANN<pcl::PointXYZ>::Ptr tree (new pcl::KdTreeFLANN<pcl::PointXYZ>()); -- older call for PCL 1.5-
pfh.setSearchMethod (tree);
// Output datasets
pcl::PointCloud<pcl::PFHSignature125>::Ptr pfhs (new pcl::PointCloud<pcl::PFHSignature125>());
// Use all neighbors in a sphere of radius 5cm
// IMPORTANT: the radius used here has to be larger than the radius used to estimate the surface normals!!!
pfh.setRadiusSearch (0.05);
// Compute the features
pfh.compute (*pfhs);
// pfhs->points.size() should have the same size as the input cloud->points.size()*
}
出力は、元のポイントクラウドから1ポイントあたり125個の値の配列です。たとえば、ポイントクラウドに1000ポイントがあり、各ポイントにXYZが含まれている場合、1000 * 125値があります。私はなぜそれぞれがビンに対応する125のエントリーを持っているのか理解できました。 (3つの機能と5つの部門5^3 = 125と仮定して)
この投稿は、いくつかを助けた:PCL Point Feature Histograms - binning
残念ながら、私はまだいくつか質問があります。
1)なぜ私はポイントごとに125のヒストグラムを持っています?それは、現在のポイントまでのK最近傍点にあるポイントのパーセンテージが何であるかを測定するためであり、同様の特徴を持ち、各ポイントはそれ自身の近隣を有するか?
2)一部の点では、すべて125のエントリがゼロであることがわかります。どうして?
3論文およびウェブサイトに示されているように)グラフ点特徴ヒストグラム値:
ウェブサイト: http://pointclouds.org/documentation/tutorials/pfh_estimation.php#pfh-estimation
ペーパー: https://pdfs.semanticscholar.org/5aee/411f0b4228ba63c85df0e8ed64cab5844aed.pdf
示すグラフはビンの数としてのX軸を有します(私のケースでは125個のビン)、当然のことながら、1ポイントあたり125個の値を1つのグラフに統合するにはどうすればよいですか? 私は適切な列の単純な合計を試み、定数でそれらを拡大縮小しましたが、私はそれが正しいとは思わない。総和では、すべてのビン[0]をすべての点に加え、すべてのビン[1]をすべての点に対して合計し、ビン[124]まですべてを加算します。
私は本当にこれを明確にするために何か助けに感謝します。 ありがとうございます。