From 5061f0fd5c936a2bdf0bed31c63e884c2f703b23 Mon Sep 17 00:00:00 2001 From: f-fl0 Date: Wed, 21 Jun 2023 13:11:57 +0900 Subject: [PATCH] Apply image cropping in matching result visualization --- match_two.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/match_two.py b/match_two.py index c896f06..700d0c4 100755 --- a/match_two.py +++ b/match_two.py @@ -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