Point Cloud Library (PCL) 1.12.0
Loading...
Searching...
No Matches
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.
 
 ~Kmeans ()
 This destructor destroys.
 
void setClusterSize (unsigned int k)
 This method sets the k-means cluster size.
 
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.
 
std::vector< Pointdata_
 The cluster centroids.
 
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

Definition at line 71 of file kmeans.h.

◆ ClusterId

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

Definition at line 57 of file kmeans.h.

◆ PointsToClusters

Definition at line 69 of file kmeans.h.

◆ SetPoints

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.

◆ ~Kmeans()

pcl::Kmeans::~Kmeans ( )

This destructor destroys.

Definition at line 56 of file kmeans.hpp.

Member Function Documentation

◆ addDataPoint()

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

Definition at line 116 of file kmeans.h.

References pcl::ConstCloudIterator< PointT >::size().

◆ computeCentroids()

void pcl::Kmeans::computeCentroids ( )

◆ distance()

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

Definition at line 133 of file kmeans.h.

◆ get_centroids()

Centroids pcl::Kmeans::get_centroids ( )
inline

Definition at line 147 of file kmeans.h.

◆ 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 84 of file kmeans.h.

◆ setInputData()

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

Definition at line 107 of file kmeans.h.

Member Data Documentation

◆ centroids_

Centroids pcl::Kmeans::centroids_
protected

Definition at line 179 of file kmeans.h.

◆ clusters_to_points_

ClustersToPoints pcl::Kmeans::clusters_to_points_
protected

Definition at line 177 of file kmeans.h.

◆ data_

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

The cluster centroids.

Definition at line 175 of file kmeans.h.

◆ num_clusters_

unsigned int pcl::Kmeans::num_clusters_
protected

The number of clusters.

Definition at line 165 of file kmeans.h.

◆ num_dimensions_

unsigned int pcl::Kmeans::num_dimensions_
protected

Definition at line 162 of file kmeans.h.

◆ num_points_

unsigned int pcl::Kmeans::num_points_
protected

Definition at line 161 of file kmeans.h.

◆ points_to_clusters_

PointsToClusters pcl::Kmeans::points_to_clusters_
protected

Definition at line 178 of file kmeans.h.


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