CODE:
import cv2
from multiprocessing import Process, Pipe
import threading
def find_image(template_path, target_path):
template = cv2.imread(template_path, cv2.IMREAD_GRAYSCALE)
target = cv2.imread(target_path, cv2.IMREAD_GRAYSCALE)
result = cv2.matchTemplate(target, template, cv2.TM_CCOEFF_NORMED)
_, max_val, _, max_loc = cv2.minMaxLoc(result)
threshold = 0.8
if max_val >= threshold:
top_left = max_loc
return top_left
else:
return -1
from multiprocessing import Process, Pipe
import threading
def find_image(template_path, target_path):
template = cv2.imread(template_path, cv2.IMREAD_GRAYSCALE)
target = cv2.imread(target_path, cv2.IMREAD_GRAYSCALE)
result = cv2.matchTemplate(target, template, cv2.TM_CCOEFF_NORMED)
_, max_val, _, max_loc = cv2.minMaxLoc(result)
threshold = 0.8
if max_val >= threshold:
top_left = max_loc
return top_left
else:
return -1
Подскажите пожалуйста, как єтот метод использовать в Кибор