Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Types | Public Member Functions | Protected Attributes
pcl::Kmeans Class Reference

K-means clustering. More...

#include <pcl/ml/kmeans.h>

Public Types

using PointId = unsigned int
 
using ClusterId = unsigned int
 
using SetPoints = std::set< PointId >
 
using Point = std::vector< float >
 
using ClustersToPoints = std::vector< SetPoints >
 
using PointsToClusters = std::vector< ClusterId >
 
using Centroids = std::vector< Point >
 

Public Member Functions

 Kmeans (unsigned int num_points, unsigned int num_dimensions)
 Empty constructor. More...
 
void setClusterSize (unsigned int k)
 This method sets the k-means cluster size. More...
 
void kMeans ()
 
void setInputData (std::vector< Point > &data)
 
void addDataPoint (Point &data_point)
 
void initialClusterPoints ()
 
void computeCentroids ()
 
float distance (const Point &x, const Point &y)
 
Centroids get_centroids ()
 

Protected Attributes

unsigned int num_points_
 
unsigned int num_dimensions_
 
unsigned int num_clusters_
 The number of clusters. More...
 
std::vector< Pointdata_
 The cluster centroids. More...
 
ClustersToPoints clusters_to_points_
 
PointsToClusters points_to_clusters_
 
Centroids centroids_
 

Detailed Description

K-means clustering.

Author
Christian Potthast

Definition at line 55 of file kmeans.h.

Member Typedef Documentation

◆ Centroids

using pcl::Kmeans::Centroids = std::vector<Point>

Definition at line 71 of file kmeans.h.

◆ ClusterId

using pcl::Kmeans::ClusterId = unsigned int

Definition at line 58 of file kmeans.h.

◆ ClustersToPoints

Definition at line 67 of file kmeans.h.

◆ Point

using pcl::Kmeans::Point = std::vector<float>

Definition at line 64 of file kmeans.h.

◆ PointId

using pcl::Kmeans::PointId = unsigned int

Definition at line 57 of file kmeans.h.

◆ PointsToClusters

Definition at line 69 of file kmeans.h.

◆ SetPoints

using pcl::Kmeans::SetPoints = std::set<PointId>

Definition at line 62 of file kmeans.h.

Constructor & Destructor Documentation

◆ Kmeans()

pcl::Kmeans::Kmeans ( unsigned int  num_points,
unsigned int  num_dimensions 
)

Empty constructor.

Definition at line 52 of file kmeans.hpp.

Member Function Documentation

◆ addDataPoint()

void pcl::Kmeans::addDataPoint ( Point data_point)
inline

Definition at line 113 of file kmeans.h.

Referenced by pcl::UnaryClassifier< PointT >::kmeansClustering().

◆ computeCentroids()

void pcl::Kmeans::computeCentroids ( )

◆ distance()

float pcl::Kmeans::distance ( const Point x,
const Point y 
)
inline

Definition at line 130 of file kmeans.h.

◆ get_centroids()

Centroids pcl::Kmeans::get_centroids ( )
inline

Definition at line 144 of file kmeans.h.

Referenced by pcl::UnaryClassifier< PointT >::kmeansClustering().

◆ initialClusterPoints()

void pcl::Kmeans::initialClusterPoints ( )

◆ kMeans()

void pcl::Kmeans::kMeans ( )

◆ setClusterSize()

void pcl::Kmeans::setClusterSize ( unsigned int  k)
inline

This method sets the k-means cluster size.

Parameters
[in]knumber of clusters

Definition at line 81 of file kmeans.h.

Referenced by pcl::UnaryClassifier< PointT >::kmeansClustering().

◆ setInputData()

void pcl::Kmeans::setInputData ( std::vector< Point > &  data)
inline

Definition at line 104 of file kmeans.h.

Member Data Documentation

◆ centroids_

Centroids pcl::Kmeans::centroids_
protected

Definition at line 176 of file kmeans.h.

◆ clusters_to_points_

ClustersToPoints pcl::Kmeans::clusters_to_points_
protected

Definition at line 174 of file kmeans.h.

◆ data_

std::vector<Point> pcl::Kmeans::data_
protected

The cluster centroids.

Definition at line 172 of file kmeans.h.

◆ num_clusters_

unsigned int pcl::Kmeans::num_clusters_
protected

The number of clusters.

Definition at line 162 of file kmeans.h.

◆ num_dimensions_

unsigned int pcl::Kmeans::num_dimensions_
protected

Definition at line 159 of file kmeans.h.

◆ num_points_

unsigned int pcl::Kmeans::num_points_
protected

Definition at line 158 of file kmeans.h.

◆ points_to_clusters_

PointsToClusters pcl::Kmeans::points_to_clusters_
protected

Definition at line 175 of file kmeans.h.


The documentation for this class was generated from the following files: