Skip to content

Commit

Permalink
solved bug on upright option
Browse files Browse the repository at this point in the history
  • Loading branch information
lcmrl committed Nov 6, 2024
1 parent ef513e1 commit d1a59d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/deep_image_matching/image_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def run(self):
timer.update("generate_pairs")

# Try to rotate images so they will be all "upright", useful for deep-learning approaches that usually are not rotation invariant
if self.config.general["upright"]:
if (self.config.general["upright"] in ["custom", "2clusters", "exif"]):
self.rotate_upright_images(self.config.general["upright"])
timer.update("rotate_upright_images")

Expand Down Expand Up @@ -721,14 +721,14 @@ def rotate_back_features(self, feature_path: Path) -> None:
x_rot = W - x
rotated_keypoints[r, 0], rotated_keypoints[r, 1] = x_rot, y_rot

if theta == 90:
if theta == 270:
for r in range(keypoints.shape[0]):
x, y = keypoints[r, 0], keypoints[r, 1]
y_rot = W - x
x_rot = y
rotated_keypoints[r, 0], rotated_keypoints[r, 1] = x_rot, y_rot

if theta == 270:
if theta == 90:
for r in range(keypoints.shape[0]):
x, y = keypoints[r, 0], keypoints[r, 1]
y_rot = x
Expand Down

0 comments on commit d1a59d1

Please sign in to comment.