Skip to content

boxmot.trackers.common.motion.cmc.keypoints

filter_keypoint_matches

filter_keypoint_matches(
    knn: Sequence[Sequence[DMatch]],
    previous_keypoints: Sequence[KeyPoint],
    current_keypoints: Sequence[KeyPoint],
    image_size: tuple[int, int],
) -> tuple[list[DMatch], ndarray, ndarray]

Apply ORB/SIFT ratio and spatial gates in batches, preserving match order.

OpenCV exposes descriptor matches as objects, so their attributes must be collected once. Keypoint conversion, coordinate arithmetic and all numeric gates then operate on arrays. Returned points are float32 RANSAC inputs.

draw_keypoint_matches

draw_keypoint_matches(
    previous: ndarray,
    current: ndarray,
    previous_keypoints: Sequence[KeyPoint],
    current_keypoints: Sequence[KeyPoint],
    matches: Sequence[DMatch],
    detections: ndarray | None,
) -> ndarray

Draw matching points with batched conversion and unchanged draw order.