Class AssociateNearestNeighbor_ST<D>

java.lang.Object
boofcv.alg.feature.associate.AssociateNearestNeighbor<D>
boofcv.alg.feature.associate.AssociateNearestNeighbor_ST<D>
All Implemented Interfaces:
Associate<D>, AssociateDescription<D>

public class AssociateNearestNeighbor_ST<D>
extends AssociateNearestNeighbor<D>

Matches features using a NearestNeighbor search from DDogleg. The source features are processed as a lump using NearestNeighbor.setPoints(java.util.List, boolean) while destination features are matched one at time using NearestNeighbor.Search.findNearest(Object, double, org.ddogleg.nn.NnData). Typically the processing of source features is more expensive and should be minimized while looking up destination features is fast. Multiple matches for source features are possible while there will only be a unique match for each destination feature.

An optional ratio test inspired from [1] can be used. The ratio between the best and second best score is found. if the difference is significant enough then the match is accepted. This this is a ratio test, knowing if the score is squared is important. Please set the flag correctly. Almost always the score is Euclidean distance squared.

[1] Lowe, David G. "Distinctive image features from scale-invariant keypoints." International journal of computer vision 60.2 (2004): 91-110.

  • Constructor Details

    • AssociateNearestNeighbor_ST

      public AssociateNearestNeighbor_ST​(NearestNeighbor<D> alg, Class<D> descType)
  • Method Details

    • setSource

      public void setSource​(FastAccess<D> listSrc)
      Description copied from interface: AssociateDescription
      Sets the list of source features. NOTE: A reference to the input list might be saved internally until the next call to this function.
      Specified by:
      setSource in interface AssociateDescription<D>
      Overrides:
      setSource in class AssociateNearestNeighbor<D>
      Parameters:
      listSrc - List of features
    • setDestination

      public void setDestination​(FastAccess<D> listDst)
      Description copied from interface: AssociateDescription
      Sets the list of destination features NOTE: A reference to the input list might be saved internally until the next call to this function.
      Specified by:
      setDestination in interface AssociateDescription<D>
      Overrides:
      setDestination in class AssociateNearestNeighbor<D>
      Parameters:
      listDst - List of features
    • associate

      public void associate()
      Description copied from interface: Associate
      Finds the best match for each item in the source list with an item in the destination list.
    • getDescriptionType

      public Class<D> getDescriptionType()
      Description copied from interface: Associate
      Returns the type of object it can associate