inline float Narf::getDescriptorDistance(const Narf& other) const { float ret = L1_Norm(descriptor_, other.descriptor_, descriptor_size_); //float ret = Sublinear_Norm(descriptor_, other.descriptor_, descriptor_size_); ret /= static_cast<float> (descriptor_size_); return (ret); }
template <typename FloatVectorT> inline float selectNorm (FloatVectorT a, FloatVectorT b, int dim, NormType norm_type) { // {L1, L2_SQR, L2, LINF, JM, B, SUBLINEAR, CS, DIV, PF, K, KL, HIK}; switch (norm_type) { case (L1): return L1_Norm (a, b, dim); case (L2_SQR): return L2_Norm_SQR (a, b, dim); case (L2): return L2_Norm (a, b, dim); case (LINF): return Linf_Norm (a, b, dim); case (JM): return JM_Norm (a, b, dim); case (B): return B_Norm (a, b, dim); case (SUBLINEAR): return Sublinear_Norm (a, b, dim); case (CS): return CS_Norm (a, b, dim); case (DIV): return Div_Norm (a, b, dim); case (KL): return KL_Norm (a, b, dim); case (HIK): return HIK_Norm (a, b, dim); case (PF): case (K): default: PCL16_ERROR ("[pcl16::selectNorm] For PF and K norms you have to explicitly call the method, as they need additional parameters\n"); return -1; } }