- Welcome
- Getting Started With the NVIDIA DriveWorks SDK
- Modules
- Samples
- Tools
- Tutorials
- SDK Porting Guide
- DriveWorks API
- More
This code snippet demonstrates how the Clusterer module is typically used. Note that error handling is left out for clarity.
Initialize Clusterer parameters with default values.
The initialization of Clustering module requires the following clustering parameters to be defined.
This parameter defines the maximum number of samples the Clustering module should expect as input at once. This allows the module to pre-allocate resources at initialization time.
In Clustering module, there are bounding boxes which are defined to be “core” which represent the cluster. Epsilon is the maximum distance for a box to be considered an element of a cluster to the core of that cluster.
Defines the minimum number of boxes required to form a dense region. minSamples and minSumOfWeights are checked conjunctively.
Defines the minimum sum of weights required to form a dense region. minSamples and minSumOfWeights are checked conjunctively.
Initialize Clusterer module.
Allocate a list of bounding boxes to store the inputs of clustering.
Allocate a list of bounding boxes to store the outputs of clustering.
Bind input & output to the clusterer module.
This function enables binding input to the Clusterer module by providing the pointers to an array of bounding boxes, to an array of weights and to number of bounding boxes to be clustered. Once the input is bound via this function, the changes to the input will be reflected in the Clustering module.
This function enables binding output to the Clusterer module by providing the pointers to an array of cluster labels, to number of cluster labels and to number of clusters. Once the output is bound via this function, the content of the output will be updated by the Clusterer module every time dwClusterer_process()
is called.
clusterLabels
parameter contains the label index for each input sample in inputBoxes
parameter in dwClusterer_bindInput()
in the same order. If a bounding box does not belong to a cluster, its clusterLabel
is set to -1
. Otherwise, clusters are labeled as [0, clusterCount).
clusterLabelCount
is the number of labels in the array, and it is expected to be the same as boxesCount
in bindInput
.
numClusters
is the number of clusters, i.e. number of unique labels except -1
.