From 699a33bdeb8b32ae034fe71157c95ee9b218ba4e Mon Sep 17 00:00:00 2001 From: SkywalkerJi Date: Sat, 12 Mar 2022 18:45:02 +0800 Subject: [PATCH] issue #22 --- mdt_cv.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 11 deletions(-) diff --git a/mdt_cv.py b/mdt_cv.py index 275f137..f958cc9 100644 --- a/mdt_cv.py +++ b/mdt_cv.py @@ -17,18 +17,63 @@ pass windll.user32.SetProcessDPIAware() BOXES = ( - ((55, 159, 126, 231), (41, 169, 124, 253), (125, 192, 349, 414)), # 1280x720 - ((58, 170, 135, 246), (44, 181, 132, 269), (134, 205, 373, 442)), # 1366x768 - ((61, 179, 142, 259), (46, 190, 140, 284), (141, 216, 392, 466)), # 1440x810 - ((68, 199, 158, 288), (51, 212, 156, 316), (156, 240, 437, 518)), # 1600x900 - ((82, 239, 189, 346), (61, 254, 186, 379), (187, 288, 524, 622)), # 1920x1080 - ((87, 255, 202, 369), (66, 271, 199, 404), (200, 307, 559, 663)), # 2048x1152 - ((109, 318, 252, 461), (82, 339, 249, 505), (250, 384, 698, 829)), # 2560x1440 - ((136, 398, 316, 576), (102, 424, 312, 632), (312, 480, 874, 1036)), # 3200x1800 - ((164, 478, 378, 692), (122, 508, 372, 758), (374, 576, 1048, 1244)), # 3840x2160 + ( + (55, 159, 126, 231), + (41, 169, 124, 253), + (125, 192, 349, 414), + (63, 147, 158, 286), + ), # 1280x720 + ( + (58, 170, 135, 246), + (44, 181, 132, 269), + (134, 205, 373, 442), + (67, 156, 169, 304), + ), # 1366x768 + ( + (61, 179, 142, 259), + (46, 190, 140, 284), + (141, 216, 392, 466), + (70, 165, 177, 321), + ), # 1440x810 + ( + (68, 199, 158, 288), + (51, 212, 156, 316), + (156, 240, 437, 518), + (78, 183, 197, 357), + ), # 1600x900 + ( + (82, 239, 189, 346), + (61, 254, 186, 379), + (187, 288, 524, 622), + (94, 220, 236, 428), + ), # 1920x1080 + ( + (87, 255, 202, 369), + (66, 271, 199, 404), + (200, 307, 559, 663), + (100, 235, 253, 457), + ), # 2048x1152 + ( + (109, 318, 252, 461), + (82, 339, 249, 505), + (250, 384, 698, 829), + (125, 293, 316, 571), + ), # 2560x1440 + ( + (136, 398, 316, 576), + (102, 424, 312, 632), + (312, 480, 874, 1036), + (157, 367, 394, 713), + ), # 3200x1800 + ( + (164, 478, 378, 692), + (122, 508, 372, 758), + (374, 576, 1048, 1244), + (188, 440, 474, 856), + ), # 3840x2160 ) -last_hash = [0] * 3 +last_hash = [0] * 4 art_hash = {} with open("./data/hash.json", "r", encoding="utf-8") as f: art_hash = loads(f.read()) @@ -96,7 +141,7 @@ def get_scan(): resolution = 8 results = [] - for i in range(3): + for i in range(4): _sample = full_img.crop(BOXES[resolution][i]) _hash = dhash.dhash_int(_sample, 16) if dhash.get_num_bits_different(_hash, last_hash[i]) > 10: