admin
2024-04-16 2a2e183770e86c231ac732701fb179a604b61b23
gui_wx.py
@@ -457,7 +457,7 @@
    # 实际位置(左,上,右,下)
    rect = win32gui.GetWindowRect(hwnd)
    # 格式为:(上边距,宽度,高度)
    # 格式为:(上边距,宽度,高度,缩放倍数)
    rect_ = setting.get_ths_auto_code_rect()
    # 测试
    scale = 1 if constant.IS_TEST else 1.5
@@ -466,6 +466,8 @@
    width = int((rect[2] - rect[0]) * scale)
    left = width - rect_[1]
    img = win32_util.window_capture(hwnd, (left, rect_[0], width - 1, rect_[0] + rect_[2]), scale)
    if int(time.time()) % 5 == 0:
        cv2.imwrite(f"test2.png", opencv_util.gray_img(img))
    clip_img, details = opencv_util.clip_ths_code_area(img)
    start_time = time.time()
    code = ocr_util.recognize_code(clip_img)