Point Cloud Library (PCL)  1.9.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

typedef unsigned int PointId
 
typedef unsigned int ClusterId
 
typedef std::set< PointIdSetPoints
 
typedef std::vector< float > Point
 
typedef std::vector< SetPointsClustersToPoints
 
typedef std::vector< ClusterIdPointsToClusters
 
typedef std::vector< PointCentroids
 

Public Member Functions

 Kmeans (unsigned int num_points, unsigned int num_dimensions)
 Empty constructor. More...
 
 ~Kmeans ()
 This destructor destroys. 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 60 of file kmeans.h.

Member Typedef Documentation

typedef std::vector<Point> pcl::Kmeans::Centroids

Definition at line 91 of file kmeans.h.

typedef unsigned int pcl::Kmeans::ClusterId

Definition at line 77 of file kmeans.h.

Definition at line 87 of file kmeans.h.

typedef std::vector<float> pcl::Kmeans::Point

Definition at line 84 of file kmeans.h.

typedef unsigned int pcl::Kmeans::PointId

Definition at line 76 of file kmeans.h.

Definition at line 89 of file kmeans.h.

typedef std::set<PointId> pcl::Kmeans::SetPoints

Definition at line 82 of file kmeans.h.

Constructor & Destructor Documentation

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

Empty constructor.

Definition at line 53 of file kmeans.hpp.

pcl::Kmeans::~Kmeans ( )

This destructor destroys.

Definition at line 60 of file kmeans.hpp.

References pcl::getFieldIndex().

Member Function Documentation

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

Definition at line 135 of file kmeans.h.

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

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

Definition at line 151 of file kmeans.h.

Centroids pcl::Kmeans::get_centroids ( )
inline

Definition at line 167 of file kmeans.h.

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

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

This method sets the k-means cluster size.

Parameters
[in]knumber of clusters

Definition at line 106 of file kmeans.h.

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

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

Definition at line 126 of file kmeans.h.

Member Data Documentation

Centroids pcl::Kmeans::centroids_
protected

Definition at line 198 of file kmeans.h.

ClustersToPoints pcl::Kmeans::clusters_to_points_
protected

Definition at line 196 of file kmeans.h.

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

The cluster centroids.

Definition at line 194 of file kmeans.h.

unsigned int pcl::Kmeans::num_clusters_
protected

The number of clusters.

Definition at line 184 of file kmeans.h.

unsigned int pcl::Kmeans::num_dimensions_
protected

Definition at line 180 of file kmeans.h.

unsigned int pcl::Kmeans::num_points_
protected

Definition at line 179 of file kmeans.h.

PointsToClusters pcl::Kmeans::points_to_clusters_
protected

Definition at line 197 of file kmeans.h.


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