Skip to content

Commit

Permalink
fix: use image matcher defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Sep 15, 2024
1 parent e3eda9e commit 594e714
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion pyfishsensedev/library/homography/image_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Due to licensing issues, make sure you are using the correct version of SuperPoint.
"""

from typing import Tuple

import torch

from pyfishsensedev.library.homography.models.lightglue import LightGlue
Expand All @@ -29,7 +31,7 @@ def __init__(self, template: torch.Tensor, com_license=True, processing_conf={})
processing_conf["extractor"] if "extractor" in processing_conf else {}
)

def __call__(self, image1: torch.Tensor):
def __call__(self, image1: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:
"""Given a calibration image, return its matches with the template.
Input:
image1: torch.Tensor
Expand Down
19 changes: 10 additions & 9 deletions pyfishsensedev/plane_detector/slate_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ def __init__(self, image: np.ndarray[np.uint8], pdf: Pdf) -> None:
super().__init__(image)

self._pdf = pdf
self._image_matcher = ImageMatcher(
numpy_image_to_torch(self._pdf.image),
processing_conf={
"preprocess": {"gamma": 2.0, "sharpness": None, "scale": 1.6},
"extractor": {"max_num_keypoints": None},
"matcher": {"filter_threshold": 0.5},
},
)
self._image_matcher = ImageMatcher(numpy_image_to_torch(self._pdf.image))
# processing_conf={
# "preprocess": {"gamma": 2.0, "sharpness": None, "scale": 1.6},
# "extractor": {"max_num_keypoints": None},
# "matcher": {"filter_threshold": 0.5},
# },
# )

def _get_template_matches(self):
feats0_matches, feats1_matches = self._image_matcher(numpy_image_to_torch(self.image))
feats0_matches, feats1_matches = self._image_matcher(
numpy_image_to_torch(self.image)
)

print("Done")

Expand Down

0 comments on commit 594e714

Please sign in to comment.