Table of Contents

Method ComputeQuadraticFormDistances

Namespace
OpenCvSharp.XFeatures2D
Assembly
OpenCvSharp.dll

ComputeQuadraticFormDistances(Mat, IEnumerable<Mat>)

Computes the Signature Quadratic Form Distance between the reference signature and each of the other image signatures.

public float[] ComputeQuadraticFormDistances(Mat sourceSignature, IEnumerable<Mat> imageSignatures)

Parameters

sourceSignature Mat

The signature to measure the distance of other signatures from.

imageSignatures IEnumerable<Mat>

Vector of signatures to measure the distance from the source signature.

Returns

float[]

Measured distances.

Remarks

OpenCV's native implementation has a known bug for imageSignatures with more than one element: it validates each signature via mImageSignatures[i].empty() where mImageSignatures is a pointer to the whole vector rather than an element accessor, so any index beyond 0 reads out-of-bounds memory. Prefer calling ComputeQuadraticFormDistance(InputArray, InputArray) in a loop for more than one signature.