Renesas / opencv-lib

Dependents:   RZ_A2M_Mbed_samples

Embed: (wiki syntax)

« Back to documentation index

L2< T > Struct Template Reference

L2< T > Struct Template Reference

Squared Euclidean distance functor, optimized version. More...

#include <dist.h>

Public Member Functions

template<typename Iterator1 , typename Iterator2 >
ResultType operator() (Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist=-1) const
 Compute the squared Euclidean distance between two vectors.
template<typename U , typename V >
ResultType accum_dist (const U &a, const V &b, int) const
 Partial euclidean distance, using just one dimension.

Detailed Description

template<class T>
struct cvflann::L2< T >

Squared Euclidean distance functor, optimized version.

Definition at line 136 of file dist.h.


Member Function Documentation

ResultType accum_dist ( const U &  a,
const V &  b,
int   
) const

Partial euclidean distance, using just one dimension.

This is used by the kd-tree when computing partial distances while traversing the tree.

Squared root is omitted for efficiency.

Definition at line 190 of file dist.h.

ResultType operator() ( Iterator1  a,
Iterator2  b,
size_t  size,
ResultType  worst_dist = -1 
) const

Compute the squared Euclidean distance between two vectors.

This is highly optimised, with loop unrolling, as it is one of the most expensive inner loops.

The computation of squared root at the end is omitted for efficiency.

Definition at line 154 of file dist.h.