boofcv.alg.descriptor
Class DescriptorDistance
- java.lang.Object
-
- boofcv.alg.descriptor.DescriptorDistance
-
public class DescriptorDistance extends java.lang.ObjectSeries of simple functions for computing difference distance measures between two descriptors.
-
-
Constructor Summary
Constructors Constructor and Description DescriptorDistance()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doublecorrelation(TupleDesc_F64 a, TupleDesc_F64 b)Correlation scorestatic doubleeuclidean(TupleDesc_F64 a, TupleDesc_F64 b)Returns the Euclidean distance (L2-norm) between the two descriptors.static doubleeuclideanSq(TupleDesc_F32 a, TupleDesc_F32 b)Returns the Euclidean distance squared between the two descriptors.static doubleeuclideanSq(TupleDesc_F64 a, TupleDesc_F64 b)Returns the Euclidean distance squared between the two descriptors.static inthamming(int val)Computes the hamming distance.static inthamming(TupleDesc_B a, TupleDesc_B b)Computes the hamming distance between two binary feature descriptorsstatic doublencc(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 floatsad(TupleDesc_F32 a, TupleDesc_F32 b)Sum of absolute difference (SAD) scorestatic doublesad(TupleDesc_F64 a, TupleDesc_F64 b)Sum of absolute difference (SAD) scorestatic intsad(TupleDesc_S8 a, TupleDesc_S8 b)Sum of absolute difference (SAD) scorestatic intsad(TupleDesc_U8 a, TupleDesc_U8 b)Sum of absolute difference (SAD) score
-
-
-
Method Detail
-
euclidean
public static double euclidean(TupleDesc_F64 a, TupleDesc_F64 b)
Returns the Euclidean distance (L2-norm) between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance
-
euclideanSq
public static double euclideanSq(TupleDesc_F64 a, TupleDesc_F64 b)
Returns the Euclidean distance squared between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance squared
-
euclideanSq
public static double euclideanSq(TupleDesc_F32 a, TupleDesc_F32 b)
Returns the Euclidean distance squared between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance squared
-
correlation
public static double correlation(TupleDesc_F64 a, TupleDesc_F64 b)
Correlation score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Correlation score
-
ncc
public 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.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- NCC score
-
sad
public static int sad(TupleDesc_U8 a, TupleDesc_U8 b)
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
sad
public static int sad(TupleDesc_S8 a, TupleDesc_S8 b)
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
sad
public static float sad(TupleDesc_F32 a, TupleDesc_F32 b)
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
sad
public static double sad(TupleDesc_F64 a, TupleDesc_F64 b)
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
hamming
public static int hamming(TupleDesc_B a, TupleDesc_B b)
Computes the hamming distance between two binary feature descriptors- Parameters:
a- First variableb- Second variable- Returns:
- The hamming distance
-
hamming
public 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.
- Parameters:
val- Hamming encoding- Returns:
- The hamming distance
-
-
DataMelt 3.0 © DataMelt by jWork.ORG