import cv2
import numpy as np
image = cv2.imread('image.jpg', 0)
template = cv2.imread('part.jpg', 0)
res = cv2.matchTemplate(image, template, cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)
threshold = 0.8
if max_val > threshold:
top_left = max_loc
print("Подкартинка найдена:", top_left)
else:
print("Подкартинка не найдена")