Class FactoryAssociation

java.lang.Object
boofcv.factory.feature.associate.FactoryAssociation

public class FactoryAssociation
extends Object
Creates algorithms for associating TupleDesc_F64 features.
  • Constructor Details

    • FactoryAssociation

      public FactoryAssociation()
  • Method Details

    • generic

      public static <D> AssociateDescription<D> generic​(ConfigAssociate config, DescriptorInfo info)
    • generic2

      public 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.
    • ensureUnique

      public static <D> AssociateDescription<D> ensureUnique​(AssociateDescription<D> associate)
      Checks and if neccisary wraps the association to ensure that it returns only unique associations
    • ensureUnique

      public static <D> AssociateDescription2D<D> ensureUnique​(AssociateDescription2D<D> associate)
      Checks and if neccisary 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. See AssociateGreedyDesc 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. See AssociateGreedyDesc for details.
      Type Parameters:
      D - Data structure being associated
      Parameters:
      score - Computes the fit score between two features.
      config - Configuration
      maxDistance - 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:
      AssociateNearestNeighbor_ST, KdTreeSearch1Bbf
    • 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 vector
      numTrees - 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 5
      randomSeed - Seed used by random number generator
      Returns:
      Association using approximate nearest neighbor
      See Also:
      AssociateNearestNeighbor_ST, KdForestBbfNearestNeighbor
    • kdtreeDistance

      public static <TD extends TupleDesc<TD>> KdTreeDistance<TD> kdtreeDistance​(int dof, Class<TD> type)
    • associateNearestNeighbor

      public static AssociateNearestNeighbor<TupleDesc_F64> associateNearestNeighbor​(@Nullable @Nullable ConfigAssociateNearestNeighbor config, NearestNeighbor nn)
    • defaultScore

      public static <D> ScoreAssociation<D> defaultScore​(Class<D> tupleType)
      Given a feature descriptor type it returns a "reasonable" default ScoreAssociation.
      Parameters:
      tupleType - Class type which extends TupleDesc
      Returns:
      A class which can score two potential associations
    • scoreSad

      public static <D> ScoreAssociation<D> scoreSad​(Class<D> tupleType)
      Scores features based on Sum of Absolute Difference (SAD).
      Parameters:
      tupleType - Type of descriptor being scored
      Returns:
      SAD scorer
    • scoreNcc

      public static ScoreAssociation<NccFeature> scoreNcc()
      Scores features based on their Normalized Cross-Correlation (NCC).
      Returns:
      NCC score
    • scoreEuclidean

      public static <D> ScoreAssociation<D> scoreEuclidean​(Class<D> tupleType, boolean squared)
      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 scored
      squared - IF true the distance squared is returned. Usually true
      Returns:
      Euclidean distance measure
    • scoreHamming

      public static <D> ScoreAssociation<D> scoreHamming​(Class<D> tupleType)
      Hamming distance between two binary descriptors.
      Parameters:
      tupleType - Type of descriptor being scored
      Returns:
      Hamming distance measure