public class DescriptorDistance
extends java.lang.Object
| Constructor and Description |
|---|
DescriptorDistance() |
| Modifier and Type | Method and Description |
|---|---|
static double |
correlation(TupleDesc_F64 a,
TupleDesc_F64 b)
Correlation score
|
static double |
euclidean(TupleDesc_F64 a,
TupleDesc_F64 b)
Returns the Euclidean distance (L2-norm) between the two descriptors.
|
static double |
euclideanSq(TupleDesc_F32 a,
TupleDesc_F32 b)
Returns the Euclidean distance squared between the two descriptors.
|
static double |
euclideanSq(TupleDesc_F64 a,
TupleDesc_F64 b)
Returns the Euclidean distance squared between the two descriptors.
|
static int |
hamming(int val)
Computes the hamming distance.
|
static int |
hamming(TupleDesc_B a,
TupleDesc_B b)
Computes the hamming distance between two binary feature descriptors
|
static double |
ncc(NccFeature a,
NccFeature b)
Normalized cross correlation (NCC) computed using a faster technique.
NCC = sum(a[i]*b[i]) / (N*sigma_a * sigma_b) where a[i] = I[i]-mean(a), I[i] is the image pixel intensity around the feature, and N is the number of elements. |
static float |
sad(TupleDesc_F32 a,
TupleDesc_F32 b)
Sum of absolute difference (SAD) score
|
static double |
sad(TupleDesc_F64 a,
TupleDesc_F64 b)
Sum of absolute difference (SAD) score
|
static int |
sad(TupleDesc_S8 a,
TupleDesc_S8 b)
Sum of absolute difference (SAD) score
|
static int |
sad(TupleDesc_U8 a,
TupleDesc_U8 b)
Sum of absolute difference (SAD) score
|
public static double euclidean(TupleDesc_F64 a, TupleDesc_F64 b)
a - First descriptorb - Second descriptorpublic static double euclideanSq(TupleDesc_F64 a, TupleDesc_F64 b)
a - First descriptorb - Second descriptorpublic static double euclideanSq(TupleDesc_F32 a, TupleDesc_F32 b)
a - First descriptorb - Second descriptorpublic static double correlation(TupleDesc_F64 a, TupleDesc_F64 b)
a - First descriptorb - Second descriptorpublic static double ncc(NccFeature a, NccFeature b)
Normalized cross correlation (NCC) computed using a faster technique.
NCC = sum(a[i]*b[i]) / (N*sigma_a * sigma_b)
where a[i] = I[i]-mean(a), I[i] is the image pixel intensity around the feature, and N is the number of
elements.
a - First descriptorb - Second descriptorpublic static int sad(TupleDesc_U8 a, TupleDesc_U8 b)
a - First descriptorb - Second descriptorpublic static int sad(TupleDesc_S8 a, TupleDesc_S8 b)
a - First descriptorb - Second descriptorpublic static float sad(TupleDesc_F32 a, TupleDesc_F32 b)
a - First descriptorb - Second descriptorpublic static double sad(TupleDesc_F64 a, TupleDesc_F64 b)
a - First descriptorb - Second descriptorpublic static int hamming(TupleDesc_B a, TupleDesc_B b)
a - First variableb - Second variablepublic static int hamming(int val)
Computes the hamming distance. A bit = 0 is a match and 1 is not match
Based on code snippet from Sean Eron Anderson Bit Twiddling Hacks.
val - Hamming encoding