5
0
mirror of https://github.com/sml2h3/ddddocr.git synced 2025-05-04 06:31:30 +08:00

Merge pull request #176 from kvii/pr_target_x

滑块匹配方法返回起始 x 坐标。
This commit is contained in:
Sml2h3 2024-05-27 09:38:15 +08:00 committed by GitHub
commit d69979f642
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2766,7 +2766,8 @@ class DdddOcr(object):
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)
h, w = target.shape[:2]
bottom_right = (max_loc[0] + w, max_loc[1] + h)
return {"target_y": target_y,
return {"target_x": target_x,
"target_y": target_y,
"target": [int(max_loc[0]), int(max_loc[1]), int(bottom_right[0]), int(bottom_right[1])]}
def slide_comparison(self, target_bytes: bytes = None, background_bytes: bytes = None):