pair_coordinates¶
- pair_coordinates(set_a, set_b, radius)[source]¶
Find optimal unique pairing between two sets of coordinates.
This function uses the Munkres or Kuhn-Munkres algorithm behind the scene to find the most optimal unique pairing when pairing points in set B against points in set A, using Euclidean distance as the cost function.
- Parameters:
set_a (np.ndarray) – An array of shape Nx2 contains the of XY coordinate of N different points.
set_b (np.ndarray) – An array of shape Mx2 contains the of XY coordinate of M different points.
radius (float) – Valid area around a point in set A to consider a given coordinate in set B a candidate for matching.
- Returns:
numpy.ndarray
- Pairing:An array of shape Kx2, each item in K contains indices where point at index [0] in set A paired with point in set B at index [1].
numpy.ndarray
- Unpaired A:Indices of unpaired points in set A.
numpy.ndarray
- Unpaired B:Indices of unpaired points in set B.
- Return type: