Point Cloud Library (PCL)
1.10.1
|
41 #include <Eigen/src/Core/Matrix.h>
42 #include <pcl/pcl_base.h>
45 #include <pcl/point_representation.h>
46 #include <pcl/features/feature.h>
47 #include <pcl/features/spin_image.h>
48 #include <pcl/filters/voxel_grid.h>
49 #include <pcl/filters/extract_indices.h>
50 #include <pcl/search/search.h>
51 #include <pcl/kdtree/kdtree.h>
74 template <
typename Po
intT>
111 findStrongestPeaks (std::vector<
ISMPeak, Eigen::aligned_allocator<ISMPeak> > &out_peaks,
int in_class_id,
double in_non_maxima_radius,
double in_sigma);
118 getDensityAtPoint (
const PointT &point,
double sigma_dist);
131 shiftMean (
const Eigen::Vector3f& snapPt,
const double in_dSigmaDist);
179 saveModelToFile (std::string& file_name);
185 loadModelFromfile (std::string& file_name);
244 template <
int FeatureSize,
typename Po
intT,
typename NormalT = pcl::Normal>
265 model_num_ (model_num),
266 dir_to_center_ (dir_to_center),
271 unsigned int model_num_;
300 max_count_ (max_count),
301 epsilon_ (epsilon) {};
324 learned_weight_ (0.0f),
325 dir_to_center_ (0.0f, 0.0f, 0.0f) {};
347 std::vector<typename pcl::PointCloud<PointT>::Ptr>
348 getTrainingClouds ();
357 std::vector<unsigned int>
358 getTrainingClasses ();
364 setTrainingClasses (
const std::vector<unsigned int>& training_classes);
367 std::vector<typename pcl::PointCloud<NormalT>::Ptr>
368 getTrainingNormals ();
384 setSamplingSize (
float sampling_size);
388 getFeatureEstimator ();
399 getNumberOfClusters ();
405 setNumberOfClusters (
unsigned int num_of_clusters);
418 setSigmaDists (
const std::vector<float>& training_sigmas);
431 setNVotState (
bool state);
459 std::vector<
LocationInfo, Eigen::aligned_allocator<LocationInfo> >& locations);
467 clusterDescriptors (std::vector<
pcl::Histogram<FeatureSize> >& histograms, Eigen::MatrixXi& labels, Eigen::MatrixXf& clusters_centers);
473 calculateSigmas (std::vector<float>& sigmas);
486 calculateWeights (
const std::vector<
LocationInfo, Eigen::aligned_allocator<LocationInfo> >& locations,
487 const Eigen::MatrixXi &labels,
488 std::vector<float>& sigmas,
489 std::vector<std::vector<unsigned int> >& clusters,
490 std::vector<std::vector<float> >& statistical_weights,
491 std::vector<float>& learned_weights);
518 alignYCoordWithNormal (
const NormalT& in_normal);
525 applyTransform (Eigen::Vector3f& io_vec,
const Eigen::Matrix3f& in_transform);
548 computeKMeansClustering (
const Eigen::MatrixXf& points_to_cluster,
549 int number_of_clusters,
550 Eigen::MatrixXi& io_labels,
554 Eigen::MatrixXf& cluster_centers);
564 generateCentersPP (
const Eigen::MatrixXf& data,
565 Eigen::MatrixXf& out_centers,
566 int number_of_clusters,
574 generateRandomCenter (
const std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> >& boxes, Eigen::VectorXf& center);
581 computeDistance (Eigen::VectorXf& vec_1, Eigen::VectorXf& vec_2);
618 static const int PP_CENTERS = 2;
622 static const int USE_INITIAL_LABELS = 1;
631 (
float, density, ism_density)
632 (
float, class_id, ism_class_id)
Defines all the PCL and non-PCL macros used.
This file defines compatibility wrappers for low level I/O functions.
shared_ptr< Feature< PointInT, PointOutT > > Ptr
std::vector< float > learned_weights_
Stores learned weights.
A point structure representing normal coordinates and the surface curvature estimate.
PointT point_
Stores the initial point.
unsigned int number_of_classes_
Stores the number of classes.
This class is used for storing, analyzing and manipulating votes obtained from ISM algorithm.
std::vector< typename pcl::PointCloud< PointT >::Ptr > training_clouds_
Stores the clouds used for training.
POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::_PointXYZLAB,(float, x, x)(float, y, y)(float, z, z)(float, L, L)(float, a, a)(float, b, b)) namespace pcl
pcl::PointCloud< PointT >::Ptr votes_origins_
Stores the origins of the votes.
std::vector< int > k_ind_
Stores neighbours indices.
pcl::PointCloud< pcl::InterestPoint >::Ptr votes_
Stores all votes.
unsigned int number_of_clusters_
Number of clusters, is used for clustering descriptors during the training.
VisualWordStat()
Empty constructor with member variables initialization.
Feature::Ptr feature_estimator_
Stores the feature estimator.
shared_ptr< ISMModel > Ptr
unsigned int descriptors_dimension_
Stores descriptors dimension.
float epsilon_
Defines the accuracy for k-means clustering.
std::vector< int > votes_class_
Stores classes for which every single vote was cast.
This class implements Implicit Shape Model algorithm described in "Hough Transforms and 3D SURF for r...
PointCloud represents the base class in PCL for storing collections of 3D points.
typename Feature::Ptr FeaturePtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
int max_count_
Defines maximum number of iterations for k-means clustering.
int class_id
Determines which class this peak belongs.
Structure for storing the visual word.
float learned_weight_
Weight of the vote.
This struct is used for storing peak.
unsigned int number_of_clusters_
Stores the number of clusters.
std::vector< float > sigmas_
Stores the sigma value for each class.
shared_ptr< ISMVoteList< PointT > > Ptr
A point structure representing Euclidean xyz coordinates.
NormalT normal_
Stores the normal of the initial point.
std::vector< typename pcl::PointCloud< NormalT >::Ptr > training_normals_
Stores the normals for each training cloud.
LocationInfo(unsigned int model_num, const PointT &dir_to_center, const PointT &origin, const NormalT &normal)
Location info constructor.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
std::vector< unsigned int > training_classes_
Stores the class number for each cloud from training_clouds_.
A point structure representing an interest point with Euclidean xyz coordinates, and an interest valu...
PCL_ADD_POINT4D
Point were this peak is located.
double density
Density of this peak.
bool n_vot_ON_
If set to false then Nvot coeff from [Knopp et al., 2010, (4)] is equal 1.0.
PointT dir_to_center_
Expected direction to center for this keypoint.
std::vector< std::vector< float > > statistical_weights_
Stores statistical weights.
std::vector< float > k_sqr_dist_
Stores square distances to the corresponding neighbours.
shared_ptr< const ISMModel > ConstPtr
shared_ptr< PointCloud< PointT > > Ptr
float sampling_size_
This value is used for the simplification.
unsigned int number_of_visual_words_
Stores the number of visual words.
This structure is used for determining the end of the k-means clustering process.
pcl::KdTreeFLANN< pcl::InterestPoint >::Ptr tree_
Stores the search tree.
pcl::PointXYZ dir_to_center_
Expected direction to center.
A point structure representing an N-D histogram.
std::vector< unsigned int > classes_
Stores the class label for every direction.
shared_ptr< const PointCloud< PointT > > ConstPtr
TermCriteria(int type, int max_count, float epsilon)
Termination criteria constructor.
Eigen::MatrixXf directions_to_center_
Stores the directions to objects center for each visual word.
Eigen::MatrixXf clusters_centers_
Stores the centers of the clusters that were obtained during the visual words clusterization.
std::vector< std::vector< unsigned int > > clusters_
This is an array of clusters.
shared_ptr< const ISMVoteList< PointT > > ConstPtr
bool tree_is_valid_
Signalizes if the tree is valid.
std::vector< float > training_sigmas_
This array stores the sigma values for each training class.
pcl::features::ISMModel::Ptr ISMModelPtr
shared_ptr< KdTreeFLANN< PointT, Dist > > Ptr
This structure stores the information about the keypoint.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
The assignment of this structure is to store the statistical/learned weights and other information of...
Feature represents the base feature class.