728x90 cv21 OpenCV - 파이썬 cv2 이미지 속에 특정 이미지 감지하기 def isExistImage(a, b, c=0.65): print("이미지 존재 여부") img_rgb = cv2.imread(a) template = cv2.imread(b) h, w = template.shape[:-1] res = cv2.matchTemplate(img_rgb, template, cv2.TM_CCOEFF_NORMED) threshold = c loc = np.where(res >= threshold) return len( loc[0] ) != 0 print(isExistImage("screen.png", "target.png")) # True or False def getMatchPosition(a, b, c=0.65): print("이미지 위치 가져오기") img_rgb = cv.. 2023. 1. 16. 이전 1 다음 728x90