<jupyter_start><jupyter_text>Matching This notebook showcases the functions used for matching SIFT features.<jupyter_code># Handles relative import
import os, sys
dir2 = os.path.abspath('')
dir1 = os.path.dirname(dir2)
if not dir1 in sys.path: sys.path.append(dir1)

import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import seaborn as sns
import math

import const
import match as match_lib
import sift as sift_lib
img1 = cv2.imread('../images/box.png', flags=cv2.IMREAD_GRAYSCALE)
img2 = cv2.imread('../images/box_in_scene.png', flags=cv2.IMREAD_GRAYSCALE)
img1 = cv2.normalize(img1, None, alpha=0, beta=1, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32F)
img2 = cv2.normalize(img2, None, alpha=0, beta=1, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32F)

features1 = sift_lib.detect_sift_features(img1)
features2 = sift_lib.detect_sift_features(img2)
matches = match_lib.match_sift_features(features1, features2)
match_lib.visualize_matches(matches, img1, img2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10541586073500966, 'fraction_numerical': 0.0367504835589942, 'mean_word_length': 6.7819548872180455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '222507', 'license': 'MIT', 'n_tokens_mistral': 402, 'n_tokens_neox': 396, 'n_words': 87, 'path': 'notebooks/5_Matching.ipynb', 'repo_name': 'maxcrous/SIFT', 'size': '1034'}