KeypointMatcher¶
- class giant.image_processing.feature_matchers.KeypointMatcher(options_type, *args, options=None, **kwargs)[source]¶
Abstract base class defining the interface for keypoint detection and matching.
- Parameters:
options (KeypointMatcherOptions | None) – the option dataclass to configure with
options_type (type[KeypointMatcherOptions])
- abstractmethod detect_keypoints(image)[source]¶
Detect keypoints and compute descriptors in an image.
- Parameters:
image (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – The image to search for keypoints
- Returns:
Tuple of (keypoints, descriptors)
- Return type:
tuple[Sequence[KeyPoint], ndarray[tuple[Any, …], dtype[_ScalarT]]]
- match_descriptors(descriptors1, descriptors2)[source]¶
Match keypoint descriptors using FLANN and Lowe’s ratio test.
- Parameters:
descriptors1 (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Descriptors from first image
descriptors2 (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Descriptors from second image
- Returns:
Tuple of (good_matches, all_matches)
- Return type:
tuple[Sequence[DMatch], Sequence[Sequence[DMatch]]]
This can be overridden if desired
- match_images(image1, image2)[source]¶
Orchestrates the detect-then-match process.
This concrete method fulfills the ImageMatcher interface requirement. It uses the abstract detect_and_compute and match_descriptors methods to perform the full matching pipeline.
- Parameters:
image1 (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – The first image to match keypoints
image2 (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – The second image to match keypoints
- Returns:
An array of the matched keypoint locations as nx2x2
- Return type:
ndarray[tuple[Any, …], dtype[float64]]
Methods
Detect keypoints and compute descriptors in an image. |
|
Match keypoint descriptors using FLANN and Lowe's ratio test. |
|
Orchestrates the detect-then-match process. |
|
Filters matches based on the Lowe's ratio test |