Package boofcv.abst.feature.associate
Class EnforceUniqueByScore<Desc,A extends Associate<Desc>>
java.lang.Object
boofcv.abst.feature.associate.EnforceUniqueByScore<Desc,A>
- All Implemented Interfaces:
Associate<Desc>
- Direct Known Subclasses:
EnforceUniqueByScore.Describe
,EnforceUniqueByScore.Describe2D
public class EnforceUniqueByScore<Desc,A extends Associate<Desc>>
extends Object
implements Associate<Desc>
Ensures that the source and/or destination features are uniquely associated by resolving ambiguity using association score and preferring matches with better scores.
NOTE: Unassociated matches are recomputed from scratch. It could potentially add to the list created by the original algorithm for a bit more efficiency.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Implementation ofEnforceUniqueByScore
forAssociateDescription
.static class
Implementation ofEnforceUniqueByScore
forAssociateDescription2D
. -
Field Summary
Modifier and TypeFieldDescriptionprotected A
protected int
protected int
protected FindUnassociated
protected AssociateUniqueByScoreAlg
-
Constructor Summary
ConstructorDescriptionEnforceUniqueByScore
(A association, boolean checkSource, boolean checkDestination) Configures the algorithm to ensure source and/or destination features are unique. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Finds the best match for each item in the source list with an item in the destination list.Returns the type of object it can associateList of associated features.Specifies the type of score which is returned.Indexes of features in the destination set which are not associated.Indexes of features in the source set which are not associated.void
setMaxScoreThreshold
(double score) Associations are only considered if their score is less than or equal to the specified threshold.boolean
If at most one match is returned for each destination feature.boolean
If at most one match is returned for each source feature.
-
Field Details
-
uniqueByScore
-
association
-
unassociated
-
numSource
protected int numSource -
numDestination
protected int numDestination
-
-
Constructor Details
-
EnforceUniqueByScore
Configures the algorithm to ensure source and/or destination features are unique. The uniqueness of the input algorithm is checked and if it is already unique it that processing step will be skipped.- Parameters:
association
- The association algorithm which is being wrappedcheckSource
- Should source features be uniquecheckDestination
- Should destination features be unique
-
-
Method Details
-
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. -
getMatches
Description copied from interface:Associate
List of associated features. Indexes refer to the index inside the input lists.- Specified by:
getMatches
in interfaceAssociate<Desc>
- Returns:
- List of associated features.
-
getUnassociatedSource
Description copied from interface:Associate
Indexes of features in the source set which are not associated. WARNING: In some implementations the unassociated list is recomputed each time this function is invoked. In other implementations it was found virtually for free while the matches are found.- Specified by:
getUnassociatedSource
in interfaceAssociate<Desc>
- Returns:
- List of unassociated source features by index.
-
getUnassociatedDestination
Description copied from interface:Associate
Indexes of features in the destination set which are not associated. WARNING: In some implementations the unassociated list is recomputed each time this function is invoked. In other implementations it was found virtually for free while the matches are found.- Specified by:
getUnassociatedDestination
in interfaceAssociate<Desc>
- Returns:
- List of unassociated destination features by index.
-
setMaxScoreThreshold
public void setMaxScoreThreshold(double score) Description copied from interface:Associate
Associations are only considered if their score is less than or equal to the specified threshold. To remove any threshold test set this value to Double.MAX_VALUE- Specified by:
setMaxScoreThreshold
in interfaceAssociate<Desc>
- Parameters:
score
- The threshold.
-
getScoreType
Description copied from interface:Associate
Specifies the type of score which is returned.- Specified by:
getScoreType
in interfaceAssociate<Desc>
- Returns:
- Type of association score.
-
uniqueSource
public boolean uniqueSource()Description copied from interface:Associate
If at most one match is returned for each source feature.- Specified by:
uniqueSource
in interfaceAssociate<Desc>
- Returns:
- true for unique source association
-
uniqueDestination
public boolean uniqueDestination()Description copied from interface:Associate
If at most one match is returned for each destination feature.- Specified by:
uniqueDestination
in interfaceAssociate<Desc>
- Returns:
- true for unique destination association
-
getDescriptionType
Description copied from interface:Associate
Returns the type of object it can associate- Specified by:
getDescriptionType
in interfaceAssociate<Desc>
-