Qualcomm FastCV Library  1.7.1
Clustering and search

Functions

FASTCV_API int fcvClusterEuclideanf32 (const float *__restrict points, int numPoints, int dim, int pointStride, const size_t *__restrict indices, int numIndices, int numClusters, float *__restrict clusterCenters, int clusterCenterStride, float *__restrict newClusterCenters, size_t *__restrict clusterMemberCounts, size_t *__restrict clusterBindings, float *sumOfClusterDistances)
 General function for computing cluster centers and cluster bindings for a set of points of dimension dim.
FASTCV_API int fcvClusterEuclideanNormedf32 (const float *__restrict points, int numPoints, int dim, int pointStride, const size_t *__restrict indices, int numIndices, int numClusters, float *__restrict clusterCenters, int clusterCenterStride, float *__restrict newClusterCenters, size_t *__restrict clusterMemberCounts, size_t *__restrict clusterBindings, float *sumOfClusterDistances)
 Function for computing cluster centers and cluster bindings for a set of normalized points of dimension dim. Cluster centers are also normalized (see remark below)
FASTCV_API int fcvClusterEuclideanNormed36f32 (const float *__restrict points, int numPoints, int pointStride, const size_t *__restrict indices, int numIndices, int numClusters, float *__restrict clusterCenters, int clusterCenterStride, float *__restrict newClusterCenters, size_t *__restrict clusterMemberCounts, size_t *__restrict clusterBindings, float *sumOfClusterDistances)
 Function for computing cluster centers and cluster bindings for a set of normalized points of dimension 36. Cluster centers are also normalized (see remark below)
FASTCV_API int fcvClusterEuclideanu8 (const uint8_t *__restrict points, int32_t numPoints, int32_t dim, int32_t pointStride, int32_t numPointsUsed, int32_t numClusters, float32_t *__restrict clusterCenters, int32_t clusterCenterStride, float32_t *__restrict newClusterCenters, uint32_t *__restrict clusterMemberCounts, uint32_t *__restrict clusterBindings, float32_t *sumOfClusterDistances)
 General function for computing cluster centers and cluster bindings for a set of points of dimension dim.

Detailed Description

K clusters best fitting of a set of input points


Function Documentation

FASTCV_API int fcvClusterEuclideanf32 ( const float *__restrict  points,
int  numPoints,
int  dim,
int  pointStride,
const size_t *__restrict  indices,
int  numIndices,
int  numClusters,
float *__restrict  clusterCenters,
int  clusterCenterStride,
float *__restrict  newClusterCenters,
size_t *__restrict  clusterMemberCounts,
size_t *__restrict  clusterBindings,
float *  sumOfClusterDistances 
)

General function for computing cluster centers and cluster bindings for a set of points of dimension dim.

Parameters:
pointsArray of all points. Array size must be greater than numPoints * dim.
numPointsNumber of points in points array.
dimdimension, e.g. 36
pointStrideByte distance between adjacent points in array
indicesArray of point indices in points array. Processing will only occur on points whose indices are in this array. Each index in array must be smaller numPoints.
numIndicesLength of indices array. numIndieces must be <= numPoints.
numClustersNumber of cluster centers
clusterCenterscurrent cluster centers; elements are distant by clusterCenterStride
clusterCenterStridebyte distance between adjacent cluster centers in array
newClusterCentersarray for new cluster centers; should be numClusterCenters long
clusterMemberCountsElement counts for each cluster; should be numClusterCenters long
clusterBindingsOutput indices of the clusters to which each vector belongs to, array must be numIndices long.
sumOfClusterDistancesArray for sum of distances of cluster elements to cluster centers; Must be numClusters long
Returns:
0 if successfully clustered, otherwise error code
Remarks:
This is general clusterer. There are no assumptions on points other than they belong to a vector space
FASTCV_API int fcvClusterEuclideanNormed36f32 ( const float *__restrict  points,
int  numPoints,
int  pointStride,
const size_t *__restrict  indices,
int  numIndices,
int  numClusters,
float *__restrict  clusterCenters,
int  clusterCenterStride,
float *__restrict  newClusterCenters,
size_t *__restrict  clusterMemberCounts,
size_t *__restrict  clusterBindings,
float *  sumOfClusterDistances 
)

Function for computing cluster centers and cluster bindings for a set of normalized points of dimension 36. Cluster centers are also normalized (see remark below)

