23#include <pcl/common/pca.h>
24#include <pcl/common/io.h>
25#include <pcl/common/common.h>
71 inline void insert(
int index,
double magnitude,
double phase)
88 const std::string &magnitudeFloatMemberName,
89 const std::string &phaseFloatMemberName)
92 const double numPointsDbl =
static_cast<double>(
numPoints);
104 pcl::copyPointCloud(inputPointCloud,
indices, clusterCloud);
114 if (clusterCloud.points.size() >=3 ){
117 pcl::PCA<MLPointCloudXYZINormal::PointType> PCAFilter;
119 const Eigen::Vector4f meanTmp = PCAFilter.getMean();
120 const Eigen::Vector3f eigenValuesTmp = PCAFilter.getEigenValues();
121 const Eigen::Vector3f eigenVector0Tmp = PCAFilter.getEigenVectors().col(0);
122 const Eigen::Vector3f eigenVector1Tmp = PCAFilter.getEigenVectors().col(1);
123 const Eigen::Vector3f eigenVector2Tmp = PCAFilter.getEigenVectors().col(2);
126 eigenValues.assign( eigenValuesTmp[0], eigenValuesTmp[1], eigenValuesTmp[2] );
127 eigenVectors[0].assign( eigenVector0Tmp[0], eigenVector0Tmp[1], eigenVector0Tmp[2] );
128 eigenVectors[1].assign( eigenVector1Tmp[0], eigenVector1Tmp[1], eigenVector1Tmp[2] );
129 eigenVectors[2].assign( eigenVector2Tmp[0], eigenVector2Tmp[1], eigenVector2Tmp[2] );
133 PCAFilter.project(clusterCloud, tmpCloud);
134 pcl::PointXYZINormal minPoint, maxPoint;
135 pcl::getMinMax3D(tmpCloud, minPoint, maxPoint);
147 Plane plane(planeNormal, planePoint);
Project global and OS specific declarations.
Disables warnings from PCL headers which otherwise cannot be avoided.
Restores disabled warnings from PCL headers which otherwise cannot be avoided.
Class defining a plane in 3D.
bool intersect(const Line &l, Vector3 &intersection) const
A collection of statistical tool functions used in MLPCLSupport.
long double fabs(__int64 i)
std::shared_ptr< const POINT_CLOUD_TYPE > PCLMakeLocalNonDeletingSharedConstPtr(const POINT_CLOUD_TYPE &pntCloud)
Tvec3< MLdouble > Vector3
A vector with three components of type double.
pcl::PointCloud< pcl::PointXYZINormal > MLPointCloudXYZINormal
The basic point cloud type used in the PCL MeVisLab binding.
Vector3 eigenValues
Eigenvalues of the cluster.
double phaseSum
The sum of all point phases in the cluster.
Vector3 planeIntersection
Intersection of main axes of cluster with user plane.
Vector3 orientedExtentsMin
Minimum extents according to the eigen vectors.
double magnitudeSum
The sum of all point magnitudes in the cluster.
Vector3 eigenVectors[3]
Eigenvectors of the cluster.
MLint numPoints
Number of points in the cluster.
double phaseSumAbsolute
The sum of all absolute point phases in the cluster.
StatisticalClusterInfo()
Constructor defaulting everything to an empty cluster.
double phaseMedian
The median of all point phases in the cluster.
double magnitudeMedian
The median of all point magnitudes in the cluster.
double phaseAverage
The average of all point phases in the cluster.
double phaseAverageAbsolute
The average of all point phases in the cluster.
double magnitudeSumAbsolute
The sum of all absolute point magnitudes in the cluster.
Vector3 centreOfGravity
Centre of gravity of the cluster.
std::vector< int > indices
List of point indices of the cluster.
bool planeIntersectionOk
True if intersection of main axes of cluster with user plane is valid, otherwise false.
double magnitudeAverageAbsolute
The average of all point magnitudes in the cluster.
void finalize(const MLPointCloudXYZINormal &inputPointCloud, const Vector3 &planeNormal, const Vector3 &planePoint, const std::string &magnitudeFloatMemberName, const std::string &phaseFloatMemberName)
To be called after last insert to finalise cluster calculations.
void clear()
Setting default values corresponding to an empty cluster.
Vector3 orientedExtentsMax
Minimum extents according to the eigen vectors.
double magnitudeAverage
The average of all point magnitudes in the cluster.
void insert(int index, double magnitude, double phase)
Inserting a new magnitude,phase pair updating statistics.