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< PointId > | SetPoints
typedef std::vector< float > | Point
typedef std::vector< SetPoints > | ClustersToPoints
typedef std::vector< ClusterId > | PointsToClusters
typedef std::vector< Point > | Centroids

## 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< Point > | data_
| 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 61 of file kmeans.h.

## Member Typedef Documentation

## Centroids

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

Definition at line 92 of file kmeans.h.

## ClusterId

typedef unsigned int pcl::Kmeans::ClusterId

Definition at line 78 of file kmeans.h.

## ClustersToPoints

typedef std::vector<SetPoints> pcl::Kmeans::ClustersToPoints

Definition at line 88 of file kmeans.h.

## Point

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

Definition at line 85 of file kmeans.h.

## PointId

typedef unsigned int pcl::Kmeans::PointId

Definition at line 77 of file kmeans.h.

## PointsToClusters

typedef std::vector<ClusterId> pcl::Kmeans::PointsToClusters

Definition at line 90 of file kmeans.h.

## SetPoints

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

Definition at line 83 of file kmeans.h.

## Constructor & Destructor Documentation

## Kmeans()

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

Empty constructor.

Definition at line 53 of file kmeans.hpp.

## ~Kmeans()

pcl::Kmeans::~Kmeans | ( |  | ) |

This destructor destroys.

Definition at line 60 of file kmeans.hpp.

References pcl::getFieldIndex().

## Member Function Documentation

## addDataPoint()

void pcl::Kmeans::addDataPoint | ( | Point & | data_point | ) |

inline

Definition at line 136 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 152 of file kmeans.h.

## get_centroids()

Centroids pcl::Kmeans::get_centroids | ( |  | ) |

inline

Definition at line 168 of file kmeans.h.

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

## initialClusterPoints()

void pcl::Kmeans::initialClusterPoints | ( |  | ) |

## kMeans()

void pcl::Kmeans::kMeans | ( |  | ) |

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

## setClusterSize()

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

inline

This method sets the k-means cluster size.

Parameters

  [in] | k | number of clusters

Definition at line 107 of file kmeans.h.

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

## setInputData()

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

inline

Definition at line 127 of file kmeans.h.

## Member Data Documentation

## centroids_

Centroids pcl::Kmeans::centroids_

protected

Definition at line 199 of file kmeans.h.

## clusters_to_points_

ClustersToPoints pcl::Kmeans::clusters_to_points_

protected

Definition at line 197 of file kmeans.h.

## data_

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

protected

The cluster centroids.

Definition at line 195 of file kmeans.h.

## num_clusters_

unsigned int pcl::Kmeans::num_clusters_

protected

The number of clusters.

Definition at line 185 of file kmeans.h.

## num_dimensions_

unsigned int pcl::Kmeans::num_dimensions_

protected

Definition at line 181 of file kmeans.h.

## num_points_

unsigned int pcl::Kmeans::num_points_

protected

Definition at line 180 of file kmeans.h.

## points_to_clusters_

PointsToClusters pcl::Kmeans::points_to_clusters_

protected

Definition at line 198 of file kmeans.h.

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

- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/ml/include/pcl/ml/kmeans.h
- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/ml/include/pcl/ml/impl/kmeans.hpp