Back to FabImage Library website
You are here: Start » Function Reference » Data Classification » Clustering » ClusterPoints2D

ClusterPoints2D
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Clusters 2D points using K Means Clustering method.
Syntax
C++
C#
void fil::ClusterPoints2D ( const ftl::Array<fil::Point2D>& inPoints, const int inClusters, const int inMaxIterations, ftl::Optional<int> inSeed, const int inRunCount, ftl::Array<ftl::Conditional<ftl::Array<fil::Point2D>>>& outClusters, ftl::Array<ftl::Conditional<fil::Point2D>>& outCentroids, float& outDistanceSum )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inPoints | const Array<Point2D>& | Array of points to cluster | ||
![]() |
inClusters | const int | 2 - +![]() |
2 | Number of clusters to extract |
![]() |
inMaxIterations | const int | 10 - 1000 | 200 | Maximal number of KMeans iterations |
![]() |
inSeed | Optional<int> | 0 - +![]() |
5489 | Seed used to initialize random number generators |
![]() |
inRunCount | const int | 1 - +![]() |
1 | Defines how many times the algorithm will be executed |
![]() |
outClusters | Array<Conditional<Array<Point2D>>>& | Resulting Point2D clusters | ||
![]() |
outCentroids | Array<Conditional<Point2D>>& | Center of found clusters | ||
![]() |
outDistanceSum | float& | Sum of distance squares from points in array to its respective cluster center |