bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / feature / match / match_descriptors
function
skimage.feature.match:match_descriptors
source: /dev/scikit-image/src/skimage/feature/match.py :5
Signature
def match_descriptors ( descriptors1 , descriptors2 , metric = None , p = 2 , max_distance = inf , cross_check = True , max_ratio = 1.0 ) Summary
Brute-force matching of descriptors.
Extended Summary
For each descriptor in the first set this matcher finds the closest descriptor in the second set (and vice-versa in the case of enabled cross-checking).
Parameters
descriptors1: ndarray of shape (M, P)Descriptors of size P about M keypoints in the first image.
descriptors2: ndarray of shape (N, P)Descriptors of size P about N keypoints in the second image.
metric: str, see `metric` in :func:`scipy.spatial.distance.cdist`, optionalThe metric to compute the distance between two descriptors. The Hamming distance should be used for binary descriptors. By default the L2-norm is used for all descriptors of dtype float or double and the Hamming distance is used for binary descriptors automatically.
p: int, optionalThe p-norm to apply for
metric='minkowski'.max_distance: float, optionalMaximum allowed distance between descriptors of two keypoints in separate images to be regarded as a match.
cross_check: bool, optionalIf True, the matched keypoints are returned after cross checking i.e. a matched pair (keypoint1, keypoint2) is returned if keypoint2 is the best match for keypoint1 in second image and keypoint1 is the best match for keypoint2 in first image.
max_ratio: float, optionalMaximum ratio of distances between first and second closest descriptor in the second set of descriptors. This threshold is useful to filter ambiguous matches between the two descriptor sets. The choice of this value depends on the statistics of the chosen descriptor, e.g., for SIFT descriptors a value of 0.8 is usually chosen, see D.G. Lowe, "Distinctive Image Features from Scale-Invariant Keypoints", International Journal of Computer Vision, 2004.
Returns
matches: (Q, 2) arrayIndices of corresponding matches in first and second set of descriptors, where
matches[:, 0]denote the indices in the first andmatches[:, 1]the indices in the second set of descriptors.
Aliases
-
skimage.feature.match_descriptors