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

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...
 ~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.

Christian Potthast

Definition at line 61 of file kmeans.h.

Member Typedef Documentation

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

Definition at line 92 of file kmeans.h.

using pcl::Kmeans::ClusterId = unsigned int

Definition at line 78 of file kmeans.h.

Definition at line 88 of file kmeans.h.

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

Definition at line 85 of file kmeans.h.

using pcl::Kmeans::PointId = unsigned int

Definition at line 77 of file kmeans.h.

Definition at line 90 of file kmeans.h.

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

Definition at line 83 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)

Definition at line 136 of file kmeans.h.

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

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

Definition at line 152 of file kmeans.h.

Centroids pcl::Kmeans::get_centroids ( )

Definition at line 166 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)

This method sets the k-means cluster size.

[in]knumber of clusters

Definition at line 107 of file kmeans.h.

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

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

Definition at line 127 of file kmeans.h.

Member Data Documentation

Centroids pcl::Kmeans::centroids_

Definition at line 197 of file kmeans.h.

ClustersToPoints pcl::Kmeans::clusters_to_points_

Definition at line 195 of file kmeans.h.

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

The cluster centroids.

Definition at line 193 of file kmeans.h.

unsigned int pcl::Kmeans::num_clusters_

The number of clusters.

Definition at line 183 of file kmeans.h.

unsigned int pcl::Kmeans::num_dimensions_

Definition at line 179 of file kmeans.h.

unsigned int pcl::Kmeans::num_points_

Definition at line 178 of file kmeans.h.

PointsToClusters pcl::Kmeans::points_to_clusters_

Definition at line 196 of file kmeans.h.

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