Point Cloud Library (PCL)
1.11.1-dev
|
64 using Point = std::vector<float>;
74 Kmeans(
unsigned int num_points,
unsigned int num_dimensions);
109 if (num_points_ != data.size())
110 std::cout <<
"Data vector not the same" << std::endl;
118 if (num_dimensions_ != data_point.size())
119 std::cout <<
"Dimensions not the same" << std::endl;
121 data_.push_back(data_point);
126 initialClusterPoints();
138 auto cpy = y.cbegin();
139 for (
auto cpx = x.cbegin(), cpx_end = x.cend(); cpx != cpx_end; ++cpx, ++cpy) {
141 total += (diff * diff);
Defines all the PCL and non-PCL macros used.
std::vector< Point > Centroids
std::vector< ClusterId > PointsToClusters
std::vector< float > Point
float distance(const Point &x, const Point &y)
Centroids get_centroids()
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
void addDataPoint(Point &data_point)
unsigned int num_clusters_
The number of clusters.
void setInputData(std::vector< Point > &data)
std::vector< Point > data_
The cluster centroids.
ClustersToPoints clusters_to_points_
unsigned int num_dimensions_
Defines functions, macros and traits for allocating and using memory.
PointsToClusters points_to_clusters_
void setClusterSize(unsigned int k)
This method sets the k-means cluster size.
std::set< PointId > SetPoints
std::vector< SetPoints > ClustersToPoints