1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 14:27:00 +08:00

Opt: Refactor module enhancement

This commit is contained in:
Horizon101011
2022-03-12 01:22:31 +08:00
parent ec6f20720d
commit 2f5b19949e
11 changed files with 76 additions and 81 deletions

View File

@@ -218,8 +218,8 @@ class Button(Resource):
image_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
self_image_gray = cv2.cvtColor(self.image, cv2.COLOR_BGR2GRAY)
# binarization
image_binary = cv2.threshold(image_gray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
self_image_binary = cv2.threshold(self_image_gray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
_, image_binary = cv2.threshold(image_gray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
_, self_image_binary = cv2.threshold(self_image_gray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
# template matching
res = cv2.matchTemplate(self_image_binary, image_binary, cv2.TM_CCOEFF_NORMED)
_, similarity, _, point = cv2.minMaxLoc(res)