Skip to content

Commit

Permalink
issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
SkywalkerJi committed Mar 12, 2022
1 parent 0e52188 commit 699a33b
Showing 1 changed file with 56 additions and 11 deletions.
67 changes: 56 additions & 11 deletions mdt_cv.py
Expand Up @@ -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())
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 699a33b

Please sign in to comment.