Package boofcv.alg.descriptor
Class DescriptorDistance
java.lang.Object
boofcv.alg.descriptor.DescriptorDistance
Series of simple functions for computing difference distance measures between two descriptors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleCorrelation scorestatic doubleReturns the Euclidean distance (L2-norm) between the two descriptors.static doubleReturns the Euclidean distance squared between the two descriptors.static doubleReturns the Euclidean distance squared between the two descriptors.static doubleReturns the Euclidean distance squared between the two descriptors.static doubleReturns the Euclidean distance squared between the two descriptors.static inthamming(int val) Computes the hamming distance.static inthamming(long val) 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
-
Constructor Details
-
DescriptorDistance
public DescriptorDistance()
-
-
Method Details
-
euclidean
Returns the Euclidean distance (L2-norm) between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance
-
euclideanSq
Returns the Euclidean distance squared between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance squared
-
euclideanSq
Returns the Euclidean distance squared between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance squared
-
euclideanSq
Returns the Euclidean distance squared between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance squared
-
euclideanSq
Returns the Euclidean distance squared between the two descriptors.- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Euclidean distance squared
-
correlation
Correlation score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- Correlation score
-
ncc
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
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
sad
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
sad
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
sad
Sum of absolute difference (SAD) score- Parameters:
a- First descriptorb- Second descriptor- Returns:
- SAD score
-
hamming
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
-
hamming
public static int hamming(long val)
-