FeatureMatch.by_id1#

FeatureMatch.by_id1(id: int) FeatureMatch | None[source]#

Find match by feature id in first set

Parameters:

id (int) – id of feature in the first feature set

Returns:

match that includes feature id or None

Return type:

FeatureMatch instance containing one correspondence

A FeatureMatch object can contains multiple correspondences which are essentially tuples (id1, id2) where id1 and id2 are indices into the first and second feature sets that were matched. Each feature has a position, strength, scale and id.

This method returns the match that contains the feature in the first feature set with specific id. If no such match exists it returns None.

Note

  • For efficient lookup, on the first call a dict is built that maps feature id to index in the feature set.

  • Useful when features in the sets come from multiple images and id is used to indicate the source image.

Seealso:

BaseFeature2D BaseFeature2D.id by_id2