Skip to content

Commit

Permalink
fix: three dimensional points for get body points
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Sep 15, 2024
1 parent cdc3f85 commit 973e3e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyfishsensedev/image/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ def height(self) -> int:

return height

def get_points_body_space(self, points: np.ndarray) -> np.ndarray:
def get_physical_measurements(self, points: np.ndarray) -> np.ndarray:
return (points / float(Pdf.DPI)) * INCH_TO_M
8 changes: 7 additions & 1 deletion pyfishsensedev/plane_detector/slate_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ def _get_points_image_space(self):
def _get_points_body_space(self):
template_matches, _ = self._get_template_matches()

return self._pdf.get_points_body_space(template_matches.cpu().numpy())
num_points, _ = template_matches.shape
objp = np.zeros((num_points, 3), np.float32)
objp[:, :2] = self._pdf.get_physical_measurements(
template_matches.cpu().numpy()
)

return objp

def is_valid(self):
template_matches, _ = self._get_template_matches()
Expand Down

0 comments on commit 973e3e0

Please sign in to comment.