Package boofcv.factory.feature.associate
Class FactoryAssociation
java.lang.Object
boofcv.factory.feature.associate.FactoryAssociation
Creates algorithms for associating
TupleDesc_F64
features.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassociateNearestNeighbor
(@Nullable ConfigAssociateNearestNeighbor config, NearestNeighbor nn) static <D> ScoreAssociation<D>
defaultScore
(Class<D> tupleType) Given a feature descriptor type it returns a "reasonable" defaultScoreAssociation
.static <D> AssociateDescription<D>
ensureUnique
(AssociateDescription<D> associate) Checks and if necessary wraps the association to ensure that it returns only unique associationsstatic <D> AssociateDescription2D<D>
ensureUnique
(AssociateDescription2D<D> associate) Checks and if necessary wraps the association to ensure that it returns only unique associationsstatic <D extends TupleDesc<D>>
AssociateDescription<D>generic
(ConfigAssociate config, DescriptorInfo<D> info) static <D> AssociateDescription2D<D>
generic2
(ConfigAssociate config, DescriptorInfo info) Creates a generic association algorithm that uses descriptors as well as the 2D location of image features.static <D> AssociateDescription<D>
greedy
(@Nullable ConfigAssociateGreedy config, ScoreAssociation<D> score) Returns an algorithm for associating features together which uses a brute force greedy algorithm.static <D> AssociateDescription2D<D>
greedy2D
(@Nullable ConfigAssociateGreedy config, ConfigLength maxDistance, ScoreAssociation<D> score) Returns an algorithm for associating features together which uses a brute force greedy algorithm.static AssociateDescription<TupleDesc_F64>
kdRandomForest
(@Nullable ConfigAssociateNearestNeighbor configNN, int dimension, int numTrees, int numConsiderSplit, long randomSeed) Approximate association using multiple random K-D trees (random forest) for descriptors with a high degree of freedom, e.g.static AssociateDescription<TupleDesc_F64>
kdtree
(@Nullable ConfigAssociateNearestNeighbor configNN, int dimension) Approximate association using a K-D tree degree of moderate size (10-15) that uses a best-bin-first search order.static <TD extends TupleDesc<TD>>
KdTreeDistance<TD>kdtreeDistance
(int dof, Class<TD> type) static <D> ScoreAssociation<D>
scoreEuclidean
(Class<D> tupleType, boolean squared) Scores features based on the Euclidean distance between them.static <D> ScoreAssociation<D>
scoreHamming
(Class<D> tupleType) Hamming distance between two binary descriptors.static ScoreAssociation<NccFeature>
scoreNcc()
Scores features based on their Normalized Cross-Correlation (NCC).static <D> ScoreAssociation<D>
Scores features based on Sum of Absolute Difference (SAD).
-
Constructor Details
-
FactoryAssociation
public FactoryAssociation()
-
-
Method Details
-
generic
public static <D extends TupleDesc<D>> AssociateDescription<D> generic(ConfigAssociate config, DescriptorInfo<D> info) -
generic2
Creates a generic association algorithm that uses descriptors as well as the 2D location of image features. -
ensureUnique
Checks and if necessary wraps the association to ensure that it returns only unique associations -
ensureUnique
Checks and if necessary wraps the association to ensure that it returns only unique associations -
greedy
public static <D> AssociateDescription<D> greedy(@Nullable @Nullable ConfigAssociateGreedy config, ScoreAssociation<D> score) Returns an algorithm for associating features together which uses a brute force greedy algorithm. SeeAssociateGreedyDesc
for details.- Type Parameters:
D
- Data structure being associated- Parameters:
score
- Computes the fit score between two features.config
- Configuration- Returns:
- AssociateDescription
-
greedy2D
public static <D> AssociateDescription2D<D> greedy2D(@Nullable @Nullable ConfigAssociateGreedy config, ConfigLength maxDistance, ScoreAssociation<D> score) Returns an algorithm for associating features together which uses a brute force greedy algorithm. SeeAssociateGreedyDesc
for details.- Type Parameters:
D
- Data structure being associated- Parameters:
score
- Computes the fit score between two features.config
- ConfigurationmaxDistance
- Specifies maximum distance allowed.- Returns:
- AssociateDescription
-
kdtree
public static AssociateDescription<TupleDesc_F64> kdtree(@Nullable @Nullable ConfigAssociateNearestNeighbor configNN, int dimension) Approximate association using a K-D tree degree of moderate size (10-15) that uses a best-bin-first search order.- Parameters:
dimension
- Number of elements in the feature vector- Returns:
- Association using approximate nearest neighbor
- See Also:
-
kdRandomForest
public static AssociateDescription<TupleDesc_F64> kdRandomForest(@Nullable @Nullable ConfigAssociateNearestNeighbor configNN, int dimension, int numTrees, int numConsiderSplit, long randomSeed) Approximate association using multiple random K-D trees (random forest) for descriptors with a high degree of freedom, e.g. > 20- Parameters:
dimension
- Number of elements in the feature vectornumTrees
- Number of trees that are considered. Try 10 and tune.numConsiderSplit
- Number of nodes that are considered when generating a tree. Must be less than the point's dimension. Try 5randomSeed
- Seed used by random number generator- Returns:
- Association using approximate nearest neighbor
- See Also:
-
kdtreeDistance
-
associateNearestNeighbor
public static AssociateNearestNeighbor<TupleDesc_F64> associateNearestNeighbor(@Nullable @Nullable ConfigAssociateNearestNeighbor config, NearestNeighbor nn) -
defaultScore
Given a feature descriptor type it returns a "reasonable" defaultScoreAssociation
.- Parameters:
tupleType
- Class type which extendsTupleDesc
- Returns:
- A class which can score two potential associations
-
scoreSad
Scores features based on Sum of Absolute Difference (SAD).- Parameters:
tupleType
- Type of descriptor being scored- Returns:
- SAD scorer
-
scoreNcc
Scores features based on their Normalized Cross-Correlation (NCC).- Returns:
- NCC score
-
scoreEuclidean
Scores features based on the Euclidean distance between them. The square is often used instead of the Euclidean distance since it is much faster to compute.- Parameters:
tupleType
- Type of descriptor being scoredsquared
- IF true the distance squared is returned. Usually true- Returns:
- Euclidean distance measure
-
scoreHamming
Hamming distance between two binary descriptors.- Parameters:
tupleType
- Type of descriptor being scored- Returns:
- Hamming distance measure
-