Skip to content

Commit

Permalink
Apply image cropping in matching result visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
f-fl0 committed Jan 16, 2024
1 parent f338401 commit 5061f0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions match_two.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def match_two(model, device, config, im_one, im_two, plot_save_path):
tqdm.write('====> Plotting Local Features and save them to ' + str(join(plot_save_path, 'patchMatchings.png')))

# using cv2 for their in-built keypoint correspondence plotting tools
if crop_roi is not None:
top, left, bottom, right = crop_roi
im_one = im_one[top:bottom,left:right]
im_two = im_two[top:bottom,left:right]
cv_im_one = cv2.resize(im_one, (int(config['feature_extract']['imageresizeW']), int(config['feature_extract']['imageresizeH'])))
cv_im_two = cv2.resize(im_two, (int(config['feature_extract']['imageresizeW']), int(config['feature_extract']['imageresizeH'])))
# cv2 resize slightly different from torch, but for visualisation only not a big problem
Expand Down

0 comments on commit 5061f0f

Please sign in to comment.