Documentation>C API
fisher.h File Reference

Fisher encoding (Fisher Vector encoding (FV)) More...

#include "generic.h"

Macros

Fisher vector options
#define VL_FISHER_FLAG_SQUARE_ROOT   (0x1 << 0)
 Use signed squared-root (Normalization and improved Fisher vectors).
 
#define VL_FISHER_FLAG_NORMALIZED   (0x1 << 1)
 Gobally normalize the Fisher vector in L2 norm (Normalization and improved Fisher vectors).
 
#define VL_FISHER_FLAG_IMPROVED   (VL_FISHER_FLAG_NORMALIZED|VL_FISHER_FLAG_SQUARE_ROOT)
 Improved Fisher vector. This is the same as VL_FISHER_FLAG_SQUARE_ROOT|VL_FISHER_FLAG_NORMALIZED.
 
#define VL_FISHER_FLAG_FAST   (0x1 << 2)
 Fast but more approximate calculations (Faster computations). Keep only the larges data to cluster assignment (posterior).
 

Functions

vl_size vl_fisher_encode (void *enc, vl_type dataType, void const *means, vl_size dimension, vl_size numClusters, void const *covariances, void const *priors, void const *data, vl_size numData, int flags)
 Fisher vector encoding of a set of vectors. More...
 

Detailed Description

Author
David Novotny
Andrea Vedaldi
See also
Fisher Vector encoding (FV)

Function Documentation

vl_size vl_fisher_encode ( void *  enc,
vl_type  dataType,
void const *  means,
vl_size  dimension,
vl_size  numClusters,
void const *  covariances,
void const *  priors,
void const *  data,
vl_size  numData,
int  flags 
)
Parameters
dataTypethe type of the input data (VL_TYPE_DOUBLE or VL_TYPE_FLOAT).
encFisher vector (output).
meansGaussian mixture means.
dimensiondimension of the data.
numClustersnumber of Gaussians mixture components.
covariancesGaussian mixture diagonal covariances.
priorsGaussian mixture prior probabilities.
datavectors to encode.
numDatanumber of vectors to encode.
flagsoptions.
Returns
number of averaging operations.

means and covariances have dimension rows and numCluster columns. priors is a vector of size numCluster. data has dimension rows and numData columns. enc is a vecotr of size equal to twice the product of dimension and numClusters. All these vectors and matrices have the same class, as specified by dataType, and must be stored in column-major format.

flag can be used to control several options: VL_FISHER_FLAG_SQUARE_ROOT, VL_FISHER_FLAG_NORMALIZED, VL_FISHER_FLAG_IMPROVED, and VL_FISHER_FLAG_FAST.

The function returns the number of averaging operations actually performed. The upper bound is the number of input features by the number of GMM modes; however, assignments are usually failry sparse, so this number is often much smaller. In particular, with the VL_FISHER_FLAG_FAST, is equal to the number of input features. This information can be used for diagnostic purposes.

See also
Fisher Vector encoding (FV)