Parameters:
pointsArray of all points. Array size must be greater than numPoints * 36.
numPointsNumber of points in points array.
pointStrideByte distance between adjacent points in array
indicesArray of point indices in points array. Processing will only occur on points whose indices are in this array. Each index in array must be smaller numPoints.
numIndicesLength of indices array. numIndieces must be <= numPoints.
numClustersNumber of cluster centers
clusterCenterscurrent cluster centers; elements are distant by clusterCenterStride
clusterCenterStridebyte distance between adjacent cluster centers in array
newClusterCentersarray for new cluster centers; should be numClusterCenters long
clusterMemberCountsElement counts for each cluster; should be numClusterCenters long
clusterBindingsOutput indices of the clusters to which each vector belongs to, a rray must be numIndices long.
sumOfClusterDistancesArray for sum of distances of cluster elements to cluster centers; Must be numClusters long
Returns:
0 if successfully clustered, otherwise error code
Remarks:
this function assumes that points are normalized (e.g. NFT4 descriptors). Cluster centers are also normalized. Normalized points are on a surphace of unit sphere which is not a vector space but curved manifold of dimension (dim-1) embeded in Euclidean vector space of dimension dim
FASTCV_API int fcvClusterEuclideanNormedf32 ( const float *__restrict  points,
int  numPoints,
int  dim,
int  pointStride,
const size_t *__restrict  indices,
int  numIndices,
int  numClusters,
float *__restrict  clusterCenters,
int  clusterCenterStride,
float *__restrict  newClusterCenters,
size_t *__restrict  clusterMemberCounts,
size_t *__restrict  clusterBindings,
float *  sumOfClusterDistances 
)

Function for computing cluster centers and cluster bindings for a set of normalized points of dimension dim. Cluster centers are also normalized (see remark below)

Parameters:
pointsArray of all points. Array size must be greater than numPoints * dim.
numPointsNumber of points in points array.
dimdimension, e.g. 36
pointStrideByte distance between adjacent points in array
indicesArray of point indices in points array. Processing will only occur on points whose indices are in this array. Each index in array must be smaller numPoints.
numIndicesLength of indices array. numIndieces must be <= numPoints.
numClustersNumber of cluster centers
clusterCenterscurrent cluster centers; elements are distant by clusterCenterStride
clusterCenterStridebyte distance between adjacent cluster centers in array
newClusterCentersarray for new cluster centers; should be numClusterCenters long
clusterMemberCountsElement counts for each cluster; should be numClusterCenters long
clusterBindingsOutput indices of the clusters to which each vector belongs to, a rray must be numIndices long.
sumOfClusterDistancesArray for sum of distances of cluster elements to cluster centers; Must be numClusters long
Returns:
0 if successfully clustered, otherwise error code
Remarks:
this function assumes that points are normalized (e.g. NFT4 descriptors). Cluster centers are also normalized. Normalized points are on a surface of unit sphere which is not a vector space but curved manifold of dimension (dim-1) embeded in Euclidean vector space of dimension dim
FASTCV_API int fcvClusterEuclideanu8 ( const uint8_t *__restrict  points,
int32_t  numPoints,
int32_t  dim,
int32_t  pointStride,
int32_t  numPointsUsed,
int32_t  numClusters,
float32_t *__restrict  clusterCenters,
int32_t  clusterCenterStride,
float32_t *__restrict  newClusterCenters,
uint32_t *__restrict  clusterMemberCounts,
uint32_t *__restrict  clusterBindings,
float32_t *  sumOfClusterDistances 
)

General function for computing cluster centers and cluster bindings for a set of points of dimension dim.

Parameters:
pointsArray of all points. Array size must be greater than numPoints * pointStride.
numPointsNumber of points in points array.
dimdimension, e.g. 36
pointStrideByte distance between adjacent points in array
numPointsUsedTotal number of points used for clustering, {0,1,...(numPointsUsed-1)}
numClustersNumber of clusters
clusterCenterscurrent cluster centers; elements are distant by clusterCenterStride
clusterCenterStridebyte distance between adjacent cluster centers in array
newClusterCentersarray for new cluster centers; should be numClusterCenters long
newClusterMemberCountsElement counts for each cluster; should be numClusterCenters long
clusterBindingsOutput indices of the clusters to which each vector belongs to, array must be numPointsUsed long.
sumOfClusterDistancesthe sum of distances between each cluster center to its belonging points. The size should be numClusterCenters*sizeof(float_32)
Returns:
0 if successfully clustered, otherwise error code
Remarks:
This is general clusterer. There are no assumptions on points other than they belong to a vector space
 All Data Structures Files Functions Variables Enumerations Enumerator Defines