Ocean
Ocean::CV::Segmentation::Clustering< tChannels > Class Template Reference

This class implements simple clustering functions for image information. More...

Data Structures

class  Cluster
 This class implements a single cluster for 3 channel 24 bit data objects. More...
 
class  Data
 This class implements a single data to be clustered. More...
 
class  Segmentation
 This class implements the management of clusters. More...
 

Public Types

typedef std::vector< DataDatas
 Definition of a vector holding data object. More...
 
typedef std::vector< ClusterClusters
 Definition of a vector holding cluster objects. More...
 

Static Public Member Functions

static Segmentation findRandomClusteringOneIteration (const Datas &datas, const unsigned int clusterRadius, RandomGenerator &randomGenerator, const size_t expectedClusters=20)
 Determines a random cluster for data elements by application of one seeking iteration. More...
 
static Segmentation findRandomClusteringTwoIterations (const Datas &datas, const unsigned int clusterRadius, RandomGenerator &randomGenerator, const size_t expectedClusters=20)
 Determines a random cluster for data elements by application of two seeking iterations. More...
 
static Segmentation findOptimalRandomClustering (const Datas &datas, const unsigned int clusterRadius, RandomGenerator &randomGenerator, const unsigned int iterations=10u, Worker *worker=nullptr, const bool oneIteration=true)
 Determines an optimal cluster from a set of random clusters for 3 channel 24 bit data elements. More...
 

Static Private Member Functions

static void findOptimalRandomClusteringSubset (const Datas *datas, const unsigned int clusterRadius, RandomGenerator *randomGenerator, Segmentation *segmentation, const bool oneIteration, const unsigned int firstIteration, const unsigned int numberIterations, const unsigned int iterationIndex)
 Determines an optimal cluster from a set of random clusters for 3 channel 24 bit data elements. More...
 

Detailed Description

template<unsigned int tChannels>
class Ocean::CV::Segmentation::Clustering< tChannels >

This class implements simple clustering functions for image information.

Template Parameters
tChannelsThe number of data channels of the image information to be clustered, with range [1, infinity)

Member Typedef Documentation

◆ Clusters

template<unsigned int tChannels>
typedef std::vector<Cluster> Ocean::CV::Segmentation::Clustering< tChannels >::Clusters

Definition of a vector holding cluster objects.

◆ Datas

template<unsigned int tChannels>
typedef std::vector<Data> Ocean::CV::Segmentation::Clustering< tChannels >::Datas

Definition of a vector holding data object.

Member Function Documentation

◆ findOptimalRandomClustering()

template<unsigned int tChannels>
Clustering< tChannels >::Segmentation Ocean::CV::Segmentation::Clustering< tChannels >::findOptimalRandomClustering ( const Datas datas,
const unsigned int  clusterRadius,
RandomGenerator randomGenerator,
const unsigned int  iterations = 10u,
Worker worker = nullptr,
const bool  oneIteration = true 
)
static

Determines an optimal cluster from a set of random clusters for 3 channel 24 bit data elements.

Parameters
datasThe data objects to distribute into clusters
clusterRadiusRadius of a single cluster
randomGeneratorRandom number generator
iterationsThe number of clustering steps, with range [1, infinity)
workerOptional worker object to distribute the computation
oneIterationState determining whether one ore two seeking iterations are applied for each individual clustering step
Returns
Resulting optimal segmentation with clusters

◆ findOptimalRandomClusteringSubset()

template<unsigned int tChannels>
void Ocean::CV::Segmentation::Clustering< tChannels >::findOptimalRandomClusteringSubset ( const Datas datas,
const unsigned int  clusterRadius,
RandomGenerator randomGenerator,
Segmentation segmentation,
const bool  oneIteration,
const unsigned int  firstIteration,
const unsigned int  numberIterations,
const unsigned int  iterationIndex 
)
staticprivate

Determines an optimal cluster from a set of random clusters for 3 channel 24 bit data elements.

Parameters
datasThe data objects to distribute into clusters
clusterRadiusRadius of a single cluster
randomGeneratorRandom number generator
segmentationResulting optimal segmentation
oneIterationState determining whether one or two seeking iterations are executed for each clustering
firstIterationFirst iteration to be handled
numberIterationsNumber iterations to be handled
iterationIndexIteration index

◆ findRandomClusteringOneIteration()

template<unsigned int tChannels>
Clustering< tChannels >::Segmentation Ocean::CV::Segmentation::Clustering< tChannels >::findRandomClusteringOneIteration ( const Datas datas,
const unsigned int  clusterRadius,
RandomGenerator randomGenerator,
const size_t  expectedClusters = 20 
)
static

Determines a random cluster for data elements by application of one seeking iteration.

Parameters
datasThe data objects to distribute into clusters
clusterRadiusRadius of each cluster
randomGeneratorRandom number generator
expectedClustersOptional number of expected clusters allowing to reserve enough space in the beginning
Returns
Resulting segmentation with clusters

◆ findRandomClusteringTwoIterations()

template<unsigned int tChannels>
Clustering< tChannels >::Segmentation Ocean::CV::Segmentation::Clustering< tChannels >::findRandomClusteringTwoIterations ( const Datas datas,
const unsigned int  clusterRadius,
RandomGenerator randomGenerator,
const size_t  expectedClusters = 20 
)
static

Determines a random cluster for data elements by application of two seeking iterations.

The first iteration determines all elements belonging to a randomly selected cluster element.
The second iteration seeks all element belonging to the average data as determined by the first iteration.

Parameters
datasThe data objects to distribute into clusters
clusterRadiusRadius of each cluster
randomGeneratorRandom number generator
expectedClustersOptional number of expected clusters allowing to reserve enough space in the beginning
Returns
Resulting segmentation with clusters

